ubala / aribaweb

Automatically exported from code.google.com/p/aribaweb
Apache License 2.0
1 stars 2 forks source link

<w:GenericChooser>: Support for numeric data #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a <w:GenericChooser> (in a <w:BasicPageWrapper> etc):
   a. type="Popup" (or "Chooser" etc)
   b. key is bound to a numeric field (ex: int field in the model)
   c. list='${[1, 2, 3]}' (also tried list='${["1", "2", "3"]}'
   (optional: d. formatter="formatters.integer" <-- is this an Integer or
int (or both)?)

What is the expected output? What do you see instead?
While the choices are visible in the UI, when a choice is made, a
"java.lang.IllegalArgumentException" occurs.

What version of the product are you using? On what operating system?
5.0 RC2; WinXPPro32; Firefox 3

Please provide any additional information below.
At what points in the framework does formatter occur? I'm guessing that the
Popup is automagically converting the int choices to Strings. Maybe
formatter needs to work some of the time? (I have no problems when I use an
<a:TextField> for this numeric field.)

Original issue reported on code.google.com by morton.t...@gmail.com on 25 Apr 2009 at 6:12

GoogleCodeExporter commented 9 years ago
For now, I am converting the Popup input via a String version of the field at 
the
model level. (Would this be an accessor accessor?) This maintains the UI/field
binding functionality. (The getter/setter of the String version slaves off of 
the
stored int version, converting into and out of the stored int version and 
handling
null values correctly.) While this works, it definitely is a kludge.

Original comment by morton.t...@gmail.com on 25 Apr 2009 at 6:18

GoogleCodeExporter commented 9 years ago
Breakthrough!

On a lark, I took a closer look at the <a:Popup> documentation. By using
delayTakeValues="$true" (and list='${[1, 2, 3]}'), the functionality worked 
without
using the interim (accessor accessor) field!

<w:GenericChooser> does not mention the <a:Popup> delayTakeValues binding, and 
it
should. (Many other "parent" bindings are mentioned in other widgets.) 
Furthermore,
as indicated by <a:Popup> delayTakeValues, shouldn't delayTakeValues default to
$true? (From delayTakeValues: " . . .(This is generally what you want)")

Original comment by morton.t...@gmail.com on 25 Apr 2009 at 6:51

GoogleCodeExporter commented 9 years ago
Well, sort of . . .

The Popup (with delayTakeValues="$true" and use of formatter) doesn't handle 
null
values. Also tried playing with the selection binding (pre-treating? via 
awl-level
groovy). Oh well, back to the (accessor accessors) kludge.

Original comment by morton.t...@gmail.com on 25 Apr 2009 at 7:18