flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: [FlexJS] TextInput/Form validation
Date Tue, 20 Sep 2016 18:01:06 GMT
If you use beads, the JS code in the bead would add "require", for
example, to the <input> element, but the SWF code might be empty since
there is nothing on the SWF side to support a required input field. One
day you or someone might fill in that SWF code block.

If you use beads, the developer would add the beads onto to those fields
that needed them:

<html5:TextInput id="firstName">
       <html5:RequiredFieldBead />
<html5:TextInput id="nickname" />

Here, the firstName field is required so it includes the
RequiredFieldBead, but the nickname field is optional so you don't add it.

Your alternative, as Alex said, it just to add things as properties to the
HTML5 version of the TextInput component:

<html5:TextInput id="firstName" required="true" />
<html5:TextInput id="nickname" />

it is sure less to type for the developer, but both instances carry with
the code to handle the required property. But since this is HTML5-only, it
wouldn't be a big deal. In fact, you could mix the two:

<htm5:TextInput id="firstName" required="true" />
<js:TextInput id="nickname" />

Then the nickname is just the simpler code.


On 9/20/16, 1:43 PM, "OK" <post@olafkrueger.net> wrote:

>>Yes, beads would be a good thing, but IMO, it is only necessary for the
>>COMPILE::SWF code, since it is the SWF code that doesn't have built-in
>>functionality to rely on.
>If we'd go this way, does it mean that at the end users would have to add
>beans to make sure that the SWF version works and also have to add the
>properties to the TextInput component to make sure that the JS version
>View this message in context:
>Sent from the Apache Flex Users mailing list archive at Nabble.com.

View raw message