【发布时间】:2016-05-13 02:42:57
【问题描述】:
我有一个场景,我有一个 SelectOneMenu
<h:selectOneMenu value="#{bean.names}" valueChangeListener="#{bean.templChangeListner}" required="true" requiredMessage="Please select an Equipment type">
<f:selectItem itemLabel="-------Select Names------"
itemValue="${null}" noSelectionOption="true" />
<f:selectItems value="#{bean.fetchnames()}" var="spec"
itemLabel="#{spec.specName}" itemValue="#{spec.specificationId}" />
<a4j:ajax event="valueChange" render="outputPanel"
immediate="true" execute="@this"/>
</h:selectOneMenu>
在valueChange 上我必须render 有一个面板
<a4j:outputPanel id="outputPanel">
<c:forEach items="#{ban.genericFeaturesList}"
var="genFeatVar" varStatus="genericIndex">
...............
...............
...............
<!--Lots of logic to render component -->
</c:forEach>
我的问题是当valueChange 会发生并且outputPanel 会再次呈现时
-
genericFeaturesList将包含新的更新数据? - 要重新构建组件树?
正如我在valueChangeListener 方法中添加重定向时看到的那样,当我在 UI 中删除重定向值时,事情在 UI 中正常工作,当我在 UI 中删除重定向值时无法正确呈现。
FacesContext.getCurrentInstance().getExternalContext().redirect("PageName")
【问题讨论】: