myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Varma Dendukuri" <vdend...@gmail.com>
Subject Re: [Tobago] Ajax Frameworks With Tobago.
Date Wed, 14 Feb 2007 07:39:05 GMT
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 < vdenduku@gmail.com> 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 < vdenduku@gmail.com> 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 <v.weber@inexso.de > 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 <vdenduku@gmail.com>:
> > > > 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
> > > >
> > > >
> > >
> >
> >
>

Mime
View raw message