You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by James Dekker <ja...@gmail.com> on 2011/08/09 19:27:48 UTC

How to put 2 columns inside CheckList

Am using the net.sf.click.extras.control.CheckList class to create a
visual list of multiple checkboxes to manage e-mail addresses.

Here's some sample code:

CheckList emailContactsCheckList = new CheckList(emailCheckList);

// Iterate through array contactList and add to CheckList also
concatenate String name to label
emailContactsCheckList.add(new Option(contactList[i].getEntry(), name
+ " " + contactList[i].getEntry());

When I run my web app, the check list appears like this:

checkbox John Doe johndoe@aol.com
checkbox Jane Doe janedoe@aol.com
checkbox Jeff Johnson jeffjohnson@aol.com

As one can see, the names & email addresses are not equally aligned
(vertically).

Is there a way to put two columns inside the CheckList:

e.g.

<tr>
      <td>$name></td>
      <td>$emailAddress</td>
</tr>

Thank you for taking the time to read this. Would appreciate a helpful response.

Re: How to put 2 columns inside CheckList

Posted by Bob Schellink <sa...@gmail.com>.
Hi James,

CheckList is an example of a control. All controls have a render
method which is where the markup is rendered. You can override the
render method to provide your own markup.

If you haven't done so I suggest you read the documentation on how
Click and controls works.

regards

Bob

On Wed, Aug 10, 2011 at 7:38 AM, James Dekker <ja...@gmail.com> wrote:
> Thanks for responding, Bob!
>
> What do you mean "click control"? Do you mean click on the Object using Eclipse while holding down the control key?
>
> Could you give me an example of what you mean by using the render() method? How would I pass the Option class inside it so that it appears inside a <td>?
>
> Thank you again for reaching out!
>
> -James
>
> On Aug 9, 2011, at 10:00 PM, Bob Schellink wrote:
>
>> Hi James,
>>
>> Click control use the #render method to render markup. I suggest you override that method to customize the markup for two columns ie. use a <table> and set the width explicitly on the columns.
>>
>> regards
>>
>> Bob
>>
>>
>> On 2011/08/09 19:27 PM, James Dekker wrote:
>>> Am using the net.sf.click.extras.control.CheckList class to create a
>>> visual list of multiple checkboxes to manage e-mail addresses.
>>>
>>> Here's some sample code:
>>>
>>> CheckList emailContactsCheckList = new CheckList(emailCheckList);
>>>
>>> // Iterate through array contactList and add to CheckList also
>>> concatenate String name to label
>>> emailContactsCheckList.add(new Option(contactList[i].getEntry(), name
>>> + " " + contactList[i].getEntry());
>>>
>>> When I run my web app, the check list appears like this:
>>>
>>> checkbox John Doe johndoe@aol.com
>>> checkbox Jane Doe janedoe@aol.com
>>> checkbox Jeff Johnson jeffjohnson@aol.com
>>>
>>> As one can see, the names&  email addresses are not equally aligned
>>> (vertically).
>>>
>>> Is there a way to put two columns inside the CheckList:
>>>
>>> e.g.
>>>
>>> <tr>
>>>       <td>$name></td>
>>>       <td>$emailAddress</td>
>>> </tr>
>>>
>>> Thank you for taking the time to read this. Would appreciate a helpful response.
>>>
>>
>
>

Re: How to put 2 columns inside CheckList

Posted by James Dekker <ja...@gmail.com>.
Thanks for responding, Bob!

What do you mean "click control"? Do you mean click on the Object using Eclipse while holding down the control key?

Could you give me an example of what you mean by using the render() method? How would I pass the Option class inside it so that it appears inside a <td>?

Thank you again for reaching out!

-James

On Aug 9, 2011, at 10:00 PM, Bob Schellink wrote:

> Hi James,
> 
> Click control use the #render method to render markup. I suggest you override that method to customize the markup for two columns ie. use a <table> and set the width explicitly on the columns.
> 
> regards
> 
> Bob
> 
> 
> On 2011/08/09 19:27 PM, James Dekker wrote:
>> Am using the net.sf.click.extras.control.CheckList class to create a
>> visual list of multiple checkboxes to manage e-mail addresses.
>> 
>> Here's some sample code:
>> 
>> CheckList emailContactsCheckList = new CheckList(emailCheckList);
>> 
>> // Iterate through array contactList and add to CheckList also
>> concatenate String name to label
>> emailContactsCheckList.add(new Option(contactList[i].getEntry(), name
>> + " " + contactList[i].getEntry());
>> 
>> When I run my web app, the check list appears like this:
>> 
>> checkbox John Doe johndoe@aol.com
>> checkbox Jane Doe janedoe@aol.com
>> checkbox Jeff Johnson jeffjohnson@aol.com
>> 
>> As one can see, the names&  email addresses are not equally aligned
>> (vertically).
>> 
>> Is there a way to put two columns inside the CheckList:
>> 
>> e.g.
>> 
>> <tr>
>>       <td>$name></td>
>>       <td>$emailAddress</td>
>> </tr>
>> 
>> Thank you for taking the time to read this. Would appreciate a helpful response.
>> 
> 


Re: How to put 2 columns inside CheckList

Posted by Bob Schellink <sa...@gmail.com>.
Hi James,

Click control use the #render method to render markup. I suggest you override that method to 
customize the markup for two columns ie. use a <table> and set the width explicitly on the columns.

regards

Bob


On 2011/08/09 19:27 PM, James Dekker wrote:
> Am using the net.sf.click.extras.control.CheckList class to create a
> visual list of multiple checkboxes to manage e-mail addresses.
>
> Here's some sample code:
>
> CheckList emailContactsCheckList = new CheckList(emailCheckList);
>
> // Iterate through array contactList and add to CheckList also
> concatenate String name to label
> emailContactsCheckList.add(new Option(contactList[i].getEntry(), name
> + " " + contactList[i].getEntry());
>
> When I run my web app, the check list appears like this:
>
> checkbox John Doe johndoe@aol.com
> checkbox Jane Doe janedoe@aol.com
> checkbox Jeff Johnson jeffjohnson@aol.com
>
> As one can see, the names&  email addresses are not equally aligned
> (vertically).
>
> Is there a way to put two columns inside the CheckList:
>
> e.g.
>
> <tr>
>        <td>$name></td>
>        <td>$emailAddress</td>
> </tr>
>
> Thank you for taking the time to read this. Would appreciate a helpful response.
>