这是一个 JSF 1.1 表单
<h:form>
<h1>STEP 1 - Choose your channels</h1>
<h:selectManyCheckbox value="#{globalTVRegistration.selectedChannels}" layout="pageDirection">
<f:selectItems value="#{globalTVRegistration.availableChannels}" />
</h:selectManyCheckbox>
<h:commandButton value="Select Channels" action="packages" />
</h:form>
及其对应的backing bean
public class GlobalTVRegistration {
private int[] selectedChannels;
public int[] getSelectedChannels() {
return selectedChannels;
}
public void setSelectedChannels(int[] selectedItems) {
this.selectedChannels = selectedItems;
}
}
当我选择一个或多个复选框并单击命令按钮时,再次刷新同一页面。表单提交不调用setSelectedChannels(int[] selectedItems)。
你能找出问题所在吗?