You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gurps <g...@gurpal.co.uk> on 2006/11/25 14:21:22 UTC

Checkbox in table (non-contrib)


I have a pojo bean which renders its attributes as a row in a For loop in a
non-contrib table.

What i want to do is provide a checkbox at the end of each row which enables
the selected beans to be identified in the listener method.

I don't know if only the primary keys or the whole row is stored or
anything. And this must be in a NON-Contrib table.

Any help most appreciated, an example is the best way!
Thanks
-- 
View this message in context: http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7538325
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Checkbox in table (non-contrib)

Posted by Gurps <g...@gurpal.co.uk>.
sure: page 330 to 334. section called "Adding a Delete checkbox"


jake123 wrote:
> 
> 
> 
> Gurps wrote:
>> 
>> Hey guys,
>> 
>> Actually i found a different solution which is outlined in Kent Tong's
>> book. I totally missed it (Kent: Please put Checkbox in the index so we
>> can look at the example easily!!)
>> 
>> 
> 
> Do you have the page number in Kent Tong's book for the checkbox example?
> 
> Thanks,
> Jacob
> 

-- 
View this message in context: http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7569224
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Checkbox in table (non-contrib)

Posted by jake123 <ja...@gmail.com>.


Gurps wrote:
> 
> Hey guys,
> 
> Actually i found a different solution which is outlined in Kent Tong's
> book. I totally missed it (Kent: Please put Checkbox in the index so we
> can look at the example easily!!)
> 
> 

Do you have the page number in Kent Tong's book for the checkbox example?

Thanks,
Jacob
-- 
View this message in context: http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7565609
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Checkbox in table (non-contrib)

Posted by Gurps <g...@gurpal.co.uk>.
Hey guys,

Actually i found a different solution which is outlined in Kent Tong's book.
I totally missed it (Kent: Please put Checkbox in the index so we can look
at the example easily!!)

Basically, you put an ad-hoc invoke listener inside the for loop. The for
loop sets the currentBean per iteration and inside the delete method, you
would already know which item is the current one. So this method works per
row in your table rather than submitting a whole list and iterating it (as
you might do in JSP via request params).

I'll put up a small example soon.

G.


Srinivas Yermal-2 wrote:
> 
> Hi Karthik,
> 
> For some reason this doesnt seem to be working for me. I have the same
> requirement and tried describing it earlier on. Later I had to settle for
> this -
> 
> http://mail-archives.apache.org/mod_mbox/tapestry-users/200611.mbox/ajax/%3ca172fd5a0611100529h7c2b657ar2c123904972fdcef@mail.gmail.com%3e
> Srini.
> 
> On 11/26/06, Karthik N <ka...@gmail.com> wrote:
>>
>> 1. if you can modify your pojo have a boolean isChecked in it which you
>> can
>> wire to the checkbox in your for loop
>> 2. if not, wrap a DTO around your pojo which has this boolean
>> 3. during the rewind cycle the checked boolean will be set
>> 4. in your listener method you can iterate through the List that was used
>> for the For Loop and figure the selected rows by using the isChecked
>> method
>>
>> On 11/25/06, Gurps <g@gurpal.co.uk > wrote:
>> >
>> >
>> >
>> > I have a pojo bean which renders its attributes as a row in a For loop
>> in
>> > a
>> > non-contrib table.
>> >
>> > What i want to do is provide a checkbox at the end of each row which
>> > enables
>> > the selected beans to be identified in the listener method.
>> >
>> > I don't know if only the primary keys or the whole row is stored or
>> > anything. And this must be in a NON-Contrib table.
>> >
>> > Any help most appreciated, an example is the best way!
>> > Thanks
>> > --
>> > View this message in context:
>> >
>> http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7538325
>> > Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>>
>>
>> --
>> Thanks, Karthik
>>
>>
> 
> 
> -- 
> http://www.indygosoft.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7557608
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Checkbox in table (non-contrib)

Posted by Srinivas Yermal <sy...@indygosoft.com>.
Hi Karthik,

For some reason this doesnt seem to be working for me. I have the same
requirement and tried describing it earlier on. Later I had to settle for
this -

http://mail-archives.apache.org/mod_mbox/tapestry-users/200611.mbox/ajax/%3ca172fd5a0611100529h7c2b657ar2c123904972fdcef@mail.gmail.com%3e
Srini.

On 11/26/06, Karthik N <ka...@gmail.com> wrote:
>
> 1. if you can modify your pojo have a boolean isChecked in it which you
> can
> wire to the checkbox in your for loop
> 2. if not, wrap a DTO around your pojo which has this boolean
> 3. during the rewind cycle the checked boolean will be set
> 4. in your listener method you can iterate through the List that was used
> for the For Loop and figure the selected rows by using the isChecked
> method
>
> On 11/25/06, Gurps <g@gurpal.co.uk > wrote:
> >
> >
> >
> > I have a pojo bean which renders its attributes as a row in a For loop
> in
> > a
> > non-contrib table.
> >
> > What i want to do is provide a checkbox at the end of each row which
> > enables
> > the selected beans to be identified in the listener method.
> >
> > I don't know if only the primary keys or the whole row is stored or
> > anything. And this must be in a NON-Contrib table.
> >
> > Any help most appreciated, an example is the best way!
> > Thanks
> > --
> > View this message in context:
> >
> http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7538325
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Thanks, Karthik
>
>


-- 
http://www.indygosoft.com

Re: Checkbox in table (non-contrib)

Posted by Karthik N <ka...@gmail.com>.
1. if you can modify your pojo have a boolean isChecked in it which you can
wire to the checkbox in your for loop
2. if not, wrap a DTO around your pojo which has this boolean
3. during the rewind cycle the checked boolean will be set
4. in your listener method you can iterate through the List that was used
for the For Loop and figure the selected rows by using the isChecked method

On 11/25/06, Gurps <g...@gurpal.co.uk> wrote:
>
>
>
> I have a pojo bean which renders its attributes as a row in a For loop in
> a
> non-contrib table.
>
> What i want to do is provide a checkbox at the end of each row which
> enables
> the selected beans to be identified in the listener method.
>
> I don't know if only the primary keys or the whole row is stored or
> anything. And this must be in a NON-Contrib table.
>
> Any help most appreciated, an example is the best way!
> Thanks
> --
> View this message in context:
> http://www.nabble.com/Checkbox-in-table-%28non-contrib%29-tf2703459.html#a7538325
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Thanks, Karthik