Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2124

It should be possible to append the errorClass to the class attribute, instead of replacing it

    XMLWordPrintable

    Details

    • Type: Feature
    • Status: Backlog
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      For <appNG:formElement> and <appNG:formGroup>, the class defined in errorClass replaces the class-attribute of the wrapped HTML input fields.

      For certain integration scenarios (e.g. Bootstrap) it would be useful if the errorClass could be appended instead.

      This reduces the overhead of adding existing classes to errorClass.

       

      Example:

      Before change:
       

      <appNG:formElement
              errorClass="form-control is-invalid"
              rule="string"
              mandatory="true"
              errorMessage="Not a valid name!"
              mandatoryMessage="Name is mandatory"
              errorElementId="name-error">
          <input type="text" name="name" value="" class="form-control" />
          <div id="name-error" class="invalid-feedback" />
      </appNG:formElement>

      After change (introducing errorClassAppend)

      <appNG:formElement
              errorClass="is-invalid"
              errorClassAppend="true"
              rule="string"
              mandatory="true"
              errorMessage="Not a valid name!"
              mandatoryMessage="Name is mandatory"
              errorElementId="name-error">
          <input type="text" name="name" value="" class="form-control" />
          <div id="name-error" class="invalid-feedback" />
      </appNG:formElement>

      The result, in both cases, assumed the field was empty when submitting:

      <input type="text" name="name" value="" class="form-control is-invalid" />
      <div id="name-error" class="invalid-feedback">Name is mandatory</div>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mueller.matthias Matthias Müller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: