You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Piotr Zarzycki <pi...@gmail.com> on 2019/04/19 13:43:22 UTC

Jewel Validator and usage of public properties trigger/triggerEvent

Hi Carlos,

I'm looking into Validator, cause I have started using it more. I did port
EmailValidator from Flex to Jewel in my application but I'm not sure
whether it is actually require here - If yes I can commit it.

However I would like to ask why actually inside validator class when you
setup such properties like trigger/triggerEvent you are using private
fields instead of a public one ? Here is the crucial example [1]

Setting that to private field causes code duplication, cause in
StringValidation you are registering to the triggerEvent [2], which
actually would be done in trigger [3] property of Validator class.

Is there any reason to do not user public properties by you ? I would love
to change that.

[1]
https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
[2]
https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
[3]
https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116

Thanks,
-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Carlos Rovira <ca...@apache.org>.
Hi Piotr,

El dom., 21 abr. 2019 a las 17:49, Piotr Zarzycki (<
piotrzarzycki21@gmail.com>) escribió:

> Hi Carlos,
>
>  Comments inline.
>
> On Sun, Apr 21, 2019, 1:19 PM Carlos Rovira <ca...@apache.org>
> wrote:
>
> > Hi Piotr,
> >
> > I just see a problem with Jewel FormValidator that just uploaded that was
> > causing trigger CHANGE event as we move between controls in a Form.
> >
> > Are you saying that the only issue which you have found after my update
> > was that CHANGE event were triggered when you do what in the Form? I
> don't
> > understand here fully.
>
>
No. I see lots of errors in my App, but analyzing all I saw that was caused
by the need of update all my validators
to remove code that now can be there (like addEventListener, and things
like that). So all that changes (about 30-40 file changes)
where all on my app code side. The only one visible to you was
FormValidator that is in Royale.


> In order to fix that you had to override strand in FormValidator - I've
> > seen your commit.
> >
> > Rest of problems was the need to update all our custom validators to the
> > new code (we have many).
> > So I think all is ok now.
> >
> > This change make we save several lines of code in most classes since we
> can
> > remove strand function override from almost all code.
> >
> > Thanks for rise this problem and fix it! :)
> >
> > Cool that it helped simplify stuff in your custom validators. More
> helpful
> > stuff will come. ;)
>

Yeah! :). One more thing we will need to here is to separate visuals from
validation itself like Alex recommend, but this change will be more
"hard" to do it. We need to give possibility to use floating errortooltips
or instead just a label as sibling of the control for example, like people
do in more simple forms.

But I think we know have a good working Validator framework for Royale :).


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Carlos,

 Comments inline.

On Sun, Apr 21, 2019, 1:19 PM Carlos Rovira <ca...@apache.org> wrote:

> Hi Piotr,
>
> I just see a problem with Jewel FormValidator that just uploaded that was
> causing trigger CHANGE event as we move between controls in a Form.
>
> Are you saying that the only issue which you have found after my update
> was that CHANGE event were triggered when you do what in the Form? I don't
> understand here fully.


In order to fix that you had to override strand in FormValidator - I've
> seen your commit.
>
> Rest of problems was the need to update all our custom validators to the
> new code (we have many).
> So I think all is ok now.
>
> This change make we save several lines of code in most classes since we can
> remove strand function override from almost all code.
>
> Thanks for rise this problem and fix it! :)
>
> Cool that it helped simplify stuff in your custom validators. More helpful
> stuff will come. ;)
>
> Carlos
>
>
>
>
>
> El dom., 21 abr. 2019 a las 9:54, Carlos Rovira (<carlosrovira@apache.org
> >)
> escribió:
>
> > Thanks Piotr,
> > going to try it now and report if I see some issue.
> >
> > El sáb., 20 abr. 2019 a las 17:56, Piotr Zarzycki (<
> > piotrzarzycki21@gmail.com>) escribió:
> >
> >> Carlos,
> >>
> >> I have pushed fix. It's working with Tour De Jewel. Test with your app
> >> whether everything is working in case of validation for you.
> >>
> >> Thanks,
> >> Piotr
> >>
> >> sob., 20 kwi 2019 o 00:35 Carlos Rovira <ca...@apache.org>
> >> napisał(a):
> >>
> >> > Hi Piotr,
> >> >
> >> > just committed. Please, take a look.
> >> > About your questions, yes I think we have there a problem, so go ahead
> >> and
> >> > please fix it. Thanks for discovering that bug.
> >> >
> >> > Carlos
> >> >
> >> >
> >> > El sáb., 20 abr. 2019 a las 0:25, Carlos Rovira (<
> >> carlosrovira@apache.org
> >> > >)
> >> > escribió:
> >> >
> >> > > Hi Piotr,
> >> > >
> >> > > sorry, I have this in my real project and forgot to transfer to
> >> Royale,
> >> > > will do now, so you can have it and check it you see there's
> something
> >> > Greg
> >> > > or I forgot.
> >> > >
> >> > > thanks
> >> > >
> >> > > El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> >> > > piotrzarzycki21@gmail.com>) escribió:
> >> > >
> >> > >> Hi Carlos,
> >> > >>
> >> > >> I'm looking into Validator, cause I have started using it more. I
> did
> >> > port
> >> > >> EmailValidator from Flex to Jewel in my application but I'm not
> sure
> >> > >> whether it is actually require here - If yes I can commit it.
> >> > >>
> >> > >> However I would like to ask why actually inside validator class
> when
> >> you
> >> > >> setup such properties like trigger/triggerEvent you are using
> private
> >> > >> fields instead of a public one ? Here is the crucial example [1]
> >> > >>
> >> > >> Setting that to private field causes code duplication, cause in
> >> > >> StringValidation you are registering to the triggerEvent [2], which
> >> > >> actually would be done in trigger [3] property of Validator class.
> >> > >>
> >> > >> Is there any reason to do not user public properties by you ? I
> would
> >> > love
> >> > >> to change that.
> >> > >>
> >> > >> [1]
> >> > >>
> >> > >>
> >> >
> >>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> >> > >> [2]
> >> > >>
> >> > >>
> >> >
> >>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> >> > >> [3]
> >> > >>
> >> > >>
> >> >
> >>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
> >> > >>
> >> > >> Thanks,
> >> > >> --
> >> > >>
> >> > >> Piotr Zarzycki
> >> > >>
> >> > >> Patreon: *https://www.patreon.com/piotrzarzycki
> >> > >> <https://www.patreon.com/piotrzarzycki>*
> >> > >>
> >> > >
> >> > >
> >> > > --
> >> > > Carlos Rovira
> >> > > http://about.me/carlosrovira
> >> > >
> >> > >
> >> >
> >> > --
> >> > Carlos Rovira
> >> > http://about.me/carlosrovira
> >> >
> >>
> >>
> >> --
> >>
> >> Piotr Zarzycki
> >>
> >> Patreon: *https://www.patreon.com/piotrzarzycki
> >> <https://www.patreon.com/piotrzarzycki>*
> >>
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
> >
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Carlos Rovira <ca...@apache.org>.
Hi Piotr,

I just see a problem with Jewel FormValidator that just uploaded that was
causing trigger CHANGE event as we move between controls in a Form.

Rest of problems was the need to update all our custom validators to the
new code (we have many).
So I think all is ok now.

This change make we save several lines of code in most classes since we can
remove strand function override from almost all code.

Thanks for rise this problem and fix it! :)

Carlos





El dom., 21 abr. 2019 a las 9:54, Carlos Rovira (<ca...@apache.org>)
escribió:

> Thanks Piotr,
> going to try it now and report if I see some issue.
>
> El sáb., 20 abr. 2019 a las 17:56, Piotr Zarzycki (<
> piotrzarzycki21@gmail.com>) escribió:
>
>> Carlos,
>>
>> I have pushed fix. It's working with Tour De Jewel. Test with your app
>> whether everything is working in case of validation for you.
>>
>> Thanks,
>> Piotr
>>
>> sob., 20 kwi 2019 o 00:35 Carlos Rovira <ca...@apache.org>
>> napisał(a):
>>
>> > Hi Piotr,
>> >
>> > just committed. Please, take a look.
>> > About your questions, yes I think we have there a problem, so go ahead
>> and
>> > please fix it. Thanks for discovering that bug.
>> >
>> > Carlos
>> >
>> >
>> > El sáb., 20 abr. 2019 a las 0:25, Carlos Rovira (<
>> carlosrovira@apache.org
>> > >)
>> > escribió:
>> >
>> > > Hi Piotr,
>> > >
>> > > sorry, I have this in my real project and forgot to transfer to
>> Royale,
>> > > will do now, so you can have it and check it you see there's something
>> > Greg
>> > > or I forgot.
>> > >
>> > > thanks
>> > >
>> > > El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
>> > > piotrzarzycki21@gmail.com>) escribió:
>> > >
>> > >> Hi Carlos,
>> > >>
>> > >> I'm looking into Validator, cause I have started using it more. I did
>> > port
>> > >> EmailValidator from Flex to Jewel in my application but I'm not sure
>> > >> whether it is actually require here - If yes I can commit it.
>> > >>
>> > >> However I would like to ask why actually inside validator class when
>> you
>> > >> setup such properties like trigger/triggerEvent you are using private
>> > >> fields instead of a public one ? Here is the crucial example [1]
>> > >>
>> > >> Setting that to private field causes code duplication, cause in
>> > >> StringValidation you are registering to the triggerEvent [2], which
>> > >> actually would be done in trigger [3] property of Validator class.
>> > >>
>> > >> Is there any reason to do not user public properties by you ? I would
>> > love
>> > >> to change that.
>> > >>
>> > >> [1]
>> > >>
>> > >>
>> >
>> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
>> > >> [2]
>> > >>
>> > >>
>> >
>> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
>> > >> [3]
>> > >>
>> > >>
>> >
>> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
>> > >>
>> > >> Thanks,
>> > >> --
>> > >>
>> > >> Piotr Zarzycki
>> > >>
>> > >> Patreon: *https://www.patreon.com/piotrzarzycki
>> > >> <https://www.patreon.com/piotrzarzycki>*
>> > >>
>> > >
>> > >
>> > > --
>> > > Carlos Rovira
>> > > http://about.me/carlosrovira
>> > >
>> > >
>> >
>> > --
>> > Carlos Rovira
>> > http://about.me/carlosrovira
>> >
>>
>>
>> --
>>
>> Piotr Zarzycki
>>
>> Patreon: *https://www.patreon.com/piotrzarzycki
>> <https://www.patreon.com/piotrzarzycki>*
>>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Carlos Rovira <ca...@apache.org>.
Thanks Piotr,
going to try it now and report if I see some issue.

El sáb., 20 abr. 2019 a las 17:56, Piotr Zarzycki (<
piotrzarzycki21@gmail.com>) escribió:

> Carlos,
>
> I have pushed fix. It's working with Tour De Jewel. Test with your app
> whether everything is working in case of validation for you.
>
> Thanks,
> Piotr
>
> sob., 20 kwi 2019 o 00:35 Carlos Rovira <ca...@apache.org>
> napisał(a):
>
> > Hi Piotr,
> >
> > just committed. Please, take a look.
> > About your questions, yes I think we have there a problem, so go ahead
> and
> > please fix it. Thanks for discovering that bug.
> >
> > Carlos
> >
> >
> > El sáb., 20 abr. 2019 a las 0:25, Carlos Rovira (<
> carlosrovira@apache.org
> > >)
> > escribió:
> >
> > > Hi Piotr,
> > >
> > > sorry, I have this in my real project and forgot to transfer to Royale,
> > > will do now, so you can have it and check it you see there's something
> > Greg
> > > or I forgot.
> > >
> > > thanks
> > >
> > > El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> > > piotrzarzycki21@gmail.com>) escribió:
> > >
> > >> Hi Carlos,
> > >>
> > >> I'm looking into Validator, cause I have started using it more. I did
> > port
> > >> EmailValidator from Flex to Jewel in my application but I'm not sure
> > >> whether it is actually require here - If yes I can commit it.
> > >>
> > >> However I would like to ask why actually inside validator class when
> you
> > >> setup such properties like trigger/triggerEvent you are using private
> > >> fields instead of a public one ? Here is the crucial example [1]
> > >>
> > >> Setting that to private field causes code duplication, cause in
> > >> StringValidation you are registering to the triggerEvent [2], which
> > >> actually would be done in trigger [3] property of Validator class.
> > >>
> > >> Is there any reason to do not user public properties by you ? I would
> > love
> > >> to change that.
> > >>
> > >> [1]
> > >>
> > >>
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> > >> [2]
> > >>
> > >>
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> > >> [3]
> > >>
> > >>
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
> > >>
> > >> Thanks,
> > >> --
> > >>
> > >> Piotr Zarzycki
> > >>
> > >> Patreon: *https://www.patreon.com/piotrzarzycki
> > >> <https://www.patreon.com/piotrzarzycki>*
> > >>
> > >
> > >
> > > --
> > > Carlos Rovira
> > > http://about.me/carlosrovira
> > >
> > >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> <https://www.patreon.com/piotrzarzycki>*
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Piotr Zarzycki <pi...@gmail.com>.
Carlos,

I have pushed fix. It's working with Tour De Jewel. Test with your app
whether everything is working in case of validation for you.

Thanks,
Piotr

sob., 20 kwi 2019 o 00:35 Carlos Rovira <ca...@apache.org>
napisał(a):

> Hi Piotr,
>
> just committed. Please, take a look.
> About your questions, yes I think we have there a problem, so go ahead and
> please fix it. Thanks for discovering that bug.
>
> Carlos
>
>
> El sáb., 20 abr. 2019 a las 0:25, Carlos Rovira (<carlosrovira@apache.org
> >)
> escribió:
>
> > Hi Piotr,
> >
> > sorry, I have this in my real project and forgot to transfer to Royale,
> > will do now, so you can have it and check it you see there's something
> Greg
> > or I forgot.
> >
> > thanks
> >
> > El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> > piotrzarzycki21@gmail.com>) escribió:
> >
> >> Hi Carlos,
> >>
> >> I'm looking into Validator, cause I have started using it more. I did
> port
> >> EmailValidator from Flex to Jewel in my application but I'm not sure
> >> whether it is actually require here - If yes I can commit it.
> >>
> >> However I would like to ask why actually inside validator class when you
> >> setup such properties like trigger/triggerEvent you are using private
> >> fields instead of a public one ? Here is the crucial example [1]
> >>
> >> Setting that to private field causes code duplication, cause in
> >> StringValidation you are registering to the triggerEvent [2], which
> >> actually would be done in trigger [3] property of Validator class.
> >>
> >> Is there any reason to do not user public properties by you ? I would
> love
> >> to change that.
> >>
> >> [1]
> >>
> >>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> >> [2]
> >>
> >>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> >> [3]
> >>
> >>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
> >>
> >> Thanks,
> >> --
> >>
> >> Piotr Zarzycki
> >>
> >> Patreon: *https://www.patreon.com/piotrzarzycki
> >> <https://www.patreon.com/piotrzarzycki>*
> >>
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
> >
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Carlos Rovira <ca...@apache.org>.
Hi Piotr,

just committed. Please, take a look.
About your questions, yes I think we have there a problem, so go ahead and
please fix it. Thanks for discovering that bug.

Carlos


El sáb., 20 abr. 2019 a las 0:25, Carlos Rovira (<ca...@apache.org>)
escribió:

> Hi Piotr,
>
> sorry, I have this in my real project and forgot to transfer to Royale,
> will do now, so you can have it and check it you see there's something Greg
> or I forgot.
>
> thanks
>
> El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> piotrzarzycki21@gmail.com>) escribió:
>
>> Hi Carlos,
>>
>> I'm looking into Validator, cause I have started using it more. I did port
>> EmailValidator from Flex to Jewel in my application but I'm not sure
>> whether it is actually require here - If yes I can commit it.
>>
>> However I would like to ask why actually inside validator class when you
>> setup such properties like trigger/triggerEvent you are using private
>> fields instead of a public one ? Here is the crucial example [1]
>>
>> Setting that to private field causes code duplication, cause in
>> StringValidation you are registering to the triggerEvent [2], which
>> actually would be done in trigger [3] property of Validator class.
>>
>> Is there any reason to do not user public properties by you ? I would love
>> to change that.
>>
>> [1]
>>
>> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
>> [2]
>>
>> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
>> [3]
>>
>> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
>>
>> Thanks,
>> --
>>
>> Piotr Zarzycki
>>
>> Patreon: *https://www.patreon.com/piotrzarzycki
>> <https://www.patreon.com/piotrzarzycki>*
>>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Jewel EmailValidator

Posted by Piotr Zarzycki <pi...@gmail.com>.
Ok. Thanks for explanation!

On Sat, Apr 20, 2019, 10:08 AM Carlos Rovira <ca...@apache.org>
wrote:

> Hi Piotr,
>
> I think the way Taro introduced that function was to give possibility of
> change the algorithm when we want.
> So for subclasses I think has more sense to override, and for uses of the
> class has more sense to assign an external function.
> IOW, having the original validation function in a specialized class makes
> no sense to me, overriding and specializing seems more direct to the
> current case.
>
> Hope this make more sense now.
>
> Thanks
>
> Carlos
>
>
>
> El sáb., 20 abr. 2019 a las 0:58, Piotr Zarzycki (<
> piotrzarzycki21@gmail.com>)
> escribió:
>
> > Hi Carlos,
> >
> > Cool. I see that your implementation has one main difference. I used
> > validateFunction to run validation instead overriding anything.
> > This was for me the most obvious way, but seeing your implementation I'm
> > wondering - did I understand wrong the meaning of validateFunction? Look
> > into constructor of my class [1].
> >
> > The rest of the code is pretty similar.
> >
> > [1] https://paste.apache.org/x9kk
> >
> > Thanks,
> > Piotr
> >
> > On Sat, Apr 20, 2019, 12:25 AM Carlos Rovira <ca...@apache.org>
> > wrote:
> >
> > > Hi Piotr,
> > >
> > > sorry, I have this in my real project and forgot to transfer to Royale,
> > > will do now, so you can have it and check it you see there's something
> > Greg
> > > or I forgot.
> > >
> > > thanks
> > >
> > > El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> > > piotrzarzycki21@gmail.com>) escribió:
> > >
> > > > Hi Carlos,
> > > >
> > > > I'm looking into Validator, cause I have started using it more. I did
> > > port
> > > > EmailValidator from Flex to Jewel in my application but I'm not sure
> > > > whether it is actually require here - If yes I can commit it.
> > > >
> > > > However I would like to ask why actually inside validator class when
> > you
> > > > setup such properties like trigger/triggerEvent you are using private
> > > > fields instead of a public one ? Here is the crucial example [1]
> > > >
> > > > Setting that to private field causes code duplication, cause in
> > > > StringValidation you are registering to the triggerEvent [2], which
> > > > actually would be done in trigger [3] property of Validator class.
> > > >
> > > > Is there any reason to do not user public properties by you ? I would
> > > love
> > > > to change that.
> > > >
> > > > [1]
> > > >
> > > >
> > >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> > > > [2]
> > > >
> > > >
> > >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> > > > [3]
> > > >
> > > >
> > >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
> > > >
> > > > Thanks,
> > > > --
> > > >
> > > > Piotr Zarzycki
> > > >
> > > > Patreon: *https://www.patreon.com/piotrzarzycki
> > > > <https://www.patreon.com/piotrzarzycki>*
> > > >
> > >
> > >
> > > --
> > > Carlos Rovira
> > > http://about.me/carlosrovira
> > >
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>

Re: Jewel EmailValidator

Posted by Carlos Rovira <ca...@apache.org>.
Hi Piotr,

I think the way Taro introduced that function was to give possibility of
change the algorithm when we want.
So for subclasses I think has more sense to override, and for uses of the
class has more sense to assign an external function.
IOW, having the original validation function in a specialized class makes
no sense to me, overriding and specializing seems more direct to the
current case.

Hope this make more sense now.

Thanks

Carlos



El sáb., 20 abr. 2019 a las 0:58, Piotr Zarzycki (<pi...@gmail.com>)
escribió:

> Hi Carlos,
>
> Cool. I see that your implementation has one main difference. I used
> validateFunction to run validation instead overriding anything.
> This was for me the most obvious way, but seeing your implementation I'm
> wondering - did I understand wrong the meaning of validateFunction? Look
> into constructor of my class [1].
>
> The rest of the code is pretty similar.
>
> [1] https://paste.apache.org/x9kk
>
> Thanks,
> Piotr
>
> On Sat, Apr 20, 2019, 12:25 AM Carlos Rovira <ca...@apache.org>
> wrote:
>
> > Hi Piotr,
> >
> > sorry, I have this in my real project and forgot to transfer to Royale,
> > will do now, so you can have it and check it you see there's something
> Greg
> > or I forgot.
> >
> > thanks
> >
> > El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> > piotrzarzycki21@gmail.com>) escribió:
> >
> > > Hi Carlos,
> > >
> > > I'm looking into Validator, cause I have started using it more. I did
> > port
> > > EmailValidator from Flex to Jewel in my application but I'm not sure
> > > whether it is actually require here - If yes I can commit it.
> > >
> > > However I would like to ask why actually inside validator class when
> you
> > > setup such properties like trigger/triggerEvent you are using private
> > > fields instead of a public one ? Here is the crucial example [1]
> > >
> > > Setting that to private field causes code duplication, cause in
> > > StringValidation you are registering to the triggerEvent [2], which
> > > actually would be done in trigger [3] property of Validator class.
> > >
> > > Is there any reason to do not user public properties by you ? I would
> > love
> > > to change that.
> > >
> > > [1]
> > >
> > >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> > > [2]
> > >
> > >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> > > [3]
> > >
> > >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
> > >
> > > Thanks,
> > > --
> > >
> > > Piotr Zarzycki
> > >
> > > Patreon: *https://www.patreon.com/piotrzarzycki
> > > <https://www.patreon.com/piotrzarzycki>*
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Jewel EmailValidator

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Carlos,

Cool. I see that your implementation has one main difference. I used
validateFunction to run validation instead overriding anything.
This was for me the most obvious way, but seeing your implementation I'm
wondering - did I understand wrong the meaning of validateFunction? Look
into constructor of my class [1].

The rest of the code is pretty similar.

[1] https://paste.apache.org/x9kk

Thanks,
Piotr

On Sat, Apr 20, 2019, 12:25 AM Carlos Rovira <ca...@apache.org>
wrote:

> Hi Piotr,
>
> sorry, I have this in my real project and forgot to transfer to Royale,
> will do now, so you can have it and check it you see there's something Greg
> or I forgot.
>
> thanks
>
> El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
> piotrzarzycki21@gmail.com>) escribió:
>
> > Hi Carlos,
> >
> > I'm looking into Validator, cause I have started using it more. I did
> port
> > EmailValidator from Flex to Jewel in my application but I'm not sure
> > whether it is actually require here - If yes I can commit it.
> >
> > However I would like to ask why actually inside validator class when you
> > setup such properties like trigger/triggerEvent you are using private
> > fields instead of a public one ? Here is the crucial example [1]
> >
> > Setting that to private field causes code duplication, cause in
> > StringValidation you are registering to the triggerEvent [2], which
> > actually would be done in trigger [3] property of Validator class.
> >
> > Is there any reason to do not user public properties by you ? I would
> love
> > to change that.
> >
> > [1]
> >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> > [2]
> >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> > [3]
> >
> >
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
> >
> > Thanks,
> > --
> >
> > Piotr Zarzycki
> >
> > Patreon: *https://www.patreon.com/piotrzarzycki
> > <https://www.patreon.com/piotrzarzycki>*
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>

Re: Jewel Validator and usage of public properties trigger/triggerEvent

Posted by Carlos Rovira <ca...@apache.org>.
Hi Piotr,

sorry, I have this in my real project and forgot to transfer to Royale,
will do now, so you can have it and check it you see there's something Greg
or I forgot.

thanks

El vie., 19 abr. 2019 a las 15:43, Piotr Zarzycki (<
piotrzarzycki21@gmail.com>) escribió:

> Hi Carlos,
>
> I'm looking into Validator, cause I have started using it more. I did port
> EmailValidator from Flex to Jewel in my application but I'm not sure
> whether it is actually require here - If yes I can commit it.
>
> However I would like to ask why actually inside validator class when you
> setup such properties like trigger/triggerEvent you are using private
> fields instead of a public one ? Here is the crucial example [1]
>
> Setting that to private field causes code duplication, cause in
> StringValidation you are registering to the triggerEvent [2], which
> actually would be done in trigger [3] property of Validator class.
>
> Is there any reason to do not user public properties by you ? I would love
> to change that.
>
> [1]
>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L166
> [2]
>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/StringValidator.as#L72
> [3]
>
> https://github.com/apache/royale-asjs/blob/8677a93c28ef5ff85123071b484429b8b17cd3ad/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/validators/Validator.as#L116
>
> Thanks,
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> <https://www.patreon.com/piotrzarzycki>*
>


-- 
Carlos Rovira
http://about.me/carlosrovira