`
conkeyn
  • 浏览: 1504688 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

checkboxlist

阅读更多

ddd

 public class LoginAction extends BaseAction {  
   
	private Map<Integer, String> interestOptions = new HashMap<Integer, String>();
   
     public String method1() throws Exception {
		interestOptions.put(1, "AutoMotive");
		interestOptions.put(2, "Games");
		interestOptions.put(3, "Sports");
         return SUCCESS;  
     }  
   
	public Map<Integer, String> getInterestOptions() {
		return interestOptions;
	}

	public void setInterestOptions(Map<Integer, String> interestOptions) {
		this.interestOptions = interestOptions;
	}
 }  

 HTML代码片段:

<s:checkboxlist name="interest" label="Interests" list="interestOptions"/>

 生成的HTML代码:

<tr>
    <td class="tdLabel">
		label for="fdfd_interest" class="label">Interests:</label>
	</td>
    <td>
		<input type="checkbox" name="interest" value="1" id="interest-1"/>
		<label for="interest-1" class="checkboxLabel">AutoMotive</label>
		<input type="checkbox" name="interest" value="2" id="interest-2"/>

		<label for="interest-2" class="checkboxLabel">Games</label>
		<input type="checkbox" name="interest" value="3" id="interest-3"/>
		<label for="interest-3" class="checkboxLabel">Sports</label>
		<input type="hidden" id="__multiselect_fdfd_interest" name="__multiselect_interest" value="" />
	</td>
</tr>

 林

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics