Quantcast

Loop of checkboxes in form

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Loop of checkboxes in form

nquirynen
Hi,

What is the best practice for showing a (dynamic) list of objects as
checkboxes in a form and posting the selection. I have found some
examples, but they all have the need of persisting data in the http
session, which I'd like to avoid as much as possible. Or is this the
only way to achieve this?

An example I found:
http://lombok.demon.co.uk/tapestry5Demo/test/components/checkboxgroupdemo

Nathan


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Loop of checkboxes in form

Lance Java
If you want to avoid http session you could maintain a hidden text field on
the page which also gets posted alongside the checkboxes. The text field
contains a comma separated list of the checkbox ids (or maybe just a count
if index based naming convention)

On 23 Jan 2017 10:07 a.m., "Nathan Quirynen" <[hidden email]>
wrote:

> Hi,
>
> What is the best practice for showing a (dynamic) list of objects as
> checkboxes in a form and posting the selection. I have found some examples,
> but they all have the need of persisting data in the http session, which
> I'd like to avoid as much as possible. Or is this the only way to achieve
> this?
>
> An example I found: http://lombok.demon.co.uk/tape
> stry5Demo/test/components/checkboxgroupdemo
>
> Nathan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Loop of checkboxes in form

JumpStart
Another way without @Persist:

        http://jumpstart.doublenegative.com.au/jumpstart7/examples/tables/loopwithdeletecolumn1

> On 23 Jan 2017, at 7:14 PM, Lance Java <[hidden email]> wrote:
>
> If you want to avoid http session you could maintain a hidden text field on
> the page which also gets posted alongside the checkboxes. The text field
> contains a comma separated list of the checkbox ids (or maybe just a count
> if index based naming convention)
>
> On 23 Jan 2017 10:07 a.m., "Nathan Quirynen" <[hidden email]>
> wrote:
>
>> Hi,
>>
>> What is the best practice for showing a (dynamic) list of objects as
>> checkboxes in a form and posting the selection. I have found some examples,
>> but they all have the need of persisting data in the http session, which
>> I'd like to avoid as much as possible. Or is this the only way to achieve
>> this?
>>
>> An example I found: http://lombok.demon.co.uk/tape
>> stry5Demo/test/components/checkboxgroupdemo
>>
>> Nathan
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Loop of checkboxes in form

Thiago H de Paula Figueiredo
On Mon, Jan 23, 2017 at 9:21 AM, JumpStart <
[hidden email]> wrote:

> Another way without @Persist:
>
>         http://jumpstart.doublenegative.com.au/jumpstart7/examples/tables/
> loopwithdeletecolumn1


Tapestry JumpStart providing us the correct way of doing stuff again. :)
The key here is to avoid @Persist is providing a ValueEncoder.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Loop of checkboxes in form

nquirynen
Thanks all for your answers. And yes JumpStart has been a reference for
me lots of times, so thank you for that!

In my search I've found that Tapestry actually has a component that does
what I need:

https://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checklist.html

I had never seen this component before. In the example in the documents
it does @Persist the "selected" parameter value though, but I don't
think there is any need for this, so I'm not sure why it is like that in
the example.

Nathan

Op 23/01/2017 om 17:35 schreef Thiago H. de Paula Figueiredo:

> On Mon, Jan 23, 2017 at 9:21 AM, JumpStart <
> [hidden email]> wrote:
>
>> Another way without @Persist:
>>
>>          http://jumpstart.doublenegative.com.au/jumpstart7/examples/tables/
>> loopwithdeletecolumn1
>
> Tapestry JumpStart providing us the correct way of doing stuff again. :)
> The key here is to avoid @Persist is providing a ValueEncoder.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...