p:dialog 在 commandButton oncomplete 之后没有出现

p:dialog not appearing after commandButton oncomplete

我遇到了一个奇怪的问题,我找不到原因。 我有一个 dataGrid,我在其中放置了一个 commandButton。

<p:dataGrid paginator="true"
    value="#{bean.searchedSystem}" var="searchedSystemObj"  
    columns="1" rows="6"
    WidgetVar="CadModel" pageLinks="5" filteredValue="" >

<p:commandButton value="More Details..."
    action="#{bean.viewMoreDetails(searchedSystemObj)}"
    oncompleted="PF('testDialog').show()"/> 

在执行操作时会调用 bean,但似乎不会调用 oncomplete。

<p:dialog header="Modal Dialog" widgetVar="testDialog"
    modal="true" height="600" width="900">

所有这些都在一个表格中。 知道为什么吗?

已解决: 我已经解决了这个问题。谢谢你们帮助我。 问题是由于 "processing image..."(比如处理内容时请稍候)。每个操作都没有正确处理。所以我修复了它,然后对话框开始出现。

我的第一个想法是属性是 oncomplete 而不是 oncompleted

此外,您必须处理 lowercase/uppercase 问题,因为 JSF 是 XML,区分大小写。我在你的代码中看到 WidgetVar 但正确的属性是 widgetVar.


All these are in a single form.

然后我的第二个想法是在 <p:dialog> 中放置一个 <h:form> 并确保您不嵌套表格。

请参阅 了解有理数。