We tried the event handler before and it did a lot more stuff that we
didn't want to happen, so I don't think that's necessarily the best
choice.

Richard's idea of having a format() method works, but is sub-optimal
since it requires extra work from you that is not part of the type
conversion framework. The whole point of type conversion is to avoid
doing this.

Instead, just simply make a call to $stack.findValue("...",
String.class). For example:

$stack.findValue("foo", "".class) 

While that will work, it's incredibly ugly and involves creating a
String purely to pass String.class in to the findValue() method. I
_believe_ that the $util object has a helper to do this for you. If it
doesn't, we'll need to add it.

Hope that helps.

-Pat

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Konstantin Priblouda
Sent: Wednesday, January 07, 2004 7:45 AM
To: [EMAIL PROTECTED]
Subject: Re: [OS-webwork] Using Conversion Framework at view


--- Samuel Mota <[EMAIL PROTECTED]> wrote:
> 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 ...


You could install event handler in velocity, which
will fire on reference extension - then it can do
whatever you like to convert reference value to
string. 

I did it ( though not in webwork context ) to escape
xml characters

regards,

=====
----[ Konstantin Pribluda ( ko5tik ) ]----------------
Zu Verstärkung meines Teams suche ich ab Sofort einen
Softwareentwickler[In] für die Festanstellung. 
Arbeitsort: Mainz 
Skills:  Programieren, Kentnisse in OpenSource-Bereich
----[ http://www.pribluda.de ]------------------------

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to