我想要一个dialog
在我点击commandButton
后出现,但它根本没有显示出来。 我认为按钮提交表单而不是显示对话框。还有什么我试图做一个'Cancel' commandButton
,它也没有运行,因为它应该 - 它的工作原理只有当我点击它第一(如果我点击commandButton
这是suppoused首先打开dialog
,取消按钮将不再工作了)。Primefaces对话框不显示
这里是我的.xhtml:
<ui:define name="content">
<p:dialog id="dlg" header="#{messages.chooseSkillLevel}" widgetVar="dlg" modal="true" dynamic="true">
<h:form>
<h:dataTable value="#{editSkills.skillsAndLevels}" var="skillslevel">
<h:column>
#{skillslevel.skill.umiejetnosc}
</h:column>
<h:column>
<p:selectOneMenu value="#{skillslevel.level}" >
<f:selectItems value="#{editSkills.levels}" var="level" itemLabel="#{level.stopien}" itemValue="#{level.id}" />
</p:selectOneMenu>
</h:column>
</h:dataTable>
<p:commandButton value="#{messages.confirm}" action="#{editSkills.showSkillsAndLevels}" oncomplete="dlg.hide();" />
<p:commandButton value="#{messages.cancel}" onclick="dlg.hide()"/>
</h:form>
</p:dialog>
<h:form>
<p:messages/>
<p:pickList value="#{editSkills.skills}" var="skill" effect="none" converter="#{picklistConverter}"
itemValue="#{skill.id}" itemLabel="#{skill.umiejetnosc}"
showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains"
addLabel="#{messages.add}" removeLabel="#{messages.remove}" removeAllLabel="#{messages.removeAll}" >
<f:facet name="sourceCaption">#{messages.skillsList}</f:facet>
<f:facet name="targetCaption">#{messages.yourSkills}</f:facet>
<p:ajax event="transfer" listener="#{editSkills.onTransfer}" />
<p:column style="width:100%;">
#{skill.umiejetnosc}
</p:column>
</p:pickList>
<p:commandButton value="#{messages.confirm}" actionListener="#{editSkills.afterSubmit}" update=":dlg" oncomplete="dlg.show();" /> THIS IS THE MENTIONED BUTTON
<p:commandButton value="#{messages.cancel}" action="profile" immediate="true"/> THIS IS THE CANCEL BUTTON
</h:form>
</ui:define>
我应该怎么做才能让它运作良好?
你为什么[重新发布](http://stackoverflow.com/q/14381602/1317692)? – Fallup
@Fallup,不是转贴。这两个问题都有不同的问题 – kolossus
@kolossus他们没有什么不同,他们几乎相连。第一种解决方案导致了这个问题,即它破坏了工作。顺便说一句,我不知道如何操作系统可以告诉有关对话内的按钮的第一个解决方案工作正常,他现在根本无法打开对话。如果他不能确认它正在工作,他不应该接受它。 – Fallup