I am trying to write a custom translator to convert a
List<Number>
to a comma seperated list of numbers, to be displayed
in a
component TextArea. (And during form submit, the
comma seperated list of numbers
is converted to a List<Number> by the custom
translator.)
So I extend AbstractTranslator and called my
translator DataTranslator.
To use it, I would have the following in my .page :
<component id="dataTA" type="TextArea">
<binding name="value"
value="ognl:myNumbers"/>
<binding name="displayName"
value="literal:Data"/>
<binding name="translator"
value="translator:dataTranslator"/>
</component>
where
myNumbers is a property of type List<Number>,
and the class behind dataTranslator is
DataTranslator,
a subclass of AbstractTranslator.
In the method ,
DataTranslator.formatObject(IFormComponent field,
Locale locale,
Object object) , where the converstion of List<Number>
to a
comma seperated list of numbers is done,
I am expecting the type of object to be List<Number>.
Instead,
it is of type String and looks like "[23,33,234]".
Thanks in advance for any assistance!
Shing
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
All New Yahoo! Mail Tired of [EMAIL PROTECTED]@! come-ons? Let our SpamGuard
protect you. http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]