webtier@glassfish.java.net

Re: [webtier] f:ajax issue with h:dataTable

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Date: Wed, 18 Feb 2009 20:50:24 -0500

Hmm... that didn't work, but re-rendering the form does:

<f:ajax execute="move" render="containerForm" />

Seems odd to me...

On Wed, 2009-02-18 at 13:26 -0800, Jim Driscoll wrote:

> Wouldn't you have to say
>
> <f:ajax execute="move customers" render="customers" />
>
> ?
>
> Jim
>
> On 2/17/09 7:49 PM, Derek Hollis wrote:
> > I'm trying to use the f:ajax to re-render a datatable when I click on a
> > checkbox. When I click the checkbox the table would never re-render, but
> > during debug I saw that updateCustomer listener method would be called.
> > However if I changed the ajax tag to * <f:ajax execute="move"
> > render="customerUpdate" />* to re-render the form, it would work
> > perfectly. Any ideas?
> >
> > *----- Page ------*
> > <h:form id="customerUpdate">
> > <h:outputStylesheet name="SPMtables.css" />
> > <h:dataTable id="customers" binding="#{customerBean.custTable}"
> > var="cust" value="#{customerBean.customers}" styleClass="tbl"
> > rowClasses="odd, even">
> > <h:column>
> > <f:facet name="header">
> > <h:outputText value="Id" />
> > </f:facet>
> > <h:outputText value="#{cust.id <http://cust.id>}" />
> > </h:column>
> > <h:column>
> > <f:facet name="header">
> > <h:outputText value="Name" />
> > </f:facet>
> > <h:outputText value="#{cust.name <http://cust.name>}" />
> > </h:column>
> > <h:column>
> > <f:facet name="header">
> > <h:outputText value="Move customer" />
> > </f:facet>
> > <h:selectBooleanCheckbox id="move"
> > valueChangeListener="#{customerBean.updateCustomer}"
> > value="#{customerBean.frontShelf}">
> > * <f:ajax execute="move" render="customers" />*
> > </h:selectBooleanCheckbox>
> > </h:column>
> > </h:dataTable>
> > </h:form>
> >
> >
> > *--- CustomerBean ----*
> >
> > private HtmlDataTable custTable;
> > private List<Customer> customers;
> >
> > public void updateCustomer(final ValueChangeEvent event)
> > {
> > Customer cust = (Customer) custTable.getRowData();
> > customers.remove(cust);
> > }
> >
> >
> > --
> > Derek Hollis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>