有一个下拉列表和一个按钮。在选择任何项目并点击按钮后,我必须在确认对话框中显示所选项目,如何实现这一点。我正在使用jsf和素面。下面是我的示例代码:
对于下拉列表:
<p:selectOneMenu
value="#{decRm.fi_templType}" styleClass="combobox"
id="temptypID" style="Width:30%" filter="true" onchange="selectedinput()">
<f:selectItem itemLabel="--#{lang.select}--" disabled="#
{decRm.disableTemplate}"
itemValue="--Select--" />
<f:selectItems value="#{decRm.templtList}"></f:selectItems>
</p:selectOneMenu>
对于对话框:
<p:commandButton value="#{lang.gen_temp}">
<p:confirm header="Confirmation!" message="#{temptypID}" ></p:confirm>
</p:commandButton>
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
<p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" onclick="generateTemplate('FI')" />
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog>
下面是前端截图。假设我从列表中选择了T1,我想在确认框中显示T1。