a4j:commandButton reads property twice / call getter twice while trying to render a table
djnose May 2, 2011 7:08 AMI hope my Problem is not that big maybe it is just a little problem which could be easy solved.
The point is, that if i use a a4j:commandButton, my getProperty function is called twice.
I have simple table which should be reloaded, if i filter it.
Pls. look at the following code for a better understanding:
<h:form id="filterProvider">
<h:panelGrid columns="6" >
<h:outputText value="Provider" />
<rich:select selectFirst="true" value="#{filterBean.defaultStringFilter}" id="filter_provider_providerName1">
<f:selectItems value="#{filterBean.defaultStringFilterList}" />
</rich:select>
<h:inputText value="#{tableDemo.provider.providerName1}">
</h:inputText>
<h:outputText value="Provider Name" />
<rich:select selectFirst="true" value="#{filterBean.defaultStringFilter}" id="filter_provider_providerName">
<f:selectItems value="#{filterBean.defaultStringFilterList}"/>
</rich:select>
<h:inputText value="#{tableDemo.provider.providerName}">
</h:inputText>
<h:outputText value="Provider ID" />
<rich:select selectFirst="true" value="#{filterBean.defaultIntFilter}" id="filter_provider_id">
<f:selectItems value="#{filterBean.defaultIntFilterList}"/>
</rich:select>
<h:inputText value="#{tableDemo.provider.id}">
</h:inputText>
</h:panelGrid>
<a4j:commandButton value="Suchen" render="demoTable"/>
</h:form>
<h:form id="formProviderTable">
<h:panelGrid>
<a4j:outputPanel id="demoTablePanel">
<rich:dataScroller for="demoTable" maxPages="5"/>
<rich:dataTable style="width: 750px;" value="#{tableDemo.providerList}" var="provider" id="demoTable" rows="#{configBean.rowSize}" rowClasses="row1, row2"
onrowmouseover="this.style.backgroundColor='#B5F3FB'"
onrowmouseout="this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}'" >
<rich:column>
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<h:outputText value="#{provider.id}" />
</rich:column>
// and so on...
it just calls a simple ManagedBean where
public List<Provider> getProviderList() {
is called twice!
What am i doing wrong? Thx for your help