Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 74233 invoked from network); 14 Feb 2007 07:39:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Feb 2007 07:39:36 -0000 Received: (qmail 12600 invoked by uid 500); 14 Feb 2007 07:39:38 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 12454 invoked by uid 500); 14 Feb 2007 07:39:37 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 12428 invoked by uid 99); 14 Feb 2007 07:39:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 23:39:37 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of vdenduku@gmail.com designates 64.233.182.189 as permitted sender) Received: from [64.233.182.189] (HELO nf-out-0910.google.com) (64.233.182.189) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 23:39:27 -0800 Received: by nf-out-0910.google.com with SMTP id d4so595192nfe for ; Tue, 13 Feb 2007 23:39:05 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=C/yUHeaeFsvrcGKzwr/32k08ys6RrAk7ldtvcl5fxCKHmKBEOtCYtjtvO1aKyXjrOSkkkoz//C99VZ4VHZBoXDoeYLr2xeC/Egy+DcwzSQTEBixN1r5+nGeVe5uPHHfNq4iyiMg2mY19GtZyOMPiccA/RZjAthgZyMh4oqIRQh4= Received: by 10.82.178.11 with SMTP id a11mr97687buf.1171438745628; Tue, 13 Feb 2007 23:39:05 -0800 (PST) Received: by 10.82.146.17 with HTTP; Tue, 13 Feb 2007 23:39:05 -0800 (PST) Message-ID: Date: Wed, 14 Feb 2007 13:09:05 +0530 From: "Varma Dendukuri" To: "MyFaces Discussion" Subject: Re: [Tobago] Ajax Frameworks With Tobago. In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_137321_13522645.1171438745581" References: <9a64d7d10702120220n3dc209ceg48d42d58fa46e6a7@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_137321_13522645.1171438745581 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Added true 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 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 ------------------------ > > > > > > ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ... > > > > > > --- /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 : > > > > Hi All, > > > > > > > > I have a usecase where i need to dynamically change the > > > values(Options) of a > > > > ListBox [] based on a value selected in another > > > ListBox > > > > or based on the value entered in a textbox[]. 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 > > > > > > > > > > > > > > > > ------=_Part_137321_13522645.1171438745581 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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
>
>



------=_Part_137321_13522645.1171438745581--