webtier@glassfish.java.net

Re: [webtier] JSF 2.0: re-render a dataTable with Ajax ?

From: Celinio Fernandes <papouasied_at_yahoo.com>
Date: Wed, 13 Jan 2010 10:33:37 -0800 (PST)

Thanks for helping.
I understand that i need to reload the form or the page.
But i thought  the tag <f:ajax> would take care of it.

How do you reload the form/page in that case ?

--- On Thu, 1/14/10, Lincoln Baxter, III <lincolnbaxter_at_gmail.com> wrote:

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Subject: Re: [webtier] JSF 2.0: re-render a dataTable with Ajax ?
To: webtier_at_glassfish.dev.java.net
Date: Thursday, January 14, 2010, 12:18 AM

Or reload the entire page/data structure. Lincoln Baxter III





I found several posts dealing with my problem :
http://forums.java.net/jive/thread.jspa?messageID=332548


None gives answers unfortunately.

My problem is simple : I have a dataTable which contains a list of products, the last column has a link to delete a product.

  <h:form  id="Form1">
  
 <h:dataTable value="#{myBean.myList}"  id="dataTable1" ...>
 <h:column>
  ...
 </h:column>
 ...
  <h:column> 

                   <f:ajax execute="@this" render=":Form1:dataTable1"  />
                <f:param name="id" value="#{product.productid}"/>
 </h:commandLink>            
 </h:column> 
    </h:dataTable>
   
 </h:form>

My delete method looks like this :
 public void delete() {
        FacesContext context = FacesContext.getCurrentInstance();
        Map<String, String> params = context.getExternalContext().getRequestParameterMap();

        myEJB.delProduct(idNumber);
    }


It deletes the product. However it does not re-render the dataTable. What am i missing ?
What value should the render attribute be set to in that case ?

Thanks in advance for helping.