如何捕获在 rich:modalpanel 中输入的输入?
我在搜索结果页面上有一个编辑按钮,每当按下该按钮时,都会提示用户输入日期,然后再继续进入下一页。
没有模态功能的按钮:
<h:commandButton action="#{controller.open(rec, false)}" />
不知何故,我想在打开页面之前引入一个模态对话框,以从模型对话框中获取输入的日期并将其传递给打开方法,例如:
<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>
但现在我不知道如何捕获输入的日期。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能将第一个操作移到模式面板中吗? 不必在模态面板中使用:
因此,您
它必须位于表单内才能工作。打开模式面板的第一个按钮只能用于显示面板,而不调用任何操作。如果模式窗体与第一个按钮不在同一窗体内,那么您可以在显示模式面板时在第一个窗体中设置属性,也许可以使用 f:setPropertyActionListener?
Could you not move your first action into your modal panel? So instead of having in your modal panel:
you have something like:
It will have to be inside a form to work. The first button to open the modal panel could just be used to show the panel and not have any action called. If the modal form is not inside the same form as the first button then you could set your properties in first form on showing the modal panel maybe by using the f:setPropertyActionListener?