单击按钮时如何显示带有输入框和按钮的弹出对话框。这是我的实施......
<h:form name="calcDistanceform" widgetVar="selectedRowValuesDlg" style="margin:5px;" >
<h:inputText name="sourceDistance" value="#{searchController.sourceDistance}" />
<h:commandButton value="Caliculate" class="popdistance" id="popdistancecalc" style="background-color:red;font-size:10px;font-weight:600">
<p:ajax process="@this" update="" listener="#{searchController.calculateDistance}" />
</h:commandButton>
</h:form>
<p:commandLink value="Get Distance" actionListener="#{searchController.onDistanceClick}" oncomplete="PF('selectedRowValuesDlg').show();" process="@this">
<f:attribute name="clinic" value="#{clinic}"/>
</p:commandLink>
答案 0 :(得分:0)
使用p:dialog
组件http://www.primefaces.org/showcase/ui/overlay/dialog/basic.xhtml
<p:dialog header="My Dialog" widgetVar="selectedRowValuesDlg">
<h:form name="calcDistanceform" style="margin:5px;" >
<h:inputText name="sourceDistance" value="#{searchController.sourceDistance}" />
<h:commandButton value="Caliculate" class="popdistance" id="popdistancecalc" style="background-color:red;font-size:10px;font-weight:600" action="#{searchController.calculateDistance}" update="@form" />
</h:form>
</p:dialog>
<p:commandLink value="Get Distance" actionListener="#{searchController.onDistanceClick}" oncomplete="PF('selectedRowValuesDlg').show()" process="@this">
<f:attribute name="clinic" value="#{clinic}"/>
</p:commandLink>