You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johnson <jo...@soho.club.tw> on 2004/06/24 02:50:25 UTC
how to use the document object in a widget
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.
Best Regards
Johnson
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: how to use the document object in a widget
Posted by Alan <al...@engrm.com>.
* Alan <al...@engrm.com> [2004-07-12 16:53]:
> Apologies for including email addresses in the message body. I
> know that bothers some people around here. (Need to fix my quote
> template.)
Let me also apologize for responding to such and old post.
And finally, for offering so many apologies.
--
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
Re: how to use the document object in a widget
Posted by Alan <al...@engrm.com>.
* Alan <al...@engrm.com> [2004-07-12 16:52]:
> * Johnson [2004-06-24 07:38]:
>
> > ----- Original Message -----
> > From: "Joerg Heinicke"
> > To: <us...@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?
Apologies for including email addresses in the message body. I
know that bothers some people around here. (Need to fix my quote
template.)
--
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
Re: how to use the document object in a widget
Posted by Alan <al...@engrm.com>.
* Johnson <jo...@soho.club.tw> [2004-06-24 07:38]:
> ----- Original Message -----
> From: "Joerg Heinicke" <jo...@gmx.de>
> To: <us...@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
Re: how to use the document object in a widget
Posted by Johnson <jo...@soho.club.tw>.
tks,can I do it in template or XSLT
But how to make it interactive with widget event
Best Regards
Johnson
----- Original Message -----
From: "Joerg Heinicke" <jo...@gmx.de>
To: <us...@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.
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: how to use the document object in a widget
Posted by Joerg Heinicke <jo...@gmx.de>.
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.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org