Hi all,
I think it will be interesting to finish the implementation of required
(probably in the 2.1), so now I'll create a ticket for this as an
improvement (and link this as initial discussion) if there aren't objections
...

But as a general (high level) idea, what do you think on keep the required
attribute, but this time as a shortcut for a new NotEmptyValidator opt.
attached to input elements), so inside Forms when desired (in application
code) we could: 
- keep a list of required components
- or traverse all its input components that has a NotEmptyValidator (only
check for not null and not empty string)
and in both cases, if something is not good, raise an error (0..n) ... etc ?
And verify if implement something inside the requiredChanged in
TerraFormSkin ... 

In this way we should be aligned with HTML Forms, like a "Validate all
required fields" at "onSubmit" of the Form ... if aligned with Pivot Forms
design.

I hope th be clear :-) ...
Comments ?


Note (just for reference, maybe for the future), in the current
implementation I see that:
- in Form, the setRequired method (if set in bxml) will be called when form
components has parent null, but it's not a big waste of time, so don't worry
- if I call the setRequired by code, for example inside the Forms.java
(under tutorials/ ... ) in the initialize method, like
        Form.setRequired(lastNameTextInput, true);
instead I find the same issues see today on other (similar) things (by Edvin
and Roger if I remember well): the new value (just set) is equal to the old
value, so the inner block code is skipped ...


You can see things I just described for example inside tutorials/ ...
/forms.bxml,
changing the line
                            <TextInput bxml:id="lastNameTextInput"
prompt="Last"/>
with 
                            <TextInput bxml:id="lastNameTextInput"
prompt="Last" Form.required="true"/>
and debug forms.bxml ...


Bye


--
View this message in context: 
http://apache-pivot-users.399431.n3.nabble.com/Form-required-does-it-have-any-functionality-tp3057011p3067323.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply via email to