Re: [5.3.6] Saving loop-generated checkbox values between requests

2012-12-28 Thread Muhammad Gelbana
You are correct, I'll have to lookup the whole objects from the database again and providing a value encoder sounds like the most seamless approach. Thanks a lot for your help :) On Fri, Dec 28, 2012 at 12:30 PM, Lance Java wrote: > The problem with ITERATION is that you need to lookup the values

Re: [5.3.6] Saving loop-generated checkbox values between requests

2012-12-28 Thread Lance Java
The problem with ITERATION is that you need to lookup the values when the form is posted. If these came from a database there is a chance that the list has changed between rendering the form and posting the form. I suggest that you either pass an "encoder" parameter to the loop or you contribute t

Re: [5.3.6] Saving loop-generated checkbox values between requests

2012-12-28 Thread Lance Java
> The thing is that "VALUES" serializes the "device" object using toString That's not entirely true. Tapestry uses a ValueEncoder to serialize / deserialize your values. If you don't provide an "encoder" parameter to the loop, it will use the ValueEncoderSource to find on which is ultimately backe

Re: [5.3.6] Saving loop-generated checkbox values between requests

2012-12-28 Thread Muhammad Gelbana
Thanks a lot ! It's coming along now. I first faced a problem with the loop state so I disabled it (i.e. NONE) but after you pointed out the javadoc, I tried the "ITERATION" option that keeps info sufficient info for iterating over the values only and its working now. The thing is that "VALUES" se

Re: [5.3.6] Saving loop-generated checkbox values between requests

2012-12-28 Thread Lance Java
The Loop component has a "formState" parameter which defaults to LoopFormState.VALUES. This means that by default, the Loop component serializes the loop values into a hidden field in your form. The values are then reconstructed serverside when the form is posted. http://tapestry.apache.org/5.3.6/

[5.3.6] Saving loop-generated checkbox values between requests

2012-12-27 Thread Muhammad Gelbana
I have a numerous checkboxes generated withing a loop that is even inside another loop Loop Loop Checkbox So I set the checkbox's value this way: So the "ipSelection" method accepts an ip, looks up a map of objects that have a "selected" boolean property. Now the "device" property