当前位置 > 首页 > Java

struts2中s:doubleselect标签的用法(级联菜单横向排列)

11/25/2011 6:06:00 PM来源:Java

<head>
?<style> .doubselect br{display:none} </style>
</head>

<div class="doubselect">
<span>选择体检中心所属体系:<s:doubleselect?label="请选择体检中心" ? ? ? ? ? ? ? ? ? ? ? ? ?list="medicalExaminationCenterTempList"?listKey="id" listValue="peName"
?doubleList="medicalExaminationCenterMap.get(top.id)"
?doubleName="systemClassId" doubleListKey="id"
?doubleListValue="name" theme="simple"/>
</span>
</div>


Action中的写法:
public String add() throws Exception {
// 从session获取登陆人信息
HttpServletRequest request = ServletActionContext.getRequest();
ManagerInfo managerInfo = (ManagerInfo) request.getSession().getAttribute("topEntity");
String healthCenterCodeString = managerInfo.getHealthCenterCodeList();
String charaString = managerInfo.getCharaString();?
medicalExaminationCenterList = medicalExaminationCenterManager.findAll();
for (int i = 0; i < medicalExaminationCenterList.size(); i++){
MedicalExaminationCenter medicalExaminationCenter = medicalExaminationCenterList.get(i);
if (null == healthCenterCodeString){
continue;
}
if (healthCenterCodeString.contains(medicalExaminationCenter.getHealthCenterCode())){
medicalExaminationCenterTempList.add(medicalExaminationCenter);
}
}
if (null == medicalExaminationCenterMap){
medicalExaminationCenterMap = new HashMap<Long, List<EvaluationSystemClass>>();
}
for(int j = 0; j < medicalExaminationCenterTempList.size(); j++){
List<EvaluationSystemClass> evaluationSystemClassTempList = new ArrayList<EvaluationSystemClass>();
MedicalExaminationCenter medicalExaminationCenterTemp = medicalExaminationCenterTempList.get(j);
Iterator<EvaluationSystemClass> EvaluationSystemClasses = medicalExaminationCenterTemp.getEvaluationSystemClasses().iterator();
while(EvaluationSystemClasses.hasNext()){
EvaluationSystemClass evaluationSystemClass = EvaluationSystemClasses.next();
if(charaString.contains(evaluationSystemClass.getCode()) || charaString == evaluationSystemClass.getCode()){
evaluationSystemClassTempList.add(evaluationSystemClass);
}
}
medicalExaminationCenterMap.put(medicalExaminationCenterTemp.getId(), evaluationSystemClassTempList);
? }
return super.add();
}