lets say we did let you use a setter
then we have to keep a reference to the converter in the Component, so when serialized it is one more object - that almost never changes - that has to be serialized. making components session footprint even bigger.
also if we let you use a setter we have to version the changes - so thats yet another object we have to add to session (the undo object)
by making getconverter() overridible we eliminate the two scenarios above.
-Igor
On 5/9/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
because there is only one converter and validators must be stored in a list.
This is all to keep the internal state of a component as clean as possible.
You don't have to create an anon class. You can return there a normal class or a inner class if you want.
johanOn 5/9/06, Bruno Borges < [EMAIL PROTECTED]> wrote:I really don't like the idea of having too many properties that must be "get" through anonymous classes.
Why there's no setConverter(IConverter c) just like add(IValidator v) returning the object itself?
see yaOn 5/9/06, Johan Compagner < [EMAIL PROTECTED]> wrote:currently not. What could be better in your eyes?
We will overhaul the converter interface in the next version so that it should be simpler.
johanOn 5/9/06, Bruno Borges <[EMAIL PROTECTED]> wrote:This is the only way I know (better: I learned from Wiki/Docs/Examples) on how to use MaskConverter:TextField zipCode = new TextField("zipCode") {public IConverter getConverter() {};MaskFormatter zipFormat = null;
try {zipFormat = new MaskFormatter("#####-###"); // Brazillian format} catch(Exception e) {} // never throws
return new UncheckedMaskConverter(zipFormat);}
Isn't a better way to to this?
--
Bruno Borges[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
