ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

trim on text fields.

ajaidka
5 Jul 2011 09:03:21 GMT
5 Jul 2011 09:03:21 GMT

Hi
Is there any way to trim values automatically. I have 10s of text boxes and I dont want to write textbox.getValue().trim() on each of the component.
Please suggest if there is any other eady way out.

Thanks
Ajaidka

benbai
18 Jul 2011 05:22:29 GMT
18 Jul 2011 05:22:29 GMT

Hi Ajaidka,

you can create another class extends origional Textbox and override the getValue() method,
then assign your textbox to use the new class in page or composer,

two simple samples :

override and assign in zul file
override and assign in Composer

click Run button at top right then click 'show current value' button in popup window to see the result,
and you may edit some content then click Run again to test different case.