You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Pe...@gmx.net on 2006/01/16 16:51:12 UTC

Error- Accessing widgets in flowscript

Hello,

I have some difficulties accessing the widget values in the flow script. 

var form = new Form("registration_definition.xml");
var wid = form.getWidget();
wid.message.value = cocoon.parameters.defaultMessage;

The last call throws this exception: 
org.mozilla.javascript.EcmaError: Cannot convert null to an object.

When I access the same widget in an jscript block in the form_definition
there is no problem. 

 <fd:javascript>
    var msg = this.lookupWidget("../message");
 msg.value = "Selecting." + + event.newValue ;
</fd:javascript>

What is the problem here? 
I use the sitemap form the simple form example of the user guide.

cheers,

Pete

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

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


Re: Error- Accessing widgets in flowscript

Posted by Pe...@gmx.net.
Ah, thanks :o)

-Pete 

> --- Ursprüngliche Nachricht ---
> Von: Bruno Dumon <br...@outerthought.org>
> An: users@cocoon.apache.org
> Betreff: Re: Error- Accessing widgets in flowscript
> Datum: Mon, 16 Jan 2006 17:05:37 +0100
> 
> On Mon, 2006-01-16 at 16:51 +0100, Peter.Neu@gmx.net wrote:
> > Hello,
> > 
> > I have some difficulties accessing the widget values in the flow script.
> > 
> > var form = new Form("registration_definition.xml");
> > var wid = form.getWidget();
> > wid.message.value = cocoon.parameters.defaultMessage;
> 
> You need to do:
> 
> wid.getChild("message").value = ...
> 
> > 
> > The last call throws this exception: 
> > org.mozilla.javascript.EcmaError: Cannot convert null to an object.
> > 
> > When I access the same widget in an jscript block in the form_definition
> > there is no problem. 
> > 
> >  <fd:javascript>
> >     var msg = this.lookupWidget("../message");
> >  msg.value = "Selecting." + + event.newValue ;
> > </fd:javascript>
> > 
> > What is the problem here? 
> > I use the sitemap form the simple form example of the user guide.
> > 
> > cheers,
> > 
> > Pete
> > 
> -- 
> Bruno Dumon                             http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> bruno@outerthought.org                          bruno@apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

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


Re: Error- Accessing widgets in flowscript

Posted by Bruno Dumon <br...@outerthought.org>.
On Mon, 2006-01-16 at 16:51 +0100, Peter.Neu@gmx.net wrote:
> Hello,
> 
> I have some difficulties accessing the widget values in the flow script. 
> 
> var form = new Form("registration_definition.xml");
> var wid = form.getWidget();
> wid.message.value = cocoon.parameters.defaultMessage;

You need to do:

wid.getChild("message").value = ...

> 
> The last call throws this exception: 
> org.mozilla.javascript.EcmaError: Cannot convert null to an object.
> 
> When I access the same widget in an jscript block in the form_definition
> there is no problem. 
> 
>  <fd:javascript>
>     var msg = this.lookupWidget("../message");
>  msg.value = "Selecting." + + event.newValue ;
> </fd:javascript>
> 
> What is the problem here? 
> I use the sitemap form the simple form example of the user guide.
> 
> cheers,
> 
> Pete
> 
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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