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

    a4j:status x f:subview

    Edilmar Alves Expert



      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:dataTable id="table" rows="#{login.maxResultPagina}"
                                cellpadding="0" cellspacing="0"
                                border="0" var="item" rowKeyVar="rowListTable"
                                rendered="#{consViagensCliente.listTable != null}"
                  <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 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"
                      <rich:modalPanel id="panel" width="800" height="550">
                        <f:facet name="header">
                            <h:outputText value="#{msgCliente['labelTituloDetViagem']}"></h:outputText>
                        <f:facet name="controls">
                            <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
                            <h:outputLink value="#" id="hidelink">[#{msgBotoes['labelFechar']}]</h:outputLink>

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

        • 1. Re: a4j:status x f:subview
          Nick Belaevski Master

          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 Alves Expert



            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".