【发布时间】:2011-11-02 05:40:21
【问题描述】:
我有一个 jsf 1.2 命令链接
<h:commandLink id="cars" action="${swapViewHandler.myFunction1}">
<h:commandLink id="ships" action="${swapViewHandler.myFunction2}">
myFunction1 用汽车填充 swapViewHandler.listA 并导航到 cars.xhtml
<navigation-rule>
<navigation-case>
<from-outcome>cars</from-outcome>
<to-view-id>cars.xhtml</to-view-id>
<redirect />
</navigation-case>
myFunction2 使用船舶和 导航到 ship.xhtml
<navigation-rule>
<navigation-case>
<from-outcome>ships</from-outcome>
<to-view-id>hips.xhtml</to-view-id>
<redirect />
</navigation-case>
我需要处理用户刷新 (F5) 以便在发生刷新时 cars.xhtml myFunction1 被调用并重新填充 listA (使用 cars ) 并且当 ship.xhtml 被刷新时,myFunction2 被调用并重新填充 listA(带有船舶)
cars.xhtml 和 ship.xhtml 具有相同的 backingbean (swapviewhandler)
它们都包含
<c:forEach id="tablePicList" items="${swapViewHandler.listA}" var="entity" varStatus ="status">
【问题讨论】: