myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: RE : inputSuggestAjax: value vs. label, existing entries vs. new ones
Date Wed, 28 Mar 2007 21:45:06 GMT
I don't see what you'd gain by trying to do this in javascript.  Doing
it on the server during request processing seems natural and elegant
to me.

I think you've already discovered and listed the issues with trying to
add selectItems to the component.  Components working with selectItems
work with a predetermined discrete set of objects, not an open-ended
set.

On 3/28/07, Jerome Iffrig (Europe) <Jerome.Iffrig@eu.didata.com> wrote:
> Thanks lots Mike for your answer,
>
> What you are describing is what I am going currently, I was hoping for a
> more elegant way ...
> How about the value/label aspect? It does not seem to be documented
> anywhere.
>
>  ________________________________
>
> De: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Date: mer. 28/03/2007 20:30
> À: MyFaces Discussion
> Objet : Re: inputSuggestAjax: value vs. label, existing entries vs. new ones
>
>
>
>
> Seems like you'd just check that when the value is submitted.
>
> See if "value" is contained in the list provided by "suggestedItemsMethod".
> If true, link.  If false, create.
>
> You could either handle this in the "setValue()" method or in the
> action that submitted the page.
>
> On 3/28/07, Jerome Iffrig (Europe) <Jerome.Iffrig@eu.didata.com> wrote:
> >
> >
> >
> >
> > Using the inputSuggestAjax, I get autocompletion, brilliant.
> >
> > Now, is there any way to add in the response whether the sent value is
> > effectively one of the auto-suggested values or something else, new (thus
> > not yet in the autocomplete list)?
> >
> > I was imagining maybe an hidden field set to 0 or 1 …
> >
> >
> >
> > Furthermore, it seems to me that this component can work with label-value
> > lists, if it is the case, what happens when selecting one of the suggested
> > entry is clear to me (the value is returned instead of the label), but
> what
> > once again, if the user enters something new? How would the component make
> a
> > difference between a value resulting from a selected entry (label) and a
> new
> > value added in purpose (creation of a new label).
> >
> >
> >
> > The bottom line is that it is important in my use case that the user could
> > either select something from the suggested list (so that I can link onto
> the
> > PK in the underlying DBMS) OR enter any value of his choice (so that I can
> > create a new entry in the underlying DBMS).
> >
> >
> >
> > Thanks for your lights.
> >
> >
> >
> >
>

Mime
View raw message