Primefaces对话框在打开后更新
问题描述:
我想在打开内容对话框后更新内容对话框。可能吗?我的示例代码如下。Primefaces对话框在打开后更新
<p:dialog widgetVar="pictureSaveDialog" id="pictureDialog" closable="false" >
<p:outputPanel id="saveDialogPanel">
<p:selectOneRadio id="options" value="#{pictureDefinitionsView.radioValue}" >
<f:selectItem itemLabel="FILE" itemValue="FILE" />
<f:selectItem itemLabel="" itemValue="URL" />
<p:ajax update="fileUpload1 fileUpload2" event="click" process="options" />
</p:selectOneRadio>
<p:outputPanel id="fileUpload1" rendered="#{pictureDefinitionsView.selectedFileUpload}"> File </p:outputPanel>
<p:outputPanel id="fileUpload2" rendered="#{pictureDefinitionsView.selectedUrlUpload}"> URL </p:outputPanel>
</p:outputPanel id="saveDialogPanel">
bean的方法。
public boolean isSelectedFileUpload(){
return radioValue.equals("FILE");
}
public boolean isSelectedUrlUpload(){
return !isSelectedFileUpload();
}
答
可以在onShow
属性定义p:remoteCommand
刚刚更新对话框,然后调用命令:
<p:remoteCommand name="updateDialog" update="saveDialogPanel"/>
<p:dialog widgetVar="pictureSaveDialog" id="pictureDialog" closable="false" onShow="updateDialog()">
如果您saveDialogPanel
是一些命名容器是岸添加适当的前缀匹配组件的ID 。
答
您更好地刷新它是开放
你的第106页的对话内容:的commandButton/P:阿贾克斯应具备以下条件:
update="pictureDialog" onsuccess="pictureSaveDialog.show()"
请提供像程序员一些更多的解释,不喜欢的用户。这意味着什么没有奏效。请参阅JavaScript控制台,请参阅Java控制台,请参阅生成的HTML。 – partlov 2013-03-06 11:35:27
对不起。我希望在打开对话框之后,在ID为fileUpload1的输出面板将隐藏并且其他输出面板将显示之后,我选择其他无线电选项。当我选择其他无线电选项时,id为fileUpload2的输出面板将显示并且fileUpload1将关闭。我希望,尽管我有英语,但你会明白。 – Zapateus 2013-03-06 14:19:46