trim on text fields.

asked 2011-07-05 09:03:21 +0800

ajaidka gravatar image ajaidka
196 4

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.


delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-07-18 05:22:29 +0800

benbai gravatar image benbai
2228 6

updated 2011-07-18 06:14:59 +0800

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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2011-07-05 09:03:21 +0800

Seen: 931 times

Last updated: Jul 18 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More