I have a button that is supposed to close a modal panel and render several elements.
Is there an easy way to check if an element was rendered after the button was pressed?
example button:
<a4j:commandButton onclick="#{rich:component('modal')}.hide();"
style="background-repeat:no-repeat;width:18px;height:18px;"
image="includes/images/close.gif"
render=":id1 :id2">
<f:setPropertyActionListener target="#{Controller.attribute}" value="false" />
</a4j:commandButton>
The conditon of the
renderedattribute of all of the button’s parent components must be preserved when you’re submitting the form. So it should not only evaluatetrueduring the request of presenting the form with the button, but it should also evaluatetrueduring the request of processing the form submit. Easiest is to put the backing bean in the view scope by@ViewScoped.Also, if you’re re-rendering a component which in turn contains a
<h:form>, you need to explicitly add the client ID of that<h:form>to therenderattribute. E.g. when component with client IDid1has in turn a<h:form id="formOfId1">.You can debug this all by just exploring the HTTP traffic in the webbrowser’s developer toolset (press F12 in Chrome/IE9/Firebug and check the “Network” section).
See also: