【发布时间】:2014-05-15 15:14:25
【问题描述】:
我使用的对话框框架:
http://www.primefaces.org/showcase-labs/ui/dialogFrameworkData.jsf
我创建一个文件 view_test.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui" >
<h:head>
<title>Dialogo Prueba</title>
</h:head>
<h:body>
<h:form id="idFormTest">
<h:panelGrid id="idPgAdressStore" columns="2" columnClasses="col1,col2">
<h:outputLabel for="idAdress" value="Adress: " />
<p:inputText id="idAdress" label="Adresss" size="40" value="#{storeBean.au.strAdress}"/>
<f:facet name="footer">
<h:panelGrid width="100%" columns="2" style="text-align:center">
<p:commandButton id="idBtSaveDir" value="Save" actionListener="#{storeBean.saveAdress}" />
<p:commandButton id="idBtCancelDir" actionListener="#{storeBean.closeAdress}" value="Cancel"/>
</h:panelGrid>
</f:facet>
</h:panelGrid>
</h:form>
</h:body>
此对话框打开其他表单“idFormStore”,当我单击命令按钮“idBtSaveDir”时,将调用方法 saveAdress 并将 idAdress 中的值复制到 idFormStore 中的其他输入文本中
public void saveAdress(ActionEvent event) {
au.setAdressStore(au.getStrAdress());
RequestContext.getCurrentInstance().update("idFormStore");
RequestContext.getCurrentInstance().closeDialog("/pages/logistica/store/view_test");
}
我正在更新表单 idFormStore,但它没有更新 RequestContext.getCurrentInstance().update("idFormStore") 不起作用,
我还将 panelgrid 放在 inputext 的位置并且不更新, RequestContext.getCurrentInstance().update("idFormStore:idPanelStore")
但是我重新加载了所有页面,我输入的值出现了,那么我必须在 RequestContext.getCurrentInstance().update 中放入什么?
【问题讨论】:
标签: jsf-2 primefaces