modalPanel + dataTable + commandLink = no action
bostone Apr 29, 2008 2:27 PMI'm implementing search pop-up. Here's what I want:
1. Enter search term and click "Search"
2. Pop-up dialog and feed search term into text field
3. Do the search. Dialog should display table with search results
4. Click on one of the results
5. Value should be populated back into master form
6. Dialog is dismissed
I have a prototype working for all steps except #5. When I click on the command link I can see the event firing, however my action method is never executed (I tried actionListener as well, same no go)
I'm using latest RichFaces 3.2, backing beans are in request scope but placing these in session scope doesn't change the outcome. I also tried a4j:support with same result
Here's a master form
<html 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" xmlns:s="http://myfaces.apache.org/sandbox" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:c="http://java.sun.com/jstl/core"> <ui:composition template="/WEB-INF/layout/layout.xhtml"> <ui:define name="title">Modal test</ui:define> <ui:define name="content"> <h:form id="modalMasterForm"> <h:inputText id="modalMasterValue" value="#{modalMaster.searchFor}" /> <a4j:commandButton id="searchButton" value="search" action="#{modalMaster.enterSearchValue}" reRender="searchValue"/> <rich:componentControl for="modalSearchPanel" attachTo="searchButton" operation="show" event="onclick" /> </h:form> <a4j:include viewId="WEB-INF/pages/modal/modalTestForm.xhtml" /> </ui:define> </ui:composition> </html>
And here's modal 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" xmlns:s="http://myfaces.apache.org/sandbox" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:c="http://java.sun.com/jstl/core"> <rich:modalPanel id="modalSearchPanel" width="400" height="350"> <h:form id="userLookupForm"> <f:facet name="header"> <h:outputText value="My Modal Test" /> </f:facet> <f:facet name="controls"> <h:panelGroup> <h:graphicImage value="/images/close.png" style="cursor:pointer" id="hidelink" /> <rich:componentControl for="modalSearchPanel" attachTo="hidelink" operation="hide" event="onclick" /> </h:panelGroup> </f:facet> <h:inputText id="searchValue" value="#{modalMaster.searchFor}" /> <a4j:commandButton id="search" action="${modalForm.search}" reRender="result" /> <div><a4j:outputPanel id="result"> <rich:dataTable id="seachResultsTable" var="seachResult" value="${modalForm.searchResults}"> <rich:column> <a4j:commandLink value="#{seachResult}" event="onmousedown" id="selectSearchValue" actionListener="${modalMaster.backFeed}" reRender="modalMasterValue" /> <rich:componentControl for="modalSearchPanel" operation="hide" event="onmouseup" /> </rich:column> </rich:dataTable> </a4j:outputPanel></div> </h:form> <div><h:outputLink value="#" id="link"> Hide Me <rich:componentControl for="modalSearchPanel" attachTo="link" operation="hide" event="onclick" /> </h:outputLink></div> </rich:modalPanel> </f:subview>
I found some links in reference to the similar problem with Trinidad table which has optional preserveDataModel="true" attribute. Couldn't find anything similar in RichFaces table so at this point I'm really banging my head and would appreciate any suggestions