Advertisement

04.16.2008 at 02:37AM PDT, ID: 23326417
[x]
Attachment Details

Is it possible to format the Struts 2 tag <s:checkboxlist> into a columned HTML table instead of a wraparound list

Asked by storerp in Jakarta Struts, Cascading Style Sheets (CSS), Java Server Pages (JSP)

Tags: ,

We are currently using Struts 2 to develop a Java application. We have used a Struts 2 tag <s:checkboxlist>

The problem is when we have a big list of items it just lists them and wraps around looking messy. We need a way to be able to format the display into columns. But would like to continue using the <s:checkboxlist>  tag if possible.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
The java code is :
<table border="0" cellspacing="1" width="100%" cellpadding="0"	class="contextRow">
    <s:checkboxlist cssClass="contextFieldData" name="delValueList" list="descList" listKey="tag_value_id" listValue="valueName" />
</table>
 
The rendered HTML code is:
 
<table border="0" cellspacing="1" width="100%" cellpadding="0" class="contextRow">
<tr>
    <td class="tdLabel"></td>
    <td>
       <input type="checkbox" name="delValueList" value="1311" id="delValueList-1"/>
      <label for="delValueList-1" class="checkboxLabel">16AP</label>
      <input type="checkbox" name="delValueList" value="294" id="delValueList-2"/>
      <label for="delValueList-2" class="checkboxLabel">ADRR</label>
      <input type="checkbox" name="delValueList" value="1312" id="delValueList-3"/>
      <label for="delValueList-3" class="checkboxLabel">AP16</label>
      <input type="checkbox" name="delValueList" value="296" id="delValueList-4"/>
      <label for="delValueList-4" class="checkboxLabel">BAT</label>
      <input type="checkbox" name="delValueList" value="295" id="delValueList-5"/>
      <label for="delValueList-5" class="checkboxLabel">CARP</label>
      <input type="checkbox" name="delValueList" value="248" id="delValueList-6"/>
      <label for="delValueList-6" class="checkboxLabel">EXER</label>
    </td>
</tr>
</table>
Attachments:
 
screen image
screen image
 
 
Loading Advertisement...
 
[+][-]04.16.2008 at 06:59AM PDT, ID: 21367797

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.16.2008 at 07:03AM PDT, ID: 21367831

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Jakarta Struts, Cascading Style Sheets (CSS), Java Server Pages (JSP)
Tags: Java Struts 2, IE 6
Sign Up Now!
Solution Provided By: asanga_su
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628