You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Anthony Hong <an...@gmail.com> on 2006/03/24 08:33:52 UTC

selectionOneMany problem

I have two selectionOneMany in page, one for county and the other for city.
A valueChangeListener stick with country, after change city will be
fetch new value corspand with county.

Everything is fine for displaying and change county. But if I update
this form after change a county, there is a error with city selection
box.  "Value is not a valid option."

what is the possible cause?


--

Anthony Hong

Re: selectionOneMany problem

Posted by Cagatay Civici <ca...@gmail.com>.
If the problem is the city box then you should check out the value binding
to the city component. If there is a lazy initialization like
if(selectedCity == null)
    selectedCity = new City();

something like this, would cause an error.

On 3/24/06, Anthony Hong <an...@gmail.com> wrote:
>
> Agree with you.
> But how can I solve this problem? I tried to use t:saveState with my
> backingbean country, but it shows null point exception.
>
>
> On 3/24/06, Cagatay Civici <ca...@gmail.com> wrote:
> > Hi Anthony,
> >
> > What is binded to the value of the city component? If you bind a new
> City to
> > the component at somewhere, it will likely to give a validation error
> > because the component looks for the selectitem collection and when it
> cannot
> > find the value that you bind in this case "new city()", it will throw a
> > validation error. This should be a cause.
> >
> > Regards,
> >
> > Cagatay,
> >
> >
> > On 3/24/06, Anthony Hong <an...@gmail.com> wrote:
> > > I have two selectionOneMany in page, one for county and the other for
> > city.
> > > A valueChangeListener stick with country, after change city will be
> > > fetch new value corspand with county.
> > >
> > > Everything is fine for displaying and change county. But if I update
> > > this form after change a county, there is a error with city selection
> > > box.  "Value is not a valid option."
> > >
> > > what is the possible cause?
> > >
> > >
> > > --
> > >
> > > Anthony Hong
> > >
> >
> >
>
>
> --
>
> Anthony Hong
>

Re: selectionOneMany problem

Posted by Anthony Hong <an...@gmail.com>.
Agree with you.
But how can I solve this problem? I tried to use t:saveState with my
backingbean country, but it shows null point exception.


On 3/24/06, Cagatay Civici <ca...@gmail.com> wrote:
> Hi Anthony,
>
> What is binded to the value of the city component? If you bind a new City to
> the component at somewhere, it will likely to give a validation error
> because the component looks for the selectitem collection and when it cannot
> find the value that you bind in this case "new city()", it will throw a
> validation error. This should be a cause.
>
> Regards,
>
> Cagatay,
>
>
> On 3/24/06, Anthony Hong <an...@gmail.com> wrote:
> > I have two selectionOneMany in page, one for county and the other for
> city.
> > A valueChangeListener stick with country, after change city will be
> > fetch new value corspand with county.
> >
> > Everything is fine for displaying and change county. But if I update
> > this form after change a county, there is a error with city selection
> > box.  "Value is not a valid option."
> >
> > what is the possible cause?
> >
> >
> > --
> >
> > Anthony Hong
> >
>
>


--

Anthony Hong

Re: selectionOneMany problem

Posted by Cagatay Civici <ca...@gmail.com>.
Hi Anthony,

What is binded to the value of the city component? If you bind a new City to
the component at somewhere, it will likely to give a validation error
because the component looks for the selectitem collection and when it cannot
find the value that you bind in this case "new city()", it will throw a
validation error. This should be a cause.

Regards,

Cagatay,

On 3/24/06, Anthony Hong <an...@gmail.com> wrote:
>
> I have two selectionOneMany in page, one for county and the other for
> city.
> A valueChangeListener stick with country, after change city will be
> fetch new value corspand with county.
>
> Everything is fine for displaying and change county. But if I update
> this form after change a county, there is a error with city selection
> box.  "Value is not a valid option."
>
> what is the possible cause?
>
>
> --
>
> Anthony Hong
>