cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan <alan-cocoon-us...@engrm.com>
Subject Re: how to use the document object in a widget
Date Mon, 12 Jul 2004 16:52:13 GMT
* Johnson <johnson@soho.club.tw> [2004-06-24 07:38]:

> ----- Original Message ----- 
> From: "Joerg Heinicke" <joerg.heinicke@gmx.de>
> To: <users@cocoon.apache.org>
> Sent: Thursday, June 24, 2004 1:03 PM
> Subject: Re: how to use the document object in a widget
> 
> 
> > On 24.06.2004 02:50, Johnson wrote:
> > > Hi!
> > > 
> > > A newbie question,I want to handle the document object in widget like
> > > <fd:on-value-changed>
> > >     document.getElementById("date").focus();
> > > </fd:on-value-changed>
> > > 
> > > But "document not define" return.
> > > how to do this.
> > 
> > It's form.lookupWidget("date");
> > 
> > But there is definitely no function focus() on the server side. What you
> > want to do is client side javascript. Therefore you have to add that
> > snippet to your generated HTML and not to flowscript.

> tks,can I do it in template or XSLT
> But how to make it interactive with widget event

Please post your replys at the bottom.

    You can't make it interactive. The scripting of the widgets
    takes place only on the server. That JavaScript runs and
    processes the form submission. Basically, you click a submit
    button and the browser gathers up the form contents and posts
    them to the server, where CForms processes the submission. All
    CForms has to work with is this form submission data. The actual
    form controls are in no way accessible from CForms.

    Cocoon does generate the form control HTML markup and sends it
    initially, but the browser methods, such a focus() exist only
    for JavaScript that runs in the browser.

    Does that make sense?

-- 
Alan / alan@engrm.com / http://engrm.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message