Hi Samuel,

One method is :

1/ add to the following method to your base action

        public String format(Object value)
        {
                return
(String)XWorkConverter.getInstance().convertValue(null,null,null,null,value,
String.class);
        }

2/ in velocity, just call $stack.findValue("format(your property)") or in
any #tag(... "value=format('your property'" ...)

Ciao.

Richard HALLIER
Chef de projet
[EMAIL PROTECTED]
01.40.12.41.52
www.uniclick.org
UNICLICK



-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de
Samuel Mota
Envoyé : mercredi 7 janvier 2004 16:15
À : [EMAIL PROTECTED]
Objet : [OS-webwork] Using Conversion Framework at view


Hi,

Is there some way to enable the view to use the conversion framework to
display the string? (I'm
with Velocity)

Explaining:

public MyType getMyField() {
      return theField;
}

Instead of using the result for the call to toString() method from MyType
the
xwork/webwork/anyoneelse call the registered converter.

that's it ...

thanks

+ Samuel G. Mota
+ [EMAIL PROTECTED]
+ 55 (11) 4417 7093
+ Business Application Dpt.
+ Netset Serviços em Tecnologia
+ a Hypercom Company
+ http://www.hypercom.com




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=ick
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to