开发者

How to preselect struts html:radio button

开发者 https://www.devze.com 2023-03-23 19:38 出处:网络
How to preselect stru开发者_运维技巧ts 1 html:radio button? Thanks MariaYou should have a value in your Form object that holds the data for your radio button. You\'ll need to pre-fill that in your F

How to preselect stru开发者_运维技巧ts 1 html:radio button?

Thanks Maria


You should have a value in your Form object that holds the data for your radio button. You'll need to pre-fill that in your Form before forwarding to the JSP (or default it in the Form's constructor if it will always default to that value).

Action.java

form.setRadioValue("123");

View.jsp

<html:radio property="radioValue" value="123" />  // <-- this radio will be checked
<html:radio property="radioValue" value="456" />  // <-- this radio will not be checked
0

精彩评论

暂无评论...
验证码 换一张
取 消