zorba-the-geek / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Improve localization/message-customization #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The support for localization (messages-customization per-se) isn't comfortable 
enought.

I'm migrating from GWT-Ext [that was quick & easy]:

 userName.setAllowBlank(false);
 userName.setBlankText(messages.getDefaultBlankField());

now

 userName.setRequired(true); // GOOD: more readable

...
...
BUT to set a customized error message i've found only this option:
...

 RequiredIfValidator reqValidator = new RequiredIfValidator();
 reqValidator.setExpression( new RequiredIfFunction() {
    public boolean execute(FormItem formItem, Object value) {
        return true;
    }
 });

 reqValidator.setErrorMessage(messages.getDefaultBlankField());
 userName.setValidators(reqValidator);

...Frankly too much...

The option (more understandable)

 userName.setRequiredMessage("New Req Msg");

[not exist]

...and the last

 userName.setProperty("requiredField", "New Req Msg");

...Is not working...

Original issue reported on code.google.com by giovanni...@gmail.com on 23 Jan 2009 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by sanjiv.j...@gmail.com on 9 May 2009 at 12:50

GoogleCodeExporter commented 9 years ago
Added FieldItem.setRequireMessaged(..) convenience method to SVN.

Original comment by sanjiv.j...@gmail.com on 3 Feb 2010 at 1:49