[Silk UI Web] Select2 mandatory validation fails for ListBox

[Silk UI Web] Select2 mandatory validation fails for ListBox

Forge Component
Published on 14 Jul (11 days ago) by OutSystems R&D
50 votes
Published on 14 Jul (11 days ago) by OutSystems R&D
Select2 is placed on ListBox.
The field has manadatory set to true
Special List:
Value 1: 0
Option 1: -

Validation on submit button: Client & Server

When the user does not select a value (so - is choosen in the listbox) the form can be submitted.
The error "Required field!" should have be shown instead and the form should not be submitted.

Note: when select2 is not applied to the listBox (so you get the normal listBox) it works fine.
Hello Johan,

Sorry for the late reply.

I'm not able to replicate your issue, because ListBox does not have the option to be set as mandatory.
Can you please provide a clean eSpace with your implementation?

Best Regards,
Samuel Jesus
Hello Samuel,

Here it is. If you have any further questions please let me know.
Hello Johan,

Thank you for your reply.

After looking at your eSpace, there are a couple of things I would like to mention:
  • You are not using a ListBox. Instead you are using a Combo-box

A ComboBox can be set as mandatory, and a LisBox does not have that option.

  • You are using London Theme. As I told you on the other post, Silk UI Patterns (including Select2) were created to be used inside Silk UI Layouts (or custom Layouts that follow the same rules of a Silk UI Layout). The usage of Silk UI Patterns on London Theme is not guaranteed. That is why you have this strange behaviour when you see it on your browser:

The same Example, implemented on the Dublin Theme, would look like this:

Please let us know if you have any questions.

Samuel Jesus

Thanks, I have tried it with the liverpool theme and it is also working!