Announcement

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

    Collapsed section items disable required field validation

    Firefox 24,
    <gwtVersion>2.6.1</gwtVersion>
    <smartgwtVersion>5.0-p20141210</smartgwtVersion>
    Isomorphic SmartClient/SmartGWT Framework (v10.0p_2015-11-20/Pro Deployment 2015-11-20)

    Hi,

    We have a serious problem on our whole application which massively use SectionItem into its forms.
    We didn't notice it before because it will happen rarely but it causes a lot of issues.

    Our forms are built using a dynamic form that is, most of the time, saved through saveData method. Each one contains form items that are often grouped into Section items.
    But when we collapse a section item containing mandatory fields with an empty value, the validation doesn't work correctly and the save action is executed whereas there is a check on client-side :

    Code:
    final DynamicForm form;
    if (form != null && form.validate()) {
    form.saveData();
    }
    I didn't find in your documentation any mention of this behavior and I tested it on an unitary HMI to check that it does not ci
    Is this the expected one?
    How can we fix it in any case (in a different way than expanding all the sections before the save action - this solution works) ?

    P.S. : I can give you any other information you would need to understand/reproduce this issue.
    Last edited by vlafon; 12 Jan 2016, 09:28.

    #2
    See the docs for validate() - first parameter is an option to validateHiddenFields. If you choose to validateHiddenFields, you'll need to also implement dynamicForm.handleHiddenValidationErrors().

    These options aren't enabled by default because it's generally a bad idea to have a form where validation errors can occur on hidden items. This situation requires you to choose from various bad options such as popping open a closed section to reveal validation errors, or reporting the errors separately instead of inline as with normal errors. You should instead avoid this case if possible, by either validating earlier (immediately, or at least on the attempt to collapse the section), or carefully placing potentially invalid fields so they don't appear in collapsible sections.

    Comment


      #3
      OK thanks.
      We'll try to find the better way to fix it.

      Comment

      Working...
      X