webtier@glassfish.java.net

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

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

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

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> 
 <h:commandLink value="update"  action="#{myBean.delete}" >
                   <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();
        String idNumber = params.get("id");
        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.