Christopher Oliver <res1cf5x <at> verizon.net> writes:That's because the object provided to your event handler in your form definition is not a ScriptableWidget but rather the Java Widget. When you write
JS Number is a double according to the specification. ScriptableWidget
provides coercions that allow you to write:
offset.value = 0;
See the sample I recently committed.
Ok, I had a look at it. woody_flow_example.js (v2) contains lines like
wid.account.value = 2;
wid.cowheight.value = 2;
with datatype long and it seems to work. I did remote debugging and the Double
is replaced by a Long in the method jsSet_value(Object value).
But I'm not using the v2, but "normal" Woody and it seems not to work. The
ScriptableWidget here has a similar logic in put() as in the mentioned
jsSet_value() in v2. But setting a breakpoint inside it, it never breaks there.
offsetWidget.value = 0
you're actually calling Widget.setValue() through Rhino's Java integration
Is it now just a new functionality in v2 or is something broken in the currentThe old ScriptableWidget has something similar but as I mentioned in my email about the new one it has other limitations that makes it unusable.
Woody ScriptableWidget?
BTW, this functionality does only work for fields, but not for output widgetsI just added a fix for Output.
(it's more or less obvious from the code and I tried it with v2 sample).
Regards,
Chris