I tried that but it didn't work. In the class Popup I have added a encoder

public ValueEncoder getEncoder() {
        return new ValueEncoder<PopupItem>() {

            public String toClient(PopupItem value) {
                Long key = value.getKey();
                return key.toString();
            }

            public PopupItem toValue(String keyAsString) {
                Long key = new Long(keyAsString);
                for (PopupItem holder : source) {
                    if (holder.getKey().equals(key)) {
                        return holder;
                    }
                }
                return null;
            }
        };
    }

I have also added a key in the PopupItem class

Could the problem be in Coercion. It was trowing that exception before so I
have provided some simple Coercion for it. Not sure if that could cause the
problem. 

 Coercion&lt;String, PopupItem&gt; coercion3 = new Coercion&lt;String,
PopupItem&gt;() {

            public PopupItem coerce(String input) {
                return new PopupItem(new Long(2), input, input);
            }
        };

 configuration.add(new CoercionTuple&lt;String, PopupItem&gt;(String.class,
PopupItem.class, coercion3));

Anyway the problem is still the same even after adding the encoder. The
value enter in the form is to returnd to the property of the PopupItem. So
if I set as default some value it will be render to the input field but if I
changed it wont go back to the PopupItem from which the original value has
come.

Any ideas? 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Form-elements-inside-a-component-tp4749774p4774039.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to