Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Server validation messages i18n

    v8.3p_2012-11-29/PowerEdition Deployment (built 2012-11-29)

    I'm using unique validator on a field

    Code:
    <DataSource ID="users" serverType="hibernate" beanClassName="ru.eurotechnologygroup.etgcrm.server.model.User"
                schemaBean="ru.eurotechnologygroup.etgcrm.server.model.User" allowAdvancedCriteria="true">
    ....
    <field name="login" title="Логин" length="20" required="true" groupId="Параметры доступа">
                <validators>
                    <validator type="isUnique"/>
                </validators>
            </field>
    ...
    when i call

    Code:
    editForm.getValuesManager().saveData(new DSCallback()
                    {
                        @Override
                        public void execute(DSResponse response, Object rawData, DSRequest request)
                        {
                            ...
                        }
                    });
    I get "Value must be unique" message near my form field. The problem is that it's not translated.

    What can be done here? Even if it shouldn't be translated and it's kind of system message for a developer, i've been unable to intercept server validation response somehow. saveData callback is only called in case of success.

    ValuesManager.hasErrors() and validate() say that there's no error at all (even it's shown near the form field).

    TY.
    Last edited by vostapenko; 3 Dec 2012, 08:03.

    #2
    You can just set "errorMessage" on the <validator> tag as usual, using the approach described under the "DataSource Localization" topic.

    About hasErrors() malfunctioning, we'd need to see a test case. Note that obviously, calling hasErrors() synchronously after attempting a save will show no errors (server operation hasn't completed yet).

    Comment

    Working...
    X