在我的应用程序中,我在值列表框中更改值时调用值更改侦听器。 值更改侦听器应更新四个字段的值 - 2个输入文本字段和2个组合框(下拉框)。 bean范围是请求。我正在使用JSF 1.2版本。
jsp文件:
<h:selectManyListbox id="FSIBUCKET" required="true"
rendered="#{mangAreaSignOff.renderSelectedFSIBUCKET}"
valueChangeListener="#{mangAreaSignOff.handleFSIBucketValueChange}"
onchange="submit(); javascript:waiton();" style="width:230px"value="#{mangAreaSignOff.selectedFsiBucket}" >
<f:selectItems value="#{mangAreaSignOff.fsiBucketList}" />
</h:selectManyListbox>
java代码:
public void handleFSIBucketValueChange(ValueChangeEvent vce)
{
Object[] selectedFSIBucket = (Object[]) vce.getNewValue();
setSelectedFsiBucket(selectedFSIBucket);
getFSIBucketValueChangeResults();
}
public void getFSIBucketValueChangeResults()
{
Object [] tempFSIBucket = getSelectedFsiBucket() ;
String FSIBucket = getArrayToString(tempFSIBucket, ";");
List<String> result = mangAreaAPI.getFSIBucketValueChanges(FSIBucket);
mangAreaVO.setSelectedThresholdcategory(result.get(0));
mangAreaVO.setSelectedThresholdAmount(result.get(1));
mangAreaVO.setSelectedThresholdType(result.get(2));
mangAreaVO.setSelectedThresholdPercent(result.get(3));
}
我需要帮助来确定流程出错的地方。 更改列表框值时,不会更新4个字段。在java类中,我能够看到更新的值。但在屏幕上它没有更新。如果我的问题需要更多解释,请告诉我。
<h:panelGrid columns="10">
.
some other fields
.
.
<!-- Threshold Category -->
<h:panelGroup styleClass="text2"
rendered="#{mangAreaSignOff.renderInputThresholdCategory}">
<h:outputText value="MGT_LABEL_THRESHOLDCATEGORY" escape="false"
converter="com.db.smis.planus.TermConverter" styleClass="text2" />
<f:verbatim>:</f:verbatim>
</h:panelGroup>
<h:panelGroup
rendered="#{!mangAreaSignOff.renderInputThresholdCategory}">
<h:outputText value=" " escape="false" />
</h:panelGroup>
<!-- Threshold Amount -->
<h:panelGroup styleClass="text2"
rendered="#{mangAreaSignOff.renderInputAmount}">
<h:outputText value="MGT_LABEL_THRESHOLD" escape="false"
converter="com.db.smis.planus.TermConverter" styleClass="text2" />
<f:verbatim>:</f:verbatim>
</h:panelGroup>
<h:panelGroup rendered="#{!mangAreaSignOff.renderInputAmount}">
<h:outputText value=" " escape="false" />
</h:panelGroup>
<!-- Threshold Type -->
<h:panelGroup styleClass="text2"
rendered="#{mangAreaSignOff.renderThresholdType}">
<h:outputText value="MGT_LABEL_THRESHOLDTYPE" escape="false"
converter="com.db.smis.planus.TermConverter" styleClass="text2" />
<f:verbatim>:</f:verbatim>
</h:panelGroup>
<h:panelGroup rendered="#{!mangAreaSignOff.renderThresholdType}">
<h:outputText value=" " escape="false" />
</h:panelGroup>
<!-- Threshold Percentage -->
<h:panelGroup styleClass="text2"
rendered="#{mangAreaSignOff.renderThresholdPercent}">
<h:outputText value="MGT_LABEL_THRESHOLDPERCENT" escape="false"
converter="com.db.smis.planus.TermConverter" styleClass="text2" />
<f:verbatim>:</f:verbatim>
</h:panelGroup>
<h:panelGroup
rendered="#{!mangAreaSignOff.renderThresholdPercent}">
<h:outputText value=" " escape="false" />
</h:panelGroup>
.
.
.
.
</h:panelGrid>
我只需更新上述4个字段。