2 Replies Latest reply on Aug 9, 2010 1:40 PM by edilmar

    a4j:status x f:subview

    edilmar

      Hi,

       

      My webapp is JSF2 + RichFaces3.3.3

      I have a facelet with filter fields + Search button + dataTable to display the results of filtering.

      Then, the first column at dataTable has a f:subview with a link used to display detail information.

       

      I inserted an a4j:status + rich:modalPanel to display a "Waiting..." message when processing

      the filter, for better user interfacing. Then, I changed h:commandButton to a4j:commandButton.

      The splash panel works fine, the dataTable is displayed after processing. However, when I

      click in a link to display the f:subview, the subview is showed fastly, splash is showed after this

      and the interface returns to filter with cleared fields and cleared dataTable.

       

      I imagine that a4j:status doesn't work with f:subview, right?

       

      Below is a part of the code for xhtml file...

      <h:commandButton id="consultar" value="#{msgBotoes['labelConsultar']}"
                               action="#{consViagensCliente.consultar}" reRender="table"/>

              <a4j:status id ="status" onstart="#{rich:component('splash')}.show()" onstop="#{rich:component('splash')}.hide()" />
              <rich:modalPanel id="splash" autosized="true" width="200" height="80" moveable="false" resizeable="false">
                <f:facet name="header"><h:outputText value="#{msgGeral['splash.titulo']}" /></f:facet>
                <h:outputText value="#{msgGeral['splash.msg']}" />
              </rich:modalPanel>

              <p>
                <rich:dataTable id="table" rows="#{login.maxResultPagina}"
                                onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                                onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                                cellpadding="0" cellspacing="0"
                                border="0" var="item" rowKeyVar="rowListTable"
                                value="#{consViagensCliente.listTable}"
                                rendered="#{consViagensCliente.listTable != null}"
                                >
                                <!--
                                binding="#{consViagensCliente.htmlDataTable}"
                                value="#{consViagensCliente.pageDataModel}"
                                -->
                  <rich:column width="0px" id="indice" styleClass="alignCenter">
                    <f:facet name="header"><h:outputText styleClass="headerText" value="" /></f:facet>
                    <h:outputLabel value="#{rowListTable+1}" />
                  </rich:column>
                  <rich:column width="60px" id="numConhecimento" styleClass="alignCenter">
                    <f:facet name="header"><h:outputText styleClass="headerText" value="#{msgCliente['consViagens.table.labelNumConhec']}" /></f:facet>
                    <f:subview id="detailViagem"
                               xmlns="http://www.w3.org/1999/xhtml"
                               xmlns:ui="http://java.sun.com/jsf/facelets"
                               xmlns:h="http://java.sun.com/jsf/html"
                               xmlns:f="http://java.sun.com/jsf/core"
                               xmlns:a4j="http://richfaces.org/a4j"
                               xmlns:rich="http://richfaces.org/rich">
                      <rich:modalPanel id="panel" width="800" height="550">
                        <f:facet name="header">
                          <h:panelGroup>
                            <h:outputText value="#{msgCliente['labelTituloDetViagem']}"></h:outputText>
                          </h:panelGroup>
                        </f:facet>
                        <f:facet name="controls">
                          <h:panelGroup>
                            <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
                            <h:outputLink value="#" id="hidelink">[#{msgBotoes['labelFechar']}]</h:outputLink>
                          </h:panelGroup>
                        </f:facet>

      ... rest of the subview and dataTable ...

        • 1. Re: a4j:status x f:subview
          nbelaevski

          Hi Edilmar,

           

          Are you re-rendering modal panel just after it's shown? Does the problem reproduce only when status is there? BTW, why do you need to use subview tag - is the content in separate file?

          • 2. Re: a4j:status x f:subview
            edilmar

            Hi,

             

            When user clicks search button, the dataTable is filled with results from database.

            But, there are many detail fields that I don't show in dataTable, I prefer to show in a detail subview when user clicks a link.

            And the problem occurs when user clicks a link, the subview is showed but the jsf form is completelly redrawed, like I would

            be clicked a "clear-all-like button".