【发布时间】:2014-02-07 10:38:41
【问题描述】:
下面是我的 listshuttle xhtml,它也包含转换器,我创建了转换器并读取值,但是当我尝试为特定用户分配值时,listshuttle 的“ValueActionListener”没有被调用。 请帮我解决这个问题,
下面是xhtml和java代码供大家参考
<h:form id="listShuttleForm">
<hr align="left" id="h1" style="!important; width: 250px; "/><br />
<rich:listShuttle sourceValue="#{roleAction.availableUserGroupsList}" id="assignUserGroupListShuttleId"
targetValue="#{roleAction.assignedUserGroupInfoList}" var="userGroupInfo" listsHeight="300"
sourceListWidth="190" targetListWidth="200" sourceCaptionLabel=" #{localeValue.availableUserGroups}"
targetCaptionLabel="#{localeValue.assignedUserGroups}" converter="userGroupConverter"
valueChangeListener="#{roleAction.assignedUserGroupsListener}" ajaxRendered="true">
<rich:column>
<h:outputText value="#{userGroupInfo.groupName}"></h:outputText>
</rich:column>
<a4j:support event="onlistchanged" reRender="msgId" />
<a4j:support event="onorderchanged" reRender="msgId" />
</rich:listShuttle>
</h:form>
java代码:-
public String assignedUserGroupsListener(ValueChangeEvent event){
System.out.println("inside assignedUserGroupListenerasdf");
FacesContext fc = FacesContext.getCurrentInstance();
Map<String, Object> sessionMap = fc.getExternalContext().getSessionMap();
HtmlListShuttle listShuttle = (HtmlListShuttle)event.getComponent();
sessionMap.put("assignedUserGroupInfoList", listShuttle.getTargetValue());
return null;
}
所有的建议都将是非常可观的。
提前谢谢你。
【问题讨论】: