<s:select>和<s:doubleselect>的一般使用
2013-06-12 13:15
627 查看
<s:select id="sid" name="sid" listKey="sid" listValue="term" value="semester.sid"
list="semesterList" style="margin-left:35px;width:132px;"></s:select>
<s:doubleselect name="department" list="departmentList"
listKey="deptid" listValue="deptname" doubleName="teacherid" disabled="true"
doubleList="teachersMap.get(top.deptid)" doubleListKey="tid"
doubleListValue="tname" formName="updateTacForm"
doubleValue="teacher.tid" value="teacher.department.deptid"
doubleCssStyle="width:132px; margin-top:10px; margin-left:84px" doubleDisabled="true">
</s:doubleselect>
注意,select和doubleselect中的value值表示的是option的value值。之前弄了很久,本来是想显示的select标签为term的值,因为listKey,listValue已经建立了对应关系,sid对应term,所以,如果想要显示的值的话,value直接="semester.sid",自然就可以找到semester.term
doubleSelect也是同样的道理!doubleValue=“teacher.tid”,value="teacher.department.deptid",doubleselect中写了listkey,listValue,doubleListKey,doubleListValue的对应关系了,如果想要显示对象的deptname,当然写value="teacher.department.deptid"即可,想要标签的值显示对象的teacher.tname,当然,doubleValue=“teacher.tid”即可!
list="semesterList" style="margin-left:35px;width:132px;"></s:select>
<s:doubleselect name="department" list="departmentList"
listKey="deptid" listValue="deptname" doubleName="teacherid" disabled="true"
doubleList="teachersMap.get(top.deptid)" doubleListKey="tid"
doubleListValue="tname" formName="updateTacForm"
doubleValue="teacher.tid" value="teacher.department.deptid"
doubleCssStyle="width:132px; margin-top:10px; margin-left:84px" doubleDisabled="true">
</s:doubleselect>
注意,select和doubleselect中的value值表示的是option的value值。之前弄了很久,本来是想显示的select标签为term的值,因为listKey,listValue已经建立了对应关系,sid对应term,所以,如果想要显示的值的话,value直接="semester.sid",自然就可以找到semester.term
doubleSelect也是同样的道理!doubleValue=“teacher.tid”,value="teacher.department.deptid",doubleselect中写了listkey,listValue,doubleListKey,doubleListValue的对应关系了,如果想要显示对象的deptname,当然写value="teacher.department.deptid"即可,想要标签的值显示对象的teacher.tname,当然,doubleValue=“teacher.tid”即可!
相关文章推荐
- struts2中<s:doubleselect/>标签的使用心得<>
- <html:select>的使用
- <s:doubleselect>级联下拉框 ,<s:select><s:optgroup>标签组
- struts1中使用<html:select>标签的的三种情况的传值问题
- <html:select>,<html:option>,<html:options>,<html:optionsCollection>标签使用
- <s:select ></s:select>使用
- <context:component-scan>使用说明
- 【Html】想加入一行代码吗?使用<code>标签
- 解决 spring mvc 3.0 结合 hibernate3.2 使用<tx:annotation-driven>声明式事务无法提交的问题
- android中使用TextView来显示某个网址的内容,使用<ScrollView>来生成下拉列表框
- <s:select>应用简介
- <Office Excel>使用Excel csv逗号表达式文件格式整理日志
- <拦截方法> Objective-C使用Category
- "<>"、"!="、"not in"、"exsits"和"not exists"的使用规范
- <s:iterator> 和 <s:if> 的嵌套使用
- HTML5 - 使用<video>播放视频
- thinkphp 在循环内使用<php></php>
- 使用<bean:define >取到bean:write的值,并赋值给java变量
- <Ibatis in action>中使用动态SQL的一个小细节提示(与CDATA)
- 使用<appSettings>元素定义配置参数