struts使用单选按钮的三种方式

struts使用单选按钮的三种方式,第1张

struts中使用单选按钮有三种方式

使用<:option>标签

<:select property= city >

<:option value= >北京市</:option>

<:option value= >广州市</:option>

<:option value= >上海市</:option>

</:select>

使用<:optionsCollection>标签

)在ActionForm中加入字段

private List cityList=new ArrayList()

)加入必须的getter方法

public List getCityList() {

return cityList

}

)在reset方法内给cityList填充内容

cityList add(new LabelValueBean( 北京市 ))

cityList add(new LabelValueBean( 广州市 ))

cityList add(new LabelValueBean( 上海市 ))

)JSP标签中使用

<:select property= city >

<:optionsCollection property= cityList label= label value= value />

</:select>

使用<:options>标签

<%List cityList=new ArrayList()

cityList add(new LabelValueBean( 北京市 ))

cityList add(new LabelValueBean( 广州市 ))

cityList add(new LabelValueBean( 上海市 ))

request setAttribute( list cityList)//必须是request对象

%>

<:select property= city >

<:options collection= list labelProperty= label property= value />

lishixinzhi/Article/program/Java/ky/201311/28298

首先,增加ion-option-button,要确保在ion-item标签下,

而手册radio的两种形式都不行:

修改后会影响显示效果;

<ion-radio ng-model="choice" ng-value="A">Choose A</ion-radio>

无从下手;

*解决办法:自己写radio!!!!

ng-if控制被选择时图标的显示与否

$scope.radioShow为空对象,所以初始时,所有图标不显示;触发点击事件$scope.radioClick,把点击的赋值true,

对应的图标显示,完成选中。

方法中再次赋值‘{}’,是因为单选。

*注意:没什么注意的;

你可以用Frame控件将它们分成两组,要先添加Frame控件,然后在Frame控件上添加option,记住,要“画”出来,不要双击出来,否则option 不会属于Frame容器,就不会被分成两组,分组成功后添加到数据库中去就要看你自己了,好好看看介绍VB和数据库的书,上面介绍的很详细。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11931241.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存