0 Replies Latest reply on Aug 4, 2011 3:34 AM by Michael Yarv

    DataTable appears only for second time click a4j:commandButton

    Michael Yarv Newbie

      I have a page with <ui:include src="#{bean.path}" />

      When I click on button with id “show”, parameter with path passed to the bean and set in property bean.path, bean.renderPath set with “true”. h:panelGroup reRender on ajax. Now, for example,  bean.path == /app/index.xhtml. On page /app/index.xhtml I have a dataTable. DataTable appears only if I click on button with id “show” for second time.

       

      Page with <ui:include src="#{bean.path}" />

      <h:form>

      <a4j:commandButton value="show" render="panelGroup"

      action="#{bean.setPath}">

      </a4j:commandButton>

      <a4j:commandButton value="hide" render="panelGroup"

      action="#{bean.setPathHide}">

      </a4j:commandButton>

      </h:form>

      <h:panelGroup id="panelGroup">

      <h:panelGrid rendered="#{bean.renderPath}">

      <ui:include src="#{bean.path}" />

      </h:panelGrid>

      </h:panelGroup>

       

      Page /app/index.xhtml

      <rich:dataTable id="dataOutput" rows="#{bean.rowCount}"

      styleClass="tableBackground" rowClasses="tableOddRow,tableEvenRow"

      cellpadding="3" value="#{bean.list}"

      var="object" binding="#{bean.productClassTable}">

      <rich:column>

      <f:facet name="header">

      <h:outputText value="Id" />

      </f:facet>

       

      <h:commandLink value="#{object.id}" styleClass="commandLink"

      action="#{bean.edit}">

      </h:commandLink>

      </rich:column>

      <rich:column>

      <f:facet name="header">

      <h:outputText value="Ip" />

      </f:facet>

      <h:outputText value="#{object.ip}" />

      </rich:column>

      <rich:column>

      <f:facet name="header">

      <h:outputText value="jndiPort" />

      </f:facet>

      <h:outputText value="#{object.jndiPort}" />

      </rich:column>

      <rich:column>

      <a4j:commandLink value="Delete" styleClass="commandLink"

      action="#{bean.delete}" render="dataOutput">

      </a4j:commandLink>

      </rich:column>

      </rich:dataTable>