Rich modalpanel events not populating form values

So here is a problem I was running into, I usually use rich:modalpanel just to display some data to the user, but the other day I needed to collect some input. After happily submitting my page all the submitted values were null, what the hell. After some research here are my conclusions on this problem.

We need to put “form” elements inside the modalPanel in order for this to work, and make sure that the ui:insert in our template is not nested within out top form.

Reason for this is because of where modalpanel is appended to the DOM, that is also a reason why we have a4j:form inside the panel.

<ui:define name="modalForm">
<rich:modalPanel id="center_modal">
 <a4j:form id="modalForm" prependId="true">
	 <f:facet name="header">
		<h:outputText value="Center Selection" />
	</f:facet>
		<f:facet name="controls">
			<h:graphicImage value="/images/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('center_modal')" />
	   </f:facet>
 
     CONTENT HERE
 
  </a4j:form>
  </rich:modalPanel> 
</ui:define>

Using Facelets and JSF 1.2

3 thoughts on “Rich modalpanel events not populating form values”

  1. Hello Greg,
    I see your answer to the question about how to embed browser into java swing, I have a question, have you implemented the classes BrowserConroller and FindWindow, I can’t find any information about these two classes, I am wondering could you do me a favor? Thanks.

    1. No I haven’t, I was just experimenting with that so I have not done any more work on it because of issues like you are having. I was just browsing via the FF source code and looking how they are using it.

Leave a Comment

Your email address will not be published. Required fields are marked *