The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20130121

[SOLVED] richfaces a4j:commandButton action method not getting called

i was having problems yesterday after recoding some jsf pages--the method saveParty wasn't getting called.


listTADs.xhtml (includes the file below, listTADParties.xhtml):

...
<rich:modalPanel id="modalPanelTA" autosized="true">
...
    <a4j:outputPanel id="modalPanelTA_content">
        <h:form>
            <h:panelGroup rendered="#{tadController.panelToShow == 'viewParties'}">
                <ui:include src="/listTADParties.xhtml" />
            </h:panelGroup>
        </h:form>
    </a4j:outputPanel>
</rich:modalPanel>
...



listTADParties.xhtml:

...
<rich:modalPanel>
    <h:form>
        ...
        <a4j:commandButton action="#{tadController.saveParty}" value="save" reRender="transportAgreementPartiesTbl"
            oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPartiesPanel')}.hide();"/>
        ...
    </h:form>
</rich:modalPanel>
...






the solution was removing the parent h:form in listTADs.xhtml (the problem was the form inside the other/parent form):

...
<a4j:outputPanel id="modalPanelTA_content">
    <h:panelGroup rendered="#{tadController.panelToShow == 'viewParties'}">
        <ui:include src="/listTADParties.xhtml" />
    </h:panelGroup>
</a4j:outputPanel>
...

No comments:

Post a Comment