我有一個菜單打開一個對話框(primefaces 3.5)Primefaces對話框只工作一次
<h:form>
<p:graphicImage id="img" value="../resources/img/user.jpg" style="cursor:pointer" title="My Profile" height="70px"/>
<p:overlayPanel id="imgPanel" for="img" showEffect="blind" hideEffect="fade" showEvent="mouseover" hideEvent="fade">
<h:outputLink id="editLink" value="javascript:void(0)" onclick="profiledlg.show()" title="login">Edit profile</h:outputLink><br />
<h:outputLink id="loginLink" value="javascript:void(0)" onclick="passwddlg.show()" title="login">Change password</h:outputLink><br />
<p:commandLink action="#{authBackingBean.logout}" value="Logout" />
</p:overlayPanel>
</h:form>
對話是這樣的:
<h:form id="profiledialogform">
<p:dialog id="profiledialog" header="Edit profile" widgetVar="profiledlg" resizable="false">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="email" value="Email:" />
<p:inputText value="#{editProfileBean.newEmail}"
id="email" required="true" label="email" />
<f:facet name="footer">
<p:commandButton id="editProfileButton" value="Edit profile"
actionListener="#{editProfileBean.editProfile}" oncomplete="profiledlg.hide()" update=":profiledialogform" >
<p:resetInput target=":profiledialogform" />
</p:commandButton>
</f:facet>
</h:panelGrid>
</p:dialog>
</h:form>
我第一次使用它,它按預期工作,但第二個(或更多)時間我輸入另一封電子郵件,然後單擊對話框關閉的按鈕,但只有在手動頁面刷新(F5)時才調用該方法。
的bean被@RequestScoped
我設定在editProfile方法結束時的值NEWEMAIL爲「」(空字符串)。
有什麼?
返回2版本是一個非常糟糕的解決方案 – Kukeltje