Uncaught TypeError:
A4J.Query framework.
A4J.AJAX.P
A4J.AJAX.S
onclick
here are the contents of framework.
this._acti
my original code looked like this:
<ui:composition 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:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j" markupType="xhtml"
contentType="text/html" lang="no">
...
<a4j:outputPanel id="detailPanelHolder">
<a4j:outputPanel>
<h:form id="detailsForm">
...
<h:panelGrid>
<a4j:commandButton ajaxSingle="true"
value="#{msg['label.new.priceset']}"
reRender="addPanel"
oncomplete="#{rich:component('addPanel')}.show();"
action="#{...}"/>
</h:panelGrid>
...
</h:form>
<rich:modalPanel id="addPanel">
...
<h:form id="add">
...
<h:panelGrid columns="3" styleClass="dataTable"
footerClass="centered">
...
<f:facet name="footer">
<h:panelGroup>
<a4j:commandButton ajaxSingle="true"
value="#{msg['label.new.step']}"
reRender="addPanel" id="addPanelNStepBtn"
action="#{...}"/>
</h:panelGroup>
</f:facet>
</h:panelGrid>
</h:form>
</rich:modalPanel>
...
</a4j:outputPanel>
</a4j:outputPanel>
</ui:composition>
i didn't write the code myself and maybe the problem was partially due to the particular tag nesting, idk.
the solution that worked for me:
create an h:panelGroup inside the modalpanel h:form and rerender that panelGroup instead of the whole modalpanel, like this (changes in bold):
<ui:composition 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:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j" markupType="xhtml"
contentType="text/html" lang="no">
...
<a4j:outputPanel id="detailPanelHolder">
<a4j:outputPanel>
<h:form id="detailsForm">
...
<h:panelGrid>
<a4j:commandButton ajaxSingle="true"
value="#{msg['label.new.priceset']}"
reRender="addPricesetPanel"
oncomplete="#{rich:component('addPanel')}.show();"
action="#{...}"/>
</h:panelGrid>
...
</h:form>
<rich:modalPanel id="addPanel">
...
<h:form id="add">
<h:panelGrid id="addPricesetPanel">
...
<h:panelGrid columns="3" styleClass="dataTable"
footerClass="centered">
...
<f:facet name="footer">
<h:panelGroup>
<a4j:commandButton ajaxSingle="true"
value="#{msg['label.new.step']}"
reRender="addPricesetPanel" id="addPanelNStepBtn"
action="#{...}"/>
</h:panelGroup>
</f:facet>
</h:panelGrid>
</h:panelGrid>
</h:form>
</rich:modalPanel>
...
</a4j:outputPanel>
</a4j:outputPanel>
</ui:composition>
Thank You very much! This actually solved my problem as well, as I had the exact same behaviour with a modal panel. If I had found this on Stack Overflow I would have +1 it.
ReplyDelete