在下面的代码中我尝试获取对话框但未显示, 在这里我使用了JSF Facelets。
这里我分享了我在页面中写的完整代码
<h:body>
<ui:composition template="../template/CommonLayout.xhtml">
<ui:define name="rightcontent">
<div id="c1">
<h:form>
<div id="password">
<p:commandButton value="reset" onclick="PF('dlg').show();"
title="Reset password" immediate="true">
</p:commandButton>
<p:dialog id="dialog" header="Reset password" widgetVar="dlg"
width="500px" resizable="true">
<h:panelGrid id="resetPanel" columns="2" cellpadding="5">
<h:outputText value="newpassword" />
<h:inputSecret id="newpassword"
value="#{custEditBean.newPassword}" required="true"></h:inputSecret>
<h:outputText value="Confirm password" />
<h:inputSecret id="confirm" value="#{custEditBean.password}"
required="true"></h:inputSecret>
<p:commandButton value="RESET"
actionListener="#custEditBean.changePassword()}" />
</h:panelGrid>
</p:dialog>
</div>
</h:form>
</div>
</ui:define>
</ui:composition>
</h:body>
</html>
在这里我使用了JSF Facelets模板。
答案 0 :(得分:0)
h:inputSecret
和p:commandButton
有拼写错误,其value
和actionListener
缺少第一个{
字符。我的意思是:
value="#custEditBean.password}"
代替
value="#{custEditBean.password}"
按钮也一样。也许这个错误不会呈现你的对话。