In fact, I think the support value updating methods look like they are working fine. Probably the problem is how you are trying to display it. When the page is initially displayed, the value for goToPage is evaluated and placed in the contents of the page returned to the user's browser. When this value is set on the user side, it will not be re-synchronized with the backup bean until this part of the page is re-displayed.
I believe that the grand face of remoteCommand allows you to do this using AJAX, using update = "client side id". Of course, I'm not a first-person guy, so I put together this little test. First change your remote commands:
<p:remoteCommand name="lazyANew" actionListener="#{main.goToAboNew}" update="testOutput" /> <p:remoteCommand name="lazyAList" actionListener="#{main.goToAboList}" update="testOutput" /> <p:remoteCommand name="lazyASearch" actionListener="#{main.goToAboSearch}" update="testOutput" />
Then add a simple text box to the contents of your page with the corresponding Id:
Page target: <h:outputText value="#{main.goToPage}" id="testOutput" />
Your output text should begin to sync. While this works, you can simply redirect the update from testOutput to mainDialog, and you should be in business.
source share