Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The LANSA framework adds the option of displaying validation errors within the page, usually next to the field. To enable this behavior, you must add the class "lstdErrorShowInDiv" to the page <div> in your layout. The standard shipped layouts do this using the validationErrorDisplay property. You must also provide the <div> tags that will display the error. There must be one error <div> for each field. The <div> must have an ID of "{Field ID}_id" and a class of "lstdFieldError". For example:

<div id=" MyWR_TST_PKD _error" class="lstdFieldError"></div>

The standard field weblets will do this for you via the addErrorDiv property. When the "show in div" behavior is turned off, all error divs are automatically hidden. When the "show in div" behavior is turned on, all error divs are set to invisible, meaning that they cannot be seen by the user but space is still reserved for them in the document. This prevents the confusion of the page re-flowing if they are later made visible. When a validation error occurs in a field the framework will place the error message inside the corresponding error div and make it visible.