You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Anton Gavazuk <an...@gmail.com> on 2009/01/13 14:30:57 UTC

[MYFACES][SANDBOX] Partial Page update, chain together combo box and inputSuggestAjax.

Hi all,

I'm trying to implement such scenario (maybe common)
I have combobox with countries and another input with cities, so when
user is choosing an country from combobox, he can enter city name in
the second input, but in the same time, if the system knows entered
city in choosed country, show to him the suggestion menu.

so my quick construction looks like:

<h:selectOneMenu id="inDropCountry" value="#{addressBean.countryInt}">
      <f:selectItems value="#{dictionaryBean.countries}"/>
   </h:selectOneMenu>
   <sand:pprPanelGroup id="city_ppr"
                       partialTriggers="inDropCountry(onchange)">
      <h:outputText value="#{addressBean.countryInt}"/>
      <h:outputLabel value="City:">
         <sand:inputSuggestAjax value="#{addressBean.city}"

suggestedItemsMethod="#{addressBean.getCitiesForCountry}"
                                itemLabelMethod="#{addressBean.getCityLabel}">
            <f:converter converterId="cityConverter"/>
         </sand:inputSuggestAjax>
      </h:outputLabel>
   </sand:pprPanelGroup>

Everything is fine on paper (or in editor :) ), but now I have
obstacle - every change in inputSuggest forces to create new
AddressBean instance and of course in that case the state of previous
addreassBean is being loosed. (The scope is request)
Now I see only one way - to play around with session saving of some
attributes, but its not very convenient.

Could anyone suggest  how to implement this scenario in more handy/easier way?

Cheers,
Anton

Re: [MYFACES][SANDBOX] Partial Page update, chain together combo box and inputSuggestAjax.

Posted by Leonardo Uribe <lu...@gmail.com>.
On Tue, Jan 13, 2009 at 10:28 AM, Anton Gavazuk <an...@gmail.com>wrote:

> I dont want to use orchestra,
>
> could you describe t:saveState? - how it should look?


see
http://myfaces.apache.org/tomahawk-project/tomahawk/tagdoc/t_saveState.html

regards

Leonardo Uribe


>
> 2009/1/13 Leonardo Uribe <lu...@gmail.com>:
> >
> >
> > On Tue, Jan 13, 2009 at 8:30 AM, Anton Gavazuk <an...@gmail.com>
> > wrote:
> >>
> >> Hi all,
> >>
> >> I'm trying to implement such scenario (maybe common)
> >> I have combobox with countries and another input with cities, so when
> >> user is choosing an country from combobox, he can enter city name in
> >> the second input, but in the same time, if the system knows entered
> >> city in choosed country, show to him the suggestion menu.
> >>
> >> so my quick construction looks like:
> >>
> >> <h:selectOneMenu id="inDropCountry" value="#{addressBean.countryInt}">
> >>      <f:selectItems value="#{dictionaryBean.countries}"/>
> >>   </h:selectOneMenu>
> >>   <sand:pprPanelGroup id="city_ppr"
> >>                       partialTriggers="inDropCountry(onchange)">
> >>      <h:outputText value="#{addressBean.countryInt}"/>
> >>      <h:outputLabel value="City:">
> >>         <sand:inputSuggestAjax value="#{addressBean.city}"
> >>
> >> suggestedItemsMethod="#{addressBean.getCitiesForCountry}"
> >>
> >>  itemLabelMethod="#{addressBean.getCityLabel}">
> >>            <f:converter converterId="cityConverter"/>
> >>         </sand:inputSuggestAjax>
> >>      </h:outputLabel>
> >>   </sand:pprPanelGroup>
> >>
> >> Everything is fine on paper (or in editor :) ), but now I have
> >> obstacle - every change in inputSuggest forces to create new
> >> AddressBean instance and of course in that case the state of previous
> >> addreassBean is being loosed. (The scope is request)
> >> Now I see only one way - to play around with session saving of some
> >> attributes, but its not very convenient.
> >>
> >> Could anyone suggest  how to implement this scenario in more
> handy/easier
> >> way?
> >
> > Hi
> >
> > There are many solutions: use myfaces orchestra (conversation scope),
> > t:saveState, .....
> >
> > regards
> >
> > Leonardo Uribe
> >
> >>
> >> Cheers,
> >> Anton
> >
> >
>

Re: [MYFACES][SANDBOX] Partial Page update, chain together combo box and inputSuggestAjax.

Posted by Anton Gavazuk <an...@gmail.com>.
I dont want to use orchestra,

could you describe t:saveState? - how it should look?

2009/1/13 Leonardo Uribe <lu...@gmail.com>:
>
>
> On Tue, Jan 13, 2009 at 8:30 AM, Anton Gavazuk <an...@gmail.com>
> wrote:
>>
>> Hi all,
>>
>> I'm trying to implement such scenario (maybe common)
>> I have combobox with countries and another input with cities, so when
>> user is choosing an country from combobox, he can enter city name in
>> the second input, but in the same time, if the system knows entered
>> city in choosed country, show to him the suggestion menu.
>>
>> so my quick construction looks like:
>>
>> <h:selectOneMenu id="inDropCountry" value="#{addressBean.countryInt}">
>>      <f:selectItems value="#{dictionaryBean.countries}"/>
>>   </h:selectOneMenu>
>>   <sand:pprPanelGroup id="city_ppr"
>>                       partialTriggers="inDropCountry(onchange)">
>>      <h:outputText value="#{addressBean.countryInt}"/>
>>      <h:outputLabel value="City:">
>>         <sand:inputSuggestAjax value="#{addressBean.city}"
>>
>> suggestedItemsMethod="#{addressBean.getCitiesForCountry}"
>>
>>  itemLabelMethod="#{addressBean.getCityLabel}">
>>            <f:converter converterId="cityConverter"/>
>>         </sand:inputSuggestAjax>
>>      </h:outputLabel>
>>   </sand:pprPanelGroup>
>>
>> Everything is fine on paper (or in editor :) ), but now I have
>> obstacle - every change in inputSuggest forces to create new
>> AddressBean instance and of course in that case the state of previous
>> addreassBean is being loosed. (The scope is request)
>> Now I see only one way - to play around with session saving of some
>> attributes, but its not very convenient.
>>
>> Could anyone suggest  how to implement this scenario in more handy/easier
>> way?
>
> Hi
>
> There are many solutions: use myfaces orchestra (conversation scope),
> t:saveState, .....
>
> regards
>
> Leonardo Uribe
>
>>
>> Cheers,
>> Anton
>
>

Re: [MYFACES][SANDBOX] Partial Page update, chain together combo box and inputSuggestAjax.

Posted by Leonardo Uribe <lu...@gmail.com>.
On Tue, Jan 13, 2009 at 8:30 AM, Anton Gavazuk <an...@gmail.com>wrote:

> Hi all,
>
> I'm trying to implement such scenario (maybe common)
> I have combobox with countries and another input with cities, so when
> user is choosing an country from combobox, he can enter city name in
> the second input, but in the same time, if the system knows entered
> city in choosed country, show to him the suggestion menu.
>
> so my quick construction looks like:
>
> <h:selectOneMenu id="inDropCountry" value="#{addressBean.countryInt}">
>      <f:selectItems value="#{dictionaryBean.countries}"/>
>   </h:selectOneMenu>
>   <sand:pprPanelGroup id="city_ppr"
>                       partialTriggers="inDropCountry(onchange)">
>      <h:outputText value="#{addressBean.countryInt}"/>
>      <h:outputLabel value="City:">
>         <sand:inputSuggestAjax value="#{addressBean.city}"
>
> suggestedItemsMethod="#{addressBean.getCitiesForCountry}"
>
>  itemLabelMethod="#{addressBean.getCityLabel}">
>            <f:converter converterId="cityConverter"/>
>         </sand:inputSuggestAjax>
>      </h:outputLabel>
>   </sand:pprPanelGroup>
>
> Everything is fine on paper (or in editor :) ), but now I have
> obstacle - every change in inputSuggest forces to create new
> AddressBean instance and of course in that case the state of previous
> addreassBean is being loosed. (The scope is request)
> Now I see only one way - to play around with session saving of some
> attributes, but its not very convenient.
>
> Could anyone suggest  how to implement this scenario in more handy/easier
> way?
>

Hi

There are many solutions: use myfaces orchestra (conversation scope),
t:saveState, .....

regards

Leonardo Uribe


>
> Cheers,
> Anton
>