cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Chávez <ccha...@agsoftware.dnsalias.com>
Subject Re: [flowscript] How to set an integer value in the FlowScript?
Date Wed, 28 Jan 2004 17:21:32 GMT

 Hi Joerg,

 i am think this is related with the datatype of Woody and Java
 the datatype in woody integer is converter in java.lang.Integer
 and the datatype in woody decimal is converter in java.math.BigDecimal

Joerg Heinicke Escribio :-)
> I have a little problem when setting a value of a Woody widget which is
> type
> integer in the FlowScript:
> "Tried to set value of output widget "repeater.offset" with an object of
> an
> incorrect type: expected class java.lang.Integer, received class
> java.lang.Double."
>
> The JavaScript code is simple:
> offsetWidget.value = 0;

  Try this :

         offsetWidget.setValue(new java.lang.Integer(0));  or
         offsetWidget.value = new java.lang.Integer(0);

>
> I tried to enforce the datatype integer in the JavaScript by changing it
> to:
> offsetWidget.value = parseInt(0);
> but had no success.
>
> Now I tried to access the error on the other end by changing the Woody
> definition and binding. As there is no double datatype I tried float with
> the
> following result:
> "Tried to set value of output widget "repeater.offset" with an object of
> an
> incorrect type: expected class java.lang.Float, received class
> java.math.BigDecimal."
> That was not what I expected! Also this error occurs on binding load time,
> not
> when I set the value. Is this a bug??
>
> Next try was to set the datatype in Woody definition and binding to
> "decimal",
> but here I'm back at the expected error message: "expected class
> java.math.BigDecimal, received class java.lang.Double".
  with the decimal datatype try this:

  repeater.offset = new java.math.BigDecimal(0);

>
> How to fix it?
>
> Joerg
>

 I hope help you.

 Cheers,
 Carlos Chávez


Mime
View raw message