提交表单之前调用f:verbatim中的吸气剂 [英] Getters inside f:verbatim called before form submission
问题描述
我有以下页面:
<h:form id="gameSelectionForm">
<h:selectOneMenu id="gameSelection">
<f:selectItems value="#{gameBean.gameIds}" />
</h:selectOneMenu>
<h:commandButton id="gameSelector" value="Play" action="#{gameBean.changeGame}" />
</h:form>
<h:panelGroup id="gameDiv">
<f:verbatim>
<iframe src="/levelup/resources/games/#{gameBean.gameId}/#{gameBean.htmlPage}" width="700px" height="800px" frameborder="0"/>
</f:verbatim>
</h:panelGroup>
当我单击"gameSelector"按钮时,这是事件的顺序: 1. gameBean.getGameId和gameBean.getHtmlPage被调用 2. gameBean.changeGame被调用 3.页面刷新.
When I click on the "gameSelector" button, here is the sequence of events: 1. gameBean.getGameId and gameBean.getHtmlPage are called 2. gameBean.changeGame is called 3. The page is refreshed.
我的问题按1和2的顺序排列.changeGame修改了getGameId和getHtmlPage使用的gameBean变量.因此,我希望它首先执行,以便刷新其他面板时,它们包含正确的数据.
My issues lies in the order of 1. and 2. The changeGame modifies a gameBean variable that is used by the getGameId and getHtmlPage. I thus want to it execute first, so that when other panels are refreshed, they contain the proper data.
请注意,此问题似乎仅发生在gameDiv元素内的调用中(其他变量已正确刷新).
Please note that this issue seems to occur only for the call within the gameDiv element (other variables are properly refreshed).
您对我可以做些什么来恢复1.和2.的顺序有任何想法,以便changeGame()方法是第一个被调用的方法?
Would you have any idea as to what I could do to revert the order of 1. and 2., so that the changeGame() method is the first one called?
我正在Tomcat 7.0上使用JavaServer Faces 2.0.
I am using JavaServer Faces 2.0 on Tomcat 7.0.
预先感谢