RE: onChange event handler not working in cocoon-2.1.7
Hi, 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 Samples I'm getting the following error while accessing widget value/setting onChange.. "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: - = cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v3/Form. js"); 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); } form.showForm("forms/test.html"); } Definition file:- http://apache.org/cocoon/forms/1.0#definition";> Please enter a number Template file : - http://apache.org/cocoon/forms/1.0#template"; xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"; xmlns:i18n="http://apache.org/cocoon/i18n/2.1";> ... ... ... ... Anyone have idea on the same, please help me out. Vijay. -Original Message- From: Mark Lundquist [mailto:[EMAIL PROTECTED] Sent: Friday, September 30, 2005 4:07 AM To: users@cocoon.apache.org 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-2.1.5.1 ... >> 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... cheers, -ml- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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-2.1.5.1 ... 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... cheers, —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: onChange event handler not working in cocoon-2.1.7
> > Hi, > > We are using cocoon-2.1.7 > > I'm setting widget onChange event handler programmatically in the > flowscript, it's not working as intended > Same code working fine with cocoon-2.1.5.1 > > I have attached my code below. > > cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v2/Form. > js"); > 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); > > } > form.showForm("forms/test.html"); > } > > > We are using following resource in cocoon-2.1.5.1 ... > cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v3/Form. > js"); > Why did you switch flow APIs from v3 to v2? 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: onChange event handler not working in cocoon-2.1.7
[EMAIL PROTECTED] wrote: Hi, We are using cocoon-2.1.7 I'm setting widget onChange event handler programmatically in the flowscript, it's not working as intended Same code working fine with cocoon-2.1.5.1 In the form template widget add fi:styling for onchange: Best Regards, Antonio Gallardo. I have attached my code below. */cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v2/Form.js");/* /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); } form.showForm("forms/test.html"); }/ We are using following resource in cocoon-2.1.5.1 ... *cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v3/Form.js");* Please anyone have idea on the same. Please help me out. Thanks, Vijay. Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
onChange event handler not working in cocoon-2.1.7
Title: Message Hi, We are using cocoon-2.1.7 I'm setting widget onChange event handler programmatically in the flowscript, it's not working as intendedSame code working fine with cocoon-2.1.5.1 I have attached my code below. cocoon.load("resource://org/apache/cocoon/forms/flow/_javascript_/v2/Form.js"); function test() { var form = new Form("forms/test-def.xml"); var wid = frm.getWidget(); wid.number1.value = 1; wid.number1. newValue) { print("number1 changed from " + oldValue + " to " + newValue); } form.showForm("forms/test.html");} We are using following resource in cocoon-2.1.5.1 ... cocoon.load("resource://org/apache/cocoon/forms/flow/_javascript_/v3/Form.js"); Please anyone have idea on the same. Please help me out. Thanks, Vijay. Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.