質問

I'm trying to create check box list which appears in select tag. I've searched many article, I didn't get the proper output for that. Please help me out to solve this issue.

 <s:checkboxlist list = "%{cityList}" 
                 name = "cityNo" 
                   id = "cityNo" 
             cssClass = "margin-right margin-top required-field" 
             cssStyle = "width: 114px;height:30px"
            headerKey = "0" 
          headerValue = "City"   
              listKey = "id" 
            listValue = "cityName" 
              onfocus = "getcitywithCountry(false);" />  
役に立ちましたか?

解決

You don't need s:checkboxlist to implement the functionality that you need.

Download the following

http://github.com/ehynds/jquery-ui-multiselect-widget/raw/1.13/src/jquery.multiselect.min.js
http://github.com/ehynds/jquery-ui-multiselect-widget/raw/1.13/jquery.multiselect.css

and add them to your jsp. Then use a s:select element with multiple attribute set to true

<s:select id='your_id' multiple="true" name='your_name' key='key_from_properties_file' theme="xhtml" list='your_list' listKey='your_id' listValue='your_value' />
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top