cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: onChange event handler not working in cocoon-2.1.7
Date Fri, 30 Sep 2005 07:27:10 GMT


I'm getting error if we use V3 API in my code?
That's why i tried using V2 API, b'cos found something in Cocoon-2.1.7

I'm getting the following error while accessing widget value/setting

"The undefined value has no properties."

wid.number1.value = 1; // error while accessing widget value

wid.number1.onChange = function(oldValue, newValue) { // error while
setting onChange
   print("number1 changed from " + oldValue + " to " + newValue);

My flow script code: -

function test() {
   var form = new Form("forms/test-def.xml");
   var wid = frm.getWidget();
   wid.number1.value = 1;

   wid.number1.onChange = function(oldValue, newValue) {
    print("number1 changed from " + oldValue + " to " + newValue);

Definition file:-

<fd:form xmlns:fd="">
    <fd:field id="number1" required="true">
       <fd:label>Please enter a number</fd:label>
       <fd:datatype base="string"/>

Template file : -
<html xmlns:ft=""
<ft:form-template action="#{$cocoon/continuation/id}.continue"
  <ft:widget id="number1">
    <fi:styling submit-on-change="true"/>

Anyone have idea on the same, please help me out.


-----Original Message-----
From: Mark Lundquist []
Sent: Friday, September 30, 2005 4:07 AM
Subject: Re: onChange event handler not working in cocoon-2.1.7

On Sep 29, 2005, at 1:01 PM, Jason Johnston wrote:

>> We are using following resource in cocoon- ...
>> cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v3/
>> Form.
>> js");
> Why did you switch flow APIs from v3 to v2?

it looks like his switch was _to_ v3?...

>   The APIs have many
> differences, so it's not surprising they're behaving differently.  I'm
> not
> familiar with anything but v1, but a cursory glance at the javadocs 
> tells
> me v2 doesn't support the .onChange shortcut.

It does, actually... and so does v3.  See their respective versions of 
ScriptableWidget.  I don't think you can tell from the Javadoc for the 
v2 implementation, although for v3 I believe it would tell you...


To unsubscribe, e-mail:
For additional commands, e-mail:

Confidentiality Notice

The information contained in this electronic message and any attachments to this message are
for the exclusive use of the addressee(s) and may contain confidential or privileged information.
you are not the intended recipient, please notify the sender at Wipro or
and destroy all copies of this message and any attachments.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message