-1
我在搜索結果頁面上有一個編輯按鈕,每按一次該按鈕都會提示用戶在繼續進入下一頁之前輸入日期。如何捕獲在rich:modalpanel中輸入的輸入?
按鈕不具備模態特性:
<h:commandButton action="#{controller.open(rec, false)}" />
不知怎的,我想打開頁面以獲取從模型對話框中輸入的日期,並把它傳遞給open方法之前引入一個模式diaglog,像這樣:
<h:commandButton onClick="openAModelDialog()"
action="#{controller.open(rec, false, enteredDate)}" />
我有SEAM 2.2,JSF和Richfaces可用給我。不知道如何最好地滿足這種需求。
我到目前爲止完成的工作: 更改了按鈕以打開模式對話框。
<a4j:commandButton onclick="#{rich:component('mp')}.show(); return false;"
action="#{controller.open(rec, false)}" />
設置模式對話框:
<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>
但現在我不知道如何捕捉輸入的日期。
試一試會讓你知道。謝謝。 –
我想我已經掛了,試圖讓enterDate方法的一個參數,並無法弄清楚如何獲取日期以包含在打開的調用中。但是你是對的,模態對話框現在具有action屬性,它正在工作,我只是使enteredDate成爲控制器的一個屬性。 –