Unable to get field submitted
bostone May 11, 2008 1:43 AMI'm refactoring some code to switch from window pop-up to modal dialog. To my dismay, I cannot submit any fields in the form of modal pop-up beside the button itself. I shorten the code to just a single text field and a button, still nothing.
I call the modal from the main form by clicking on the button
<a4j:commandButton id="findContact" value="Manage Contacts" >
<a4j:actionparam name="contact" value="contact"
assignTo="#{contactBean.hiddenInput}" />
<rich:componentControl for="contactSearchPanel"
operation="show" event="onclick" />
</a4j:commandButton>My modal is in its own xhtml which is linked after the main form (here's last few lines of main xhtml)
</h:form> <a4j:include viewId="contactsPopUp.xhtml" /> </ui:define> </ui:composition> </body> </html>
Here's the complete code for pop-up xhtml
<f:subview 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:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
>
<h:form id="contactSearchForm">
<rich:modalPanel id="contactSearchPanel" width="500" height="400">
<f:facet name="header">
<h:outputText value="Manage Contacts" />
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="images/close.png" style="cursor:pointer" id="hidelink" />
<rich:componentControl for="contactSearchPanel" attachTo="hidelink" operation="hide"
event="onclick" />
</h:panelGroup>
</f:facet>
<h:inputText id="searchStr" size="25" value="#{contactBean.searchStr}"/>
<a4j:commandButton id="searchBtn" value="Search" styleClass="button" event="onclick"
actionListener="#{contactBean.search}" />
</rich:modalPanel>
</h:form>
</f:subview>
And, finally, here's HTTP post after clicking on Submit
AJAXREQUEST=_viewRoot&j_id131%3Aj_id132%3AcontactSearchForm%3AcontactSearchPanelOpenedState=&j_id131 %3Aj_id132%3AcontactSearchForm_SUBMIT=1&javax.faces.ViewState=w1OFfspRVmQfp9jw3RUunWsjC2gaFd5osuZOv1LCtE1cDIMcu8q12nlKyCsB %2BfWNqpwfmZnCBf5sOo6mNqViFPqXO2mOuIJ3%2FYWcidBfMsk%3D&j_id131%3Aj_id132%3AcontactSearchForm%3AsearchBtn =j_id131%3Aj_id132%3AcontactSearchForm%3AsearchBtn&
Am I doing anything wrong? I need to see value for "searchStr" and it's not in the headers.