You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hennie Brugman <he...@mpi.nl> on 2006/12/14 10:37:42 UTC

InputSuggestAjax - how to retrieve the selected value

Hi all,

My InputSuggestAjax works just fine. However, for some reason I can not
access its value when the form that it's part of is submitted. Here's the
code:

            <s:inputSuggestAjax suggestedItemsMethod="#{
search.getSelectItems}"
                    itemLabelMethod="#{search.getSelectItemLabel}"
                    value="#{search.chosenValue}"
                    charset="utf-8">
                <f:converter converterId="inputSuggestAjaxConverter" />
            </s:inputSuggestAjax>


For some reason, my bean's getChosenValue always returns null.

What could I be doing wrong?

Thanks for any help,

Hennie Brugman

Re: InputSuggestAjax - how to retrieve the selected value

Posted by Hennie Brugman <he...@mpi.nl>.
My converter's getAsString is correctly called, getAsObject never seems to
be called, and neither is the setter of chosenValue.

When I try the standard string based ISA case my setSuggestValue method is
not called either.

Unfortunately, your example code does not do anything with the selected
value either. Do you know if I can find some sample code that does this?

By the way, is my setChosenValue supposed to be called asynchonously, or as
part of the normal JSF life cycle?

best,
Hennie

2006/12/14, Gerald Müllan <bi...@gmail.com>:
>
> Hi,
>
> is the value passed correctly to the converter and further converted
> without any exception?
>
> Is the setter of chosenValue called?
>
> If you have the sandbox sources, there is a nice example which goes
> through the special way of using ISA with the label/value approach.
>
> cheers,
>
> Gerald
>
> On 12/14/06, Hennie Brugman <he...@mpi.nl> wrote:
> > Hi all,
> >
> > My InputSuggestAjax works just fine. However, for some reason I can not
> > access its value when the form that it's part of is submitted. Here's
> the
> > code:
> >
> >             <s:inputSuggestAjax suggestedItemsMethod="#{
> > search.getSelectItems}"
> >                     itemLabelMethod="#{search.getSelectItemLabel}"
> >                     value="#{search.chosenValue}"
> >                     charset="utf-8">
> >                 <f:converter
> > converterId="inputSuggestAjaxConverter" />
> >             </s:inputSuggestAjax>
> >
> >
> > For some reason, my bean's getChosenValue always returns null.
> >
> > What could I be doing wrong?
> >
> > Thanks for any help,
> >
> > Hennie Brugman
> >
>
>
> --
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: InputSuggestAjax - how to retrieve the selected value

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

is the value passed correctly to the converter and further converted
without any exception?

Is the setter of chosenValue called?

If you have the sandbox sources, there is a nice example which goes
through the special way of using ISA with the label/value approach.

cheers,

Gerald

On 12/14/06, Hennie Brugman <he...@mpi.nl> wrote:
> Hi all,
>
> My InputSuggestAjax works just fine. However, for some reason I can not
> access its value when the form that it's part of is submitted. Here's the
> code:
>
>             <s:inputSuggestAjax suggestedItemsMethod="#{
> search.getSelectItems}"
>                     itemLabelMethod="#{search.getSelectItemLabel}"
>                     value="#{search.chosenValue}"
>                     charset="utf-8">
>                 <f:converter
> converterId="inputSuggestAjaxConverter" />
>             </s:inputSuggestAjax>
>
>
> For some reason, my bean's getChosenValue always returns null.
>
> What could I be doing wrong?
>
> Thanks for any help,
>
> Hennie Brugman
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces