You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Steve Eynon <st...@alienfactory.co.uk> on 2010/04/20 08:16:41 UTC

Re: AjaxFormLoop: property changes have no effect

Excellent - I'm really happy I found this email for I to, fell into
the same trap.

I entered the world of ValueEncoders after playing with Field
Translators and TypeCoercers and thought maybe they did the same
thing. I also (wrongly) thought that as I supplied the AjaxFormLoop
with a source List, Tapestry would be able to back track through the
list and set the properties for me (much the same as it read them in
the first place).

Anyhow, it all works now and I just thought I'd keep this thread
relevant in case anyone else has the same problem.

Steve.


On 5 August 2009 07:22, Andy Pahne wrote:
>
> You are right, that was a misunderstanding on my side.
>
> Now I got it. Thanks. For the curious, here is the working code:
>
>   public ValueEncoder getVehicleEncoder(){
>       return new ValueEncoder() {
>
>           @Override public String toClient(Object value) {
>               return String.valueOf(vehicles.indexOf(value));
>           }
>
>           @Override public Object toValue(String clientValue) {
>               return vehicles.get(new Integer(clientValue));
>           }
>                 };
>   }
>
>
>
> Still I had to take a little care that my Vehicle' equal() method returns
> some meaningfull value....
>
>
> Thank you for your feedback.
> Andy

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