You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by carmi_cd <ca...@yahoo.com> on 2007/12/14 10:40:20 UTC

[S2]Checkbox formatting..



 I have a table with four columns, the other three columns are all filled
with text, while the first column
of each row is a checkbox to select the row. My problem is the checkbox move
the other column to the 
next line. It seems that it occupy to much space in the table..how should i
change this?

here is that part of the code:

      <table align="center" cellpadding="0" cellspacing="0"
class="listTable" border="0">
                        <tr valign="middle">
                            <th width="1%" align="center">
                                <input id="chkAllUser" name="chkAllUser"
type="checkbox"/>
                            </th>
                            <th width="29%" align="left">Fullname</th>
                            <th width="20%" align="left">Username</th>
                            <th width="50%" align="left">System Modules</th>                    
                        </tr>
                        <s:iterator id="users" value="getUsersList()">
                            <tr> 
                                <td align="left" valign="top">
                                   <s:checkbox name="userId"
fieldValue="%{getUserId()}"/>                            
                                </td>
                                <td align="left" valign="top">
                                    <s:url id="report"
value="UserMgt_input.action?userId=%{getUserId()}&task=edit"/>
                                    <s:a theme="ajax" 
                                         href="%{report}" 
                                         targets="module"
                                         errorText="Unable to load Report
Generator."
                                    >
                                        <s:property value="getLastName()"/>
, <s:property value="getFirstName()"/> <s:property value="getMiddleName()"/>
                                    </s:a>
                                </td>
                                <td align="left" valign="top">
                                    <s:property value="getUserName()"/>
                                </td>
                                <td align="left" valign="top">
                                    <s:iterator id="modules"
value="getModules()">
                                        <s:property
value="getModuleName()"/> ,                                    
                                    </s:iterator>
                                </td>
                            </tr>
                        </s:iterator>                    
                    </table>

if i tried to use plain html checkbox..the display is ok..how could i do the
same in Struts 2 checkbox?
please help me..thanks in advance..
-- 
View this message in context: http://www.nabble.com/-S2-Checkbox-formatting..-tp14332643p14332643.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2]Checkbox formatting..

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Setting the checkbox theme to simple will give you a plain HTML checkbox:

<s:checkbox theme="simple" name="userId" fieldValue="%{getUserId()}"/>            

Otherwise you need to create your own theme for the checkbox:
http://struts.apache.org/2.0.11/docs/themes-and-templates.html

carmi_cd wrote:
>
>  I have a table with four columns, the other three columns are all filled
> with text, while the first column
> of each row is a checkbox to select the row. My problem is the checkbox move
> the other column to the 
> next line. It seems that it occupy to much space in the table..how should i
> change this?
>
> here is that part of the code:
>
>       <table align="center" cellpadding="0" cellspacing="0"
> class="listTable" border="0">
>                         <tr valign="middle">
>                             <th width="1%" align="center">
>                                 <input id="chkAllUser" name="chkAllUser"
> type="checkbox"/>
>                             </th>
>                             <th width="29%" align="left">Fullname</th>
>                             <th width="20%" align="left">Username</th>
>                             <th width="50%" align="left">System Modules</th>                    
>                         </tr>
>                         <s:iterator id="users" value="getUsersList()">
>                             <tr> 
>                                 <td align="left" valign="top">
>                                    <s:checkbox name="userId"
> fieldValue="%{getUserId()}"/>                            
>                                 </td>
>                                 <td align="left" valign="top">
>                                     <s:url id="report"
> value="UserMgt_input.action?userId=%{getUserId()}&task=edit"/>
>                                     <s:a theme="ajax" 
>                                          href="%{report}" 
>                                          targets="module"
>                                          errorText="Unable to load Report
> Generator."
>                                     >
>                                         <s:property value="getLastName()"/>
> , <s:property value="getFirstName()"/> <s:property value="getMiddleName()"/>
>                                     </s:a>
>                                 </td>
>                                 <td align="left" valign="top">
>                                     <s:property value="getUserName()"/>
>                                 </td>
>                                 <td align="left" valign="top">
>                                     <s:iterator id="modules"
> value="getModules()">
>                                         <s:property
> value="getModuleName()"/> ,                                    
>                                     </s:iterator>
>                                 </td>
>                             </tr>
>                         </s:iterator>                    
>                     </table>
>
> if i tried to use plain html checkbox..the display is ok..how could i do the
> same in Struts 2 checkbox?
> please help me..thanks in advance..
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org