Skip to Content
author's profile photo Former Member
Former Member

highlighting inputfields with model data binding and the "errors"-object

Hello,

I'm using the possibility to highlight inputfields dynamically by adding a message to the errors object of the corresponding model.

In fact: I have a view "test.html" with several inputfields like this one:

<htmlb:inputField id = "if_text"
           maxlength = "10"
           size      = "10"
           value     = "//model/test.text"
           type      = "STRING" />

The model has the attribute "test" for the data binding and a method which checks the data. This method adds messages to the errors-object in case of erroneous data:

errors->add_message_from_t100( condition = 'test.text'
                               msgid     = 'Z01'
                               msgno     = '001'
                               msgty     = 'E' ).

This really works very well, the field is highlighted "red" (invalid). The only problem is that the inputfield doesn't show the incorrect data I entered. The field is empty although the data is still held in the attribute of the model.

I doubt that this is an expected behaviour, cause those fields which auto-check their inputs (dates, etc.) are highlighted too but hold their data.

Is this a known problem? Is there any way to hold the data?

Thanks in advance,

Stefan

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Oct 23, 2006 at 03:16 PM

    You should insert the wrong value in the DUMMY parameter of the method ADD_MESSAGE_FROM_T100.

    Sergio

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.