您的位置:程序门 -> java -> web 开发



请教jsp的combox的联动问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


请教jsp的combox的联动问题
发表于:2007-09-26 09:25:31 楼主
<td   class= "text4 "> 飯店名
<logic:present   name= "cmb_search_list_session ">
<bean:define   id= "resultlist "   name= "cmb_search_list_session "   />

<html:select   property= "hanid "   style= "width:130px; "   onchange= "ryoriselect() ">
<html:options   collection= "resultlist "   labelproperty= "hanten "   property= "hanid "> </html:options>
</html:select>
</logic:present>
</td>
在combox中定义了onchange事件,但是触发.do返回页面的时候combox默认的是第一个选项,而不是刚才选择的选项,这个问题如何解决?
发表于:2007-09-26 09:51:131楼 得分:0
<html:select   ...   value= "selectedvalue ">

selectedvalue在onchange的后台处理中设定.

goodluck
发表于:2007-09-26 09:58:412楼 得分:0
终于找到救星了。请问高手能不能说的详细一些
发表于:2007-09-26 10:28:533楼 得分:0
昏.这20分也太不容易了...

使用 <html:select> 标签的value属性来设定默认值.看struts的taglib说明.

发表于:2007-09-26 10:53:444楼 得分:0
<html:select   property= "hanid "   style= "width:130px; "   onchange= "ryoriselect() ">
<html:options   collection= "resultlist "   labelproperty= "hanten "   property= "hanid "> </html:options>
两个property一样?
发表于:2007-09-26 14:15:465楼 得分:0
两个property一样必须一样,labelproperty和property是键值对。现在在尝试,好像有点进展
发表于:2007-09-26 14:28:456楼 得分:0
昏,还没出来啊...

<html:select   property= "hanid "   style= "width:130px; "   onchange= "ryoriselect() "   value= "hanid ">
<html:options   collection= "resultlist "   labelproperty= "hanten "   property= "hanid "> </html:options>


快速检索

最新资讯
热门点击