1 2 Previous Next 19 Replies Latest reply on Feb 20, 2008 10:32 AM by pdaniel Go to original post
      • 15. Re: commandButton problem
        pdaniel

        Someone give me this answer:


        For a entire page refresh, you can use <jsp:include > ( <ui:include for a facelets ) tags, instead of the <a4j:include >

        xmlns:ui="http://java.sun.com/jsf/facelets"


        For me this solution worked.

        • 16. Re: commandButton problem
          viggo.navarsete

          pdaniel: Great news to hear that you finally solved your problem. Would you mind giving some more code to illustrate how you did this? It would be valuable to me, and also other developers trying to understand every bit of how the ajax-stuff works :)

          • 17. Re: commandButton problem
            mikeeprice

            One of my commandButtons wasn't working. Then I noticed I forgot to enclose it in

            <h:form>...</form>


            After I added that it worked OK.

            • 18. Re: commandButton problem
              mikeeprice

              I had commandButton that was not working. Then I noticed I forgot to enclose it in

              <h:form> ... </h:form>
              
              After I did that it worked OK.


              • 19. Re: commandButton problem
                pdaniel

                 

                "viggo.navarsete" wrote:
                pdaniel: Great news to hear that you finally solved your problem. Would you mind giving some more code to illustrate how you did this? It would be valuable to me, and also other developers trying to understand every bit of how the ajax-stuff works :)


                Ok, i will try to post some code :


                search.xhtml

                <h:form id="portlet_form"><table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                <td>
                <table width="40%" cellpadding="0" cellspacing="0" align="center">
                <tr>
                <td>

                <h:panelGrid columns="2" id="searchPanel">

                search fields here

                </h:panelGrid>
                </td>
                </tr>
                <tr>
                <td colspan="2" align="center">
                <a4j:commandButton action="#{controller.search}"
                value="Search"
                reRender="docSearchRes"/>
                </td>
                </tr>


                </table>
                </td>
                </tr>
                <tr>
                <td>
                <ui:include src="/portlets/portlet/jsf/xhtml/include/result.xhtml" /> (here was the problem)
                </td>
                </tr>
                </table>
                </h:form>



                result.xhtml

                <h:panelGroup id="docSearchRes">

                <rich:dataTable
                var="search"
                rendered="#{not empty bean.lists}"
                value="#{bean.listBean}" width="100%" cellpadding="0" cellspacing="0">
                <f:facet name="header">
                table header
                </f:facet>
                columns
                <rich:column>

                <a4j:commandButton actionListener="#{controller.executeView}" image="/images/edit.gif" reRender="panelModal" oncomplete="javascript:Richfaces.showModalPanel('panel')">
                <a4j:actionparam name="file_view_id" value="#{docsearch.fileId}"/>
                </a4j:commandButton>


                </rich:column>
                <f:facet name="footer">
                <h:commandButton action="newfile" value="New file" style="text-align:center" />
                </f:facet>




                </rich:dataTable>

                </h:panelGroup>



                <navigation-rule>

                <from-view-id>*</from-view-id>
                <navigation-case>
                <from-outcome>newfile</from-outcome>
                <to-view-id>/portlets/portlet/jsf/xhtml/newfile.xhtml</to-view-id>

                </navigation-case>
                </navigation-rule>


                Some content data was deleted to protect the informations. This is what i have now, and seems to work.

                Now i have another problem with rich:calendar, i get a javascript error Calendar is undefined. I resolve one problem i get another one :(

                1 2 Previous Next