I have an edit buttton on a search result page, That button whenever pushed should prompt the user to enter a date prior to continuing on to the next page.
Button without the modal feature:
<h:commandButton action="#{controller.open(rec, false)}" />
Somehow I would like to introduce a modal diaglog prior to opening the page to get the entered date from the model dialog and pass it to the open method, something like:
<h:commandButton onClick="openAModelDialog()"
action="#{controller.open(rec, false, enteredDate)}" />
I have SEAM 2.2, JSF and Richfaces available to me. Not sure how to best to meet this need.
What I have accomplished so far: Altered the button to open a modal dialog.
<a4j:commandButton onclick="#{rich:component('mp')}.show(); return false;"
action="#{controller.open(rec, false)}" />
Setup the modal dialog:
<rich:modalPanel id="mp" minHeight="300" minWidth="450">
<f:facet name="header">
<h:outputText value="Enter Signature Date" />
</f:facet>
<table>
<tr>
<td>Enter Signature Date:</td>
<td>
<rich:calendar disabled="#{readOnly}"
enableManualInput="false" converterMessage="'Signature Date' must be a date."
datePattern="MM/dd/yyyy"
value="#{searchController.enteredSignatureDate}"
ajaxSingle="false" showWeekDaysBar="false" showWeeksBar="false"
requiredMessage="Please provide the Signature Date."/>
<input type="button" onclick="#{rich:component('mp')}.hide()" value="Enter" />
</td>
</tr>
</table>
</rich:modalPanel>
But now I do not know how to capture the date entered.