You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2014/07/01 20:18:40 UTC

[5.4-beta-6] Form always produces this error: "Selected option is not listed in the model"

I found that my event-handler to handle a form's successful submit is never
fired. I have a very simple form that has one text field and select
component.

I included *<t:errors/>* (What is this actually called ? A component ? A
block ?) to display the form's errors if they exist and I was surprised to
find this error:

*Selected option is not listed in the model*

My value encoder always returns a valid object based on the client-side ID,
so what could be the reason for this error ?

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana

Re: [5.4-beta-6] Form always produces this error: "Selected option is not listed in the model"

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 01 Jul 2014 15:29:41 -0300, Muhammad Gelbana <m....@gmail.com>  
wrote:

> Fixed. I had to implement the equals method !
> I did this out of mere guessing, is this stated somewhere in the docs ? I
> admit I haven't been reading the docs since v5.2 may be.

Writing an equals() method is something widely recommended in Java, not  
just Tapestry, specially for objects that end up in collections, as that's  
the case with the Select component (SelectModel doesn't implement  
Collection, but semantically it is a collection).

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: [5.4-beta-6] Form always produces this error: "Selected option is not listed in the model"

Posted by Muhammad Gelbana <m....@gmail.com>.
Fixed. I had to implement the equals method !
I did this out of mere guessing, is this stated somewhere in the docs ? I
admit I haven't been reading the docs since v5.2 may be.

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana


On Tue, Jul 1, 2014 at 8:18 PM, Muhammad Gelbana <m....@gmail.com>
wrote:

> I found that my event-handler to handle a form's successful submit is
> never fired. I have a very simple form that has one text field and select
> component.
>
> I included *<t:errors/>* (What is this actually called ? A component ? A
> block ?) to display the form's errors if they exist and I was surprised to
> find this error:
>
> *Selected option is not listed in the model*
>
> My value encoder always returns a valid object based on the client-side
> ID, so what could be the reason for this error ?
>
> *---------------------*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>

Re: [5.4-beta-6] Form always produces this error: "Selected option is not listed in the model"

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 01 Jul 2014 15:18:40 -0300, Muhammad Gelbana <m....@gmail.com>  
wrote:

> I included *<t:errors/>* (What is this actually called ? A component ? A
> block ?)

A component. That's why I call it the Errors component instead of  
<t:errors>, not to mention I prefer the <div t:type="Errors"> syntax.  
Blocks are declared using <t:block>.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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