Hello Varma,

please put both selectOneChoice in one panel if possible.

Regards

Bernd

Varma Dendukuri wrote:
Hi Volker,

Here is my JSF Code.

<tx:selectOneChoice label="#{bundle.select}"
                           value="#{checkout.billingAddressId}"
                                id="billingAddressId">
   <f:selectItem itemValue="0"  itemLabel=" --- Select Billing Address ---
"/>
   <f:selectItems value="#{checkout.billingAddresses}"/>


   <f:facet name="change">
      <tc:command action="#{checkout.handleBillingAddressChange}">
        <tc:attribute name="renderedPartially"
value=":page:shipToSitePanel"/>
      </tc:command>
   </f:facet>
</tx:selectOneChoice>

The Panel i.e to be Updated

<tc:panel id="shipToSitePanel" >
   <tx:selectOneChoice label="#{bundle.select}"
                       value="#{checkout.shippingAddressId}"
                       id="shippingAddress" >

       <f:selectItems value="#{checkout.shippingAddresses}"/>
   </tx:selectOneChoice>
</tc:panel>

Regards,
Varma

On 2/14/07, Bernd Bohmann <[EMAIL PROTECTED]> wrote:

Hello Varma,

can you send your jsf page, please.

Regards

Bernd

Varma Dendukuri wrote:
> Added  <ajax-enabled>true</ajax-enabled> to tobogo-config.xml and then
> it is
> working fine now.
>
> But the values are not set to the backing bean. For now i read the
> properties from the request parameters. Is there any better solution ??
> Below is the code that i used.
>
>    public String handleBillingAddressChange()
>    {
>        // Kind of Hack, If the billingAddressId is not set to the
backing
> bean
>        // by the Tobago, Trying to get it the from request parameters
>        if(billingAddressId == null){
>            FacesContext facesContext = FacesContext.getCurrentInstance
();
>            Map paramValues= facesContext.getExternalContext()
>                    .getRequestParameterMap();
>            billingAddressId=
> (String)paramValues.get("page:billingAddressId");
>            log.debug("Billing Address Id from Request :" +
> billingAddressId);
>        }
>        log.debug(" Selected Billing Address Id: "  +
> this.billingAddressId);
>
>        return null;
>    }
>
> Regards,
> Varma
>
> On 2/13/07, Varma Dendukuri < [EMAIL PROTECTED]> wrote:
>>
>> After spending sometime debugging this, Found that
>>
>> Tobago.addAjaxComponent(':page:panel); has to be called incase if the
>> panel has to be updated using AJAX.
>>
>> Is this a bug in 1.0.9??
>>
>> Regards,
>> Varma
>>
>> On 2/13/07, Varma Dendukuri < [EMAIL PROTECTED]> wrote:
>> >
>> > Hi Volker,
>> >
>> > Thanks for the Quick Response.
>> >
>> > When i was trying this, getting the following javascript error.
>> >
>> > LOG.debugAjaxComponents is not a function. tobago.js (line 595)
>> >
>> > I'm running on Tobago 1.0.9. I have gone through the js code and
found
>> > that there is no function called "debugAjaxComponents" defined in the
>> > class LOG.
>> >
>> > Am i missing anything ??
>> >
>> > Regards,
>> > Varma
>> >
>> > On 2/12/07, Volker Weber <[EMAIL PROTECTED] > wrote:
>> > >
>> > > Hi Varma,
>> > >
>> > > i have no experience with 'thirdparty AJAX frameworks', but i don't
>> > > think they work with tobago.
>> > >
>> > > But you can do this with the tobago internal ajax partial reload
>> > > feature.
>> > >
>> > > put the second tc:selectOneChoice into a tc:panel with defined
>> > > clientId ( this means you set a id to this panel and to all
>> > > surrounding namingContainer components).
>> > >
>> > > add a 'change' facet to the first tc:selectOneChoice with a action
to
>> > > change the options for the second one, and a renderedPartially
>> > > attribute to update.
>> > >
>> > > --- jsf ------------------------
>> > > <tc:page id="page">
>> > > ...
>> > > <tc:selectOneChoice ...>
>> > >   <f:selectItems .../>
>> > >   <f:facet name="change">
>> > >     <tc:command action="#{ bean.selectOptions}">
>> > >       <tc:attribute name="renderedPartially" value=":page:panel"/>
>> > >     </tc:command>
>> > >   </f:facet>
>> > > </tc:selectOneChoice>
>> > >
>> > > <tc:panel id="panel">
>> > >   <tc:selectOneChoice ...>
>> > >     <f:selectItems value="#{bean.items2}"/>
>> > >   </tc:selectOneChoice>
>> > > </tc:panel>
>> > > ...
>> > > </tc:page>
>> > > --- /jsf ------------------------
>> > >
>> > > the action method "public String selectOptions() {...}" should
update
>> > > the
>> > > selectItems in items2 property.
>> > > And MUST return null, because you don't want to navigate to anohter
>> > > view.
>> > >
>> > > Regards,
>> > >   Volker
>> > >
>> > >
>> > > 2007/2/12, Varma Dendukuri <[EMAIL PROTECTED]>:
>> > > > Hi All,
>> > > >
>> > > > I have a usecase where i need to dynamically change the
>> > > values(Options) of a
>> > > > ListBox [<tc:selectOneChoice>] based on a value selected in
another
>> > > ListBox
>> > > > or based on the value entered in a textbox[<tc:in>]. At present i
>> > > have
>> > > > achieved this using changeEventListener in which the form is
>> > > submitted to
>> > > > the server. But i dont want to go to server to get the values.
>> Wanna
>> > > do that
>> > > > using AJAX.
>> > > >
>> > > > So is there a way that we can achieve this with the thirdparty
AJAX
>> > > > frameworks like YUI, ScriptAculoUs, ProtoType etc.
>> > > >
>> > > > It would be great if someone can provide any kinda examples ?
>> > > >
>> > > > Thanks in Advance.
>> > > >
>> > > > Regards,
>> > > > Varma
>> > > >
>> > > >
>> > >
>> >
>> >
>>
>


Reply via email to