如何从支持bean更新p:inputText?

时间:2014-12-24 07:54:18

标签: jsf primefaces

我希望在业务逻辑完成后从支持bean更新<p:inputText>。 我在支持bean prop1prop2中有两个属性,相应的UI组件为<p:inputText>。但是,当我更新两个ui组件时,它们不会使用业务逻辑的最新值进行更新。我尝试使用p:ajax和RequestContext进行更新,但两者都无效。

<p:inputText id="htmlDivs"
             style="display:inline"
             ajax="true"
             value="#{backingbean.deviceHtml}"/>

<p:inputText id="paths"
             style="display:inline"
             ajax="true"
             value="#{backingbean.connections}"/>

RequestContext.getCurrentInstance().update(Arrays.asList("myform:htmlDivs",
                                                  "myform:paths",
                                                  "myform:devicePortTable"));

奇怪的是devicePortTableis已更新。有什么建议吗?

由于 Brijesh

1 个答案:

答案 0 :(得分:1)

尝试删除immediate="true"并删除<p:ajax>,因为您的<p:commandButton>

中已有更新属性,因此无效
 <p:commandButton id="reloadSVGBtn"
                  styleClass="pbutton"
                  value="Hidden"
                  actionListener="#{myform.reloadSVG}"
                  update=":topologyViewForm:htmlDivs :topologyViewForm:paths">  
</p:commandButton>

有关详细信息,请阅读this

相关问题