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.  Because we have a regular
org.apache.flex.html.TextInput that can serve as the baseline for folks
who don't need these form fields, it is reasonable to think of
org.apache.flex.html5.TextInput as an aggregation on top of
org.apache.flex.html.TextInput so it can get away with baking a few more
things in.

If you look through existing components like Container, you'll see more
beads and support components on the COMPILE::SWF version implementing
non-built-in things in Flash like scrollbars and clipping.

On the other hand, something like the PromptBead is a bead on both JS and
SWF because it can be re-used in more than one component.

So, there isn't one right solution, you have to factor in re-usability of
code vs the overhead of encapsulating it.

Thanks,
-Alex

On 9/20/16, 7:00 AM, "Peter Ent" <p...@adobe.com> wrote:

>Hi,
>
>If you want to make this modification you should do it in the HTML5
>project. Keep in mind that "required" and "pattern" should be implemented
>for SWF as well or at least do something suitable. I would suggest using
>beads:
>
><html5:TextInput Š>
>   <html5:beads>
>      <html5:RequiredInputBead />
>      <html5:PatternInputBead pattern="<your pattern here>" />
>   </html5:beads>
></html5:TextInput>
>
>The beads would then have their JS code all within COMPILE::JS blocks. The
>SWF side might just be blank for now until someone implements them. I
>suppose you could add required and pattern properties to the HTML5 text
>input, but in the PAYG world, this would add overhead to all the times
>when you don't need those features.
>
>Anyway, you need to access the underlying element on the JS side:
>
>COMPILE::JS
>override protected function createElement():WrappedHTMLElement {
>    super.createElement();
>
>At this point the this.element is created for you and is an <input>
>element. Just look at the HTML project's TextInput.as file. If you going
>with the required and pattern properties route, then add them to the
>element here.
>
>If you going the beads route, you don't need to change the TextInput class
>at all as each bead's strand setter would get the element from the strand
>and set the appropriate property on the <input> element at that point.
>
>At least that's how I'd start out.
>
>HTH,
>Peter Ent
>Adobe Systems/Apache Flex Project
>
>
>
>On 9/20/16, 3:17 AM, "OK" <p...@olafkrueger.net> wrote:
>
>>>Want to make it happen?
>>I could give it a first try tonight.
>>Any help how to achieve this is appreciated ;-)
>>
>>Thanks,
>>Olaf
>>
>>
>>
>>--
>>View this message in context:
>>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-TextInput-Form-vali
>>d
>>ation-tp13577p13585.html
>>Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Reply via email to