Sławomir SkowyraDecember 13, 2016 at 1:41 am #3267
I am wondering why in Spark Controls e.g. Text, property Required in Visibility tab doesn’t work. In Responsive coaches required controls are marked by red asterisk but in Spark there is no such functionality. Is it possible to make such feature globally for all controls?SPARK SupportDecember 13, 2016 at 10:21 am #3270
There is no global option to set all fields with an asterisk. However, one option is to set the validity of each field before the user attempts any input.
page.ui.get(“Text1″).setValid(false,”Required”); (see the attached Screen shot)
Or you could add a Tooltip control to contain the Test control with instructions for the field. (See attached configuration)
Stephen P.Stuart JonesJanuary 9, 2017 at 8:59 am #3457
I’d like to follow up on the question above and confirm the answer. I have been trying to use the visibility tab that is available for all controls to configure certain (but not all) controls to be required fields, i.e the user cannot transition from this UI until there are values in these fields. Setting the value of the Visibility tab to Required seems to have no effect on any controls that I have experimented with so far. My previous experience with other (non-SPARK) controls has been that setting a field to Required requires that the field has a value before one can move off of the screen but this doesn’t seem to work?
I am confused by the answer above as it seems to focus on the asterisk and I don’t think that is what Slawomir is asking about. Can you confirm if setting the value in the Visibility tab to Required is supposed to work or not?
Thanks, Stuart…Stu LeibowitzJanuary 9, 2017 at 9:12 am #3458
To add to Stuart’s reply: I can’t imagine ever releasing a set of controls that do not obey the basic settings in the Visibility tab.
For example, setting a Single Select control to “Required” in the Visibility tab should “just work!” The scripts to carry out these Visibility settings should be built into the coach views.
Is this (not) working as designed or just an oversight by your development team?
Sorry to be so passionate about this but…SPARK SupportJanuary 9, 2017 at 10:33 am #3461
Hi Stuart and Stu,
First off, I appreciate your passion for the SPARK Toolkit.
I see your point here. Our article on Required Fields in SPARK Forms deals with the “look” of required fields, whereas our article on Validation With SPARK demonstrates how to handle the logic and prevent the boundary even from being triggered.
As for the functionality of the stock IBM control using the Visibility field, let me discuss this with the Development Team and provide some further feedback.
Stephen P.Stuart JonesJune 19, 2017 at 7:53 am #4394
Hello Stephen P,
Did this discussion ever go anywhere? I am running the latest version of the SPARK toolkit that’s available to me (220.127.116.11 CE) and I don’t see any capability here. (I also notice that setting a Text field on load with me.setEnabled(true, true) doesn’t seem to have any effect – though I have not yet read through he articles that you mentioned above so there’s maybe more to it than this.
My personal opinion is that there should not be a requirement for any coding at all to make a field required.
Thanks, Stuart…SPARK SupportJune 19, 2017 at 11:13 am #4395
Here is an excerpt from the Redbook Deliver Modern UI for IBM BPM with the Coach Framework and Other Approaches regarding Visibility settings for the Stock controls on page 39:
2.7.1 Required visibility – The visibility of a control can be set to required, as shown in Figure 2-46 on page 40. This setting does not actually perform any validation logic or warn users when required fields are left blank, but it does provide users with a visual indicator at all times. An asterisk (*) displays beside each require field. Required visibility must be combined with another validation technique to enforce required data entry.
This excerpt on page 179 outlines how SPARK controls behave differently, and do not take the same visual approach for a “Required” field:
4.3.4 Validation – All SPARK UI control types that support validation visually reflect an invalid state. However, SPARK controls that support validation do not strictly depend on the conventional Coach Framework-based validation approach described in 2.7, “Adding validation to a coach” on page 39. However, the controls behave as expected with conventional validation. The SPARK UI Toolkit and its controls provide support for combinations of the following types of validation behaviors:
- Incorrect input is prevented in the first place. In this case, the control is never in an invalid state.
- A control allows invalid input but flags the issue during typing.
- A control allows invalid input but flags the issue after it loses focus.
- Some controls contain invalid input, but submission is prevented until errors are resolved.
- Some controls contain invalid input, and issues are flagged after submission.
As SPARK controls do not implement the red asterisk by design, we have provided the article on Required Fields in SPARK Forms.
You must be logged in to reply to this topic.