在回发期间,我很难将复选框的值绑定到嵌套在列表中的对象。列表中的 webflow 和嵌套对象是否存在问题?
jsp
<div style="margin-left: 15px; margin-bottom: 8px;">
<form:checkbox id="firmUserBeingEditedPermissionList[${status.index}].cascading" path="firmUserBeingEditedPermissionList[${status.index}].cascading"
onclick="toggleCascading(${status.index}, this, event);"/><spring:message code="setFirmPermissions.cascading" />
</div>
流.xml
<input name="userName" required="true"/>
<on-start>
<evaluate expression="firmUserPermissionDetailViewBuilder.createFirmUserPermissionDetailView(userName)" result="flowScope.firmUserPermissionView" />
</on-start>
<view-state id="setFirmPermissions" view="admin/setFirmPermissions3" model="firmUserPermissionView">
<binder>
<binding property="firmUserBeingEditedPermissionList" required="true"/>
</binder>
<transition on="submitAddFirm" to="setFirms">
</transition>
<transition on="submitPermissions" to="viewAndConfirm"/>
<transition on="cancelSetFirmPermissions" to="cancelChange"/>
</view-state>
公司用户权限视图
公共类 FirmUserPermissionView 实现可序列化 {
private static final long serialVersionUID = -7219027256643534729L;
public static final String KEY = "firmUserPermissionView";
private AbstractUser currentAdminUser;
private AbstractUser firmUser;
private List<UserPermissionFirmDetail> firmUsersCurrentUserPermissionDetailList;
private List<UserPermissionFirmDetailFBO> firmUserBeingEditedPermissionList;
private Map<String, Collection<FirmSession>> firmCdAndExchangeSessionMap;
private Map<String, Collection<Firm>> firmCdAndExchangeSubFirmMap;
private Map<String, Collection<String>> firmCdAndExchangeExcludedSubFirmMap;
private Collection<String> exchangeSymbolsAvailableToLoggedInUser;
private List<PresentableFirmPermission> unSelectedFirmPresentablePermissions;
private List<PresentableFirmPermission> selectedFirmPresentablePermissions;
public List<UserPermissionFirmDetail> getFirmUsersCurrentUserPermissionDetailList() {
return firmUsersCurrentUserPermissionDetailList;
}
public void setFirmUsersCurrentUserPermissionDetailList(
List<UserPermissionFirmDetail> firmUsersCurrentUserPermissionDetailList) {
this.firmUsersCurrentUserPermissionDetailList = firmUsersCurrentUserPermissionDetailList;
}
小服务程序
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
<flow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>
<!-- This creates an XmlFlowRegistryFactory bean -->
<flow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<flow:flow-location path="/WEB-INF/flows/setFirmPermissions.xml"/>
</flow:flow-registry>
<flow:flow-builder-services id="flowBuilderServices" view-factory-creator="viewFactoryCreator" development="true"/>
<bean id="viewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
<property name="useSpringBeanBinding" value="true"/>
<property name="viewResolvers">
<list>
<ref bean="viewResolver"/>
</list>
</property>
UserPermissionFirmDetailFBO 扩展了 UserPermissionFirm
public class UserPermissionFirm extends AbstractUserPermission {
private static final long serialVersionUID = 1L;
private Long firmId;
private String brokerCd;
private String accountCd;
private boolean cascading;
private boolean supervisor;
private boolean authorisedForSessionCancel;
//used to store supervisor own entering Trader Id
private String enteringTraderId;
private boolean inherited = false;
//Permissions are 'disabled' if they have no sessions
private boolean pseudoDisabledForNoSessions;
private Long exchangeId;
/**
* @return the cascading
*/
public boolean isCascading() {
return cascading;
}
/**
* @param cascading
* the cascading to set
*/
public void setCascading(boolean cascading) {
this.cascading = cascading;
}