2014-12-24 28 views
0

业务逻辑完成后,我想从backing bean更新<p:inputText>。 我有两个属性支持bean prop1prop2,以及相应的UI组件<p:inputText>。但是,当我更新这两个UI组件时,它们不会更新业务逻辑的最新值。我试图用p:ajax和RequestContext更新,但两者都不起作用。如何从支持bean更新p:inputText?

<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

+0

你如何解雇你的行为? – Scorpion

+0

这就是我如何调用按钮,点击后台bean \t \t \t \t \t \t \t \t \t \t \t \t \t效果 – Brijesh

+1

你尝试删除'immediate'?并删除''? – Scorpion

回答

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