1 2 Previous Next 29 Replies Latest reply on Jan 13, 2010 7:29 AM by ilya_shaikovsky Go to original post
      • 15. Re: a4j:commandButton not working in facelet
        ilya_shaikovsky
        Secondly my last question, is keepAlive = session?

         

        keepAlive works like conversation scope from Seam or viewScope from JSF 2.

         

        and why it throws exception when i use keepAlive?

        neither session scoped objects nor kept alive ones should be used to store component binding.

        • 16. Re: a4j:commandButton not working in facelet

          then how to resolve this issue?

          • 17. Re: a4j:commandButton not working in facelet

            The link provided by Nick tells that it can not be done using keepAlive. But i need to find some work around or some alternative for this bug.

            • 18. Re: a4j:commandButton not working in facelet

              yyq2009 wrote:

               

                     Hi, Waqas Arshad, I think your search button shuld be a non-ajax button, then after clicked the search button, the whole page will be refreshed, and in server side the <t:saveState/> knows what to be saved.

              even this doesn't solved the problem......

              • 19. Re: a4j:commandButton not working in facelet
                yyq2009
                  What problem, exception?
                • 20. Re: a4j:commandButton not working in facelet

                  yyq2009 wrote:

                   

                    What problem, exception?


                  No exception.

                  I changed search button frm ajax to jsf and place the t:saveState and put my dictionary list bean in the saveState but still action is not called.

                  • 21. Re: a4j:commandButton not working in facelet
                    yyq2009
                         Show me some brief page code.
                    • 22. Re: a4j:commandButton not working in facelet

                      <h:form id="search_form">

                       

                      <a4j:region selfRendered="true" id="word_region">

                       

                      <h:inputText id="search_fld" value="#{dictionary.word}" size="50" />

                       

                      <h:commandButton value="Search"

                      action="#{dictionary.searchWord}"

                      reRender="detail_table, table_div" id="searchBtn" />

                       

                      <h:selectOneRadio id="myRadio" value="#{dictionary.search_filter}"

                      styleClass="text" style="font-style: oblique;">

                       

                      <f:selectItem itemValue="exact" itemLabel="Exactly" />

                       

                      <f:selectItem itemValue="start_with" itemLabel="Start with" />

                       

                      <f:selectItem itemValue="contain" itemLabel="Contain" />

                       

                      </h:selectOneRadio>

                       

                      </a4j:region>

                       

                      <a4j:outputPanel id="table_div" layout="none">

                       

                      <h:dataTable id="detail_table" var="dic" border="0"

                      rowClasses="even_rows, odd_rows" cellpadding="2" cellspacing="1"

                      rows="5" value="#{dictionary.dictionayList}"

                      binding="#{dictionary.dataTable}">

                      ......

                       

                       

                      <h:column headerClass="datatable_width_detail">

                       

                      <f:facet name="header">

                       

                      <h:outputText value="" />

                       

                      </f:facet>

                       

                      <a4j:commandLink action="#{dictionary.showDetails}"

                      value="Detail" oncomplete="Richfaces.showModalPanel('panel')"

                      reRender="panel" />

                       

                      </h:column>

                       

                      </h:dataTable>

                       

                      <br />

                       

                      <rich:datascroller align="center" for="detail_table" maxPages="20"

                      renderIfSinglePage="false">

                       

                      </rich:datascroller>

                       

                      </a4j:outputPanel>

                       

                      <t:saveState value="#{dictionary.dictionayList}" />

                       

                       

                      <rich:modalPanel id="panel" width="600" height="300"

                      autosized="true">

                      .....

                       

                      </rich:modalPanel>

                       

                       

                       

                       

                       

                       

                       

                       

                       

                      • 23. Re: a4j:commandButton not working in facelet

                        sorry button does not contain re-render attribute. its

                         

                        <h:commandButton value="Search"

                        action="#{dictionary.searchWord}"

                        id="searchBtn" />

                         

                        • 24. Re: a4j:commandButton not working in facelet
                          yyq2009
                                Remove the region tag or be sure that the <t:saveState/> is in region zone.
                          • 25. Re: a4j:commandButton not working in facelet

                            its still not working, code is:

                             

                            <h:form id="search_form">

                            <h:inputText id="search_fld" value="#{dictionary.word}" size="50" />

                            <h:commandButton value="Search" action="#{dictionary.searchWord}" id="searchBtn" />

                            <h:selectOneRadio id="myRadio" value="#{dictionary.search_filter}" styleClass="text" style="font-style: oblique;">


                            <f:selectItem itemValue="exact" itemLabel="Exactly" />

                            <f:selectItem itemValue="start_with" itemLabel="Start with" />

                            <f:selectItem itemValue="contain" itemLabel="Contain" />

                            </h:selectOneRadio>


                            <a4j:outputPanel id="table_div" layout="none">

                            <h:dataTable id="detail_table" var="dic" border="0"

                            rowClasses="even_rows, odd_rows" cellpadding="2" cellspacing="1"

                            rows="5" value="#{dictionary.dictionayList}"

                            binding="#{dictionary.dataTable}">

                            ......

                            <h:column headerClass="datatable_width_detail">

                            <f:facet name="header">

                            <h:outputText value="" />

                            </f:facet>

                            <a4j:commandLink action="#{dictionary.showDetails}"

                            value="Detail" oncomplete="Richfaces.showModalPanel('panel')"

                            reRender="panel" />

                            </h:column>

                            </h:dataTable>

                            <br />


                            <rich:datascroller align="center" for="detail_table" maxPages="20"

                            renderIfSinglePage="false">


                            </rich:datascroller>


                            </a4j:outputPanel>

                            <t:saveState value="#{dictionary.dictionayList}" />


                            <rich:modalPanel id="panel" width="600" height="300"

                            autosized="true">

                            .....

                            </rich:modalPanel>

                            This problem is really sqeezing.

                            Isn't any way to do it the way i was doing previuosly? I mean instead of rendering entire page, i just need to do partial submitting using ajax.

                            • 26. Re: a4j:commandButton not working in facelet
                              nbelaevski

                              You can split your bean into two beans - the first holds properties and is kept alive, the second contains reference to the bound component.

                              Another options is to redesign your code, so that binding isn't necessary anymore.

                              • 27. Re: a4j:commandButton not working in facelet
                                yyq2009
                                Hi, Waqas Arshad, I'm sorry that I didn't noticed you binding the datatable to backing bean. Excep binding the datatable, everything works for me.
                                • 28. Re: a4j:commandButton not working in facelet

                                  but without binding datatable how would you pick the selected row data?

                                  • 29. Re: a4j:commandButton not working in facelet
                                    ilya_shaikovsky
                                    1 2 Previous Next