验证手风琴面板内的对话框会影响手风琴面板的功能
问题描述:
我在手风琴里面有一个带有命令按钮的对话框。如果我点击命令按钮,对话框打开,里面是一个输入文本组件。我做了一个验证说,名字不应该是空的。验证手风琴面板内的对话框会影响手风琴面板的功能
我面临的问题是,即使我没有在命令按钮上显示输入文本的验证消息,并说它不应该是空的。这每次都会出现,应用程序挂起。我尝试过设置动态=“假”,但这并没有工作。
我使用主要面向3.5和JSF2
<p:accordionPanel dynamic="true" id="editSeAccordion" >
<p:tab id="Edit3" title="myEdit">
<p:dialog widgetVar="addSAPDialog" id="sapDialog" modal="true" minimizable="false"
style="position:fixed;" closable="true" position="350,250" maximizable="false" >
<p:panel style="border:none;background:#F0F0F0;margin-top:-10px;">
<h:panelGrid columns="2">
<h:outputText value="msg.EditService_s}" styleClass="label" />
<p:inputText label="name" styleClass="textfield"
value="#{serviceManagedBean.sapBean.name}" required="true"
requiredMessage="name is compulsary"/>
</h:panelGrid>
<p:commandButton value="Cancel" styleClass="btn-secondary"
style="float:right;margin-top:20px;" onclick="addSAPDialog.hide();"/>
<p:commandButton value="Ok" styleClass="btn-primary" ajax="true"
actionListener="#{serviceManagedBean.createAddSapPanel}"
oncomplete="handleDialogSubmit(xhr, status, args)"/>
</p:panel>
</p:dialog>
答
尝试使用不同的H:表单元素在对话框内输入。因为如果单击手风琴选项卡,则无论使用部分过程还是部分渲染,所需的输入都会被验证。
您应该提供打开对话框的commandButton。 – 2013-04-25 09:30:52
我已经这样做了。对话框正常打开并且验证在对话框内发生。但是当我点击手风琴面板的标签时,我遇到了问题,即使我没有单击命令按钮(在刷新页面或从其他页面导航到此页面之后),验证消息显示名称不应该为空并且页面挂起。 – shreekanth 2013-04-25 09:42:23
为什么在对话框中嵌套对话框? – 2013-04-25 09:47:53