You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sohail Aslam <so...@techlogix.com> on 2003/10/15 10:52:38 UTC

Table rows with a checkbox in the first column

Q1. I generate the rows of a HTML <table> using the Foreach component. I 
need to have a checkbox placed in the first column of every row. The 
user can thus select various rows to indicate that these rows are of 
interest. When the form submits, I need to find out which rows have the 
checkbox checked. Is there an example of such a setup somewhere?

Q2. If I want to use the contrib:table component, how can I have a 
column of checkboxes in the table model?

Thanks
Sohail Aslam
www.techlogix.com



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


Re: Table rows with a checkbox in the first column

Posted by Sohail Aslam <so...@techlogix.com>.
Thanks for the suggestions. Regarding your note, the answer is to no to 
all three, i.e., I don't need to paginate, I don't need to sort, and I 
don't perceive any additional functionality at the moment. Following 
your advice, I will stick with foreach.

Regards,
Sohail Aslam
www.techlogix.com

Mind Bridge wrote:
> Hi,
> 
> 
>>Q1. I generate the rows of a HTML <table> using the Foreach component.
> 
> 
> The checkbox will invoke a listener (or set a property). You can obtain the
> object that the checkbox refers to from Foreach.value.
> 
> The 'value' parameter of Foreach can be bound to a property of yours which
> will give you an easier access to that value.
> 
> As a side note, it may be a better idea to use ListEdit rather than Foreach
> if you are rendering within a form.
> 
> 
> 
>>Q2. If I want to use the contrib:table component, how can I have a
>>column of checkboxes in the table model?
> 
> 
> The LocaleList component in the workbench demonstrates precisely that.
> 
> If you having problems with the TableFormView and TableFormPages components
> for some reason, please use TableView and TablePages instead.
> 
> 
> Another side note: The table component makes sense to be used if
> (1) you need to paginate the data, or
> (2) you need sorting for some columns, or
> (3) you want some flexibility despite the additional complexity
> 
> If your case requires neither, and you want something quick and simple, it
> may make more sense to stick to Foreach instead.
> 
> Best regards,
> -mb
> 
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Sohail Aslam
> Sent: Wednesday, October 15, 2003 11:53 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Table rows with a checkbox in the first column
> 
> 
> Q1. I generate the rows of a HTML <table> using the Foreach component. I
> need to have a checkbox placed in the first column of every row. The
> user can thus select various rows to indicate that these rows are of
> interest. When the form submits, I need to find out which rows have the
> checkbox checked. Is there an example of such a setup somewhere?
> 
> Q2. If I want to use the contrib:table component, how can I have a
> column of checkboxes in the table model?
> 
> Thanks
> Sohail Aslam
> www.techlogix.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 



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


RE: Table rows with a checkbox in the first column

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

> Q1. I generate the rows of a HTML <table> using the Foreach component.

The checkbox will invoke a listener (or set a property). You can obtain the
object that the checkbox refers to from Foreach.value.

The 'value' parameter of Foreach can be bound to a property of yours which
will give you an easier access to that value.

As a side note, it may be a better idea to use ListEdit rather than Foreach
if you are rendering within a form.


> Q2. If I want to use the contrib:table component, how can I have a
> column of checkboxes in the table model?

The LocaleList component in the workbench demonstrates precisely that.

If you having problems with the TableFormView and TableFormPages components
for some reason, please use TableView and TablePages instead.


Another side note: The table component makes sense to be used if
(1) you need to paginate the data, or
(2) you need sorting for some columns, or
(3) you want some flexibility despite the additional complexity

If your case requires neither, and you want something quick and simple, it
may make more sense to stick to Foreach instead.

Best regards,
-mb

-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Sohail Aslam
Sent: Wednesday, October 15, 2003 11:53 AM
To: tapestry-user@jakarta.apache.org
Subject: Table rows with a checkbox in the first column


Q1. I generate the rows of a HTML <table> using the Foreach component. I
need to have a checkbox placed in the first column of every row. The
user can thus select various rows to indicate that these rows are of
interest. When the form submits, I need to find out which rows have the
checkbox checked. Is there an example of such a setup somewhere?

Q2. If I want to use the contrib:table component, how can I have a
column of checkboxes in the table model?

Thanks
Sohail Aslam
www.techlogix.com



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


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