Jewel Validator

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Jewel Validator

Taro.Yu
Hello

After study the JewelExample, and search the GitHub, I can't find Validator
like Flex (only some test
 items in mustella/tests)

So I try to write some validator beads for Jewel Components

Here is live demo
https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/
<https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/>  

<http://apache-royale-users.20374.n8.nabble.com/file/t55/Image1.png>

How do I contribute it to Apache ? Just create Pull Request ?
do I need to prepare some document to explain the Validators ?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Piotr Zarzycki
Hi Taro,

Many Many Thanks for that effort. Whatever you have the pull request is the best option, so go ahead and make it. We will review your code and provide any feedback.

Thanks,
Piotr

czw., 30 sie 2018 o 03:14 Taro.Yu <[hidden email]> napisał(a):
Hello

After study the JewelExample, and search the GitHub, I can't find Validator
like Flex (only some test
 items in mustella/tests)

So I try to write some validator beads for Jewel Components

Here is live demo
https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/
<https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/

<http://apache-royale-users.20374.n8.nabble.com/file/t55/Image1.png>

How do I contribute it to Apache ? Just create Pull Request ?
do I need to prepare some document to explain the Validators ?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Carlos Rovira-2
Hi Taro!
really great! :)

as Piotr said, I think the best way is to create a PR so we can take a look at the code.

As I comment various times in this list, I'll hope we can improve over the Flex Validators. Let me explain:

In Flex, Validation is attached to UI components and not to data to validate. Instead of that Granite Data Services, had validation through metadata 
I think that approach was better, since you can "check" data in the data object, and make UI components reflect if is valid of not in response.
But the validation could be done in a controller and not in the UI like in Flex validation. 

I'd like to have this implemented in Jewel. Could we work together on that front?

Thanks! and waiting to know about your thoughts! :)







El jue., 30 ago. 2018 a las 10:24, Piotr Zarzycki (<[hidden email]>) escribió:
Hi Taro,

Many Many Thanks for that effort. Whatever you have the pull request is the best option, so go ahead and make it. We will review your code and provide any feedback.

Thanks,
Piotr

czw., 30 sie 2018 o 03:14 Taro.Yu <[hidden email]> napisał(a):
Hello

After study the JewelExample, and search the GitHub, I can't find Validator
like Flex (only some test
 items in mustella/tests)

So I try to write some validator beads for Jewel Components

Here is live demo
https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/
<https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/

<http://apache-royale-users.20374.n8.nabble.com/file/t55/Image1.png>

How do I contribute it to Apache ? Just create Pull Request ?
do I need to prepare some document to explain the Validators ?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Carlos Rovira-2
Taro, 

another thing. Maybe you want to expose images in the example, since I see place holders, but there's no images
I fixed today in compiler and in examples pom.xml the copying of "assets" folder to js-release. So if you have assets folder with images now that should be now in your js-release folder in your next compilation then you can upload to your server so we can take a look to that explanatory images.

thanks! :)

Carlos

El jue., 30 ago. 2018 a las 12:01, Carlos Rovira (<[hidden email]>) escribió:
Hi Taro!
really great! :)

as Piotr said, I think the best way is to create a PR so we can take a look at the code.

As I comment various times in this list, I'll hope we can improve over the Flex Validators. Let me explain:

In Flex, Validation is attached to UI components and not to data to validate. Instead of that Granite Data Services, had validation through metadata 
I think that approach was better, since you can "check" data in the data object, and make UI components reflect if is valid of not in response.
But the validation could be done in a controller and not in the UI like in Flex validation. 

I'd like to have this implemented in Jewel. Could we work together on that front?

Thanks! and waiting to know about your thoughts! :)







El jue., 30 ago. 2018 a las 10:24, Piotr Zarzycki (<[hidden email]>) escribió:
Hi Taro,

Many Many Thanks for that effort. Whatever you have the pull request is the best option, so go ahead and make it. We will review your code and provide any feedback.

Thanks,
Piotr

czw., 30 sie 2018 o 03:14 Taro.Yu <[hidden email]> napisał(a):
Hello

After study the JewelExample, and search the GitHub, I can't find Validator
like Flex (only some test
 items in mustella/tests)

So I try to write some validator beads for Jewel Components

Here is live demo
https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/
<https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/

<http://apache-royale-users.20374.n8.nabble.com/file/t55/Image1.png>

How do I contribute it to Apache ? Just create Pull Request ?
do I need to prepare some document to explain the Validators ?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--


--
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Carlos Rovira-2
One more thing.

About Validation Metadata, I'm talking about something like this [1]

For example:

[Length(min="5", max="50", message="{validator.length}")]
public function get name():String {
return _name;
}

In this example "name" will be part of a ValueObject, so the data object gets the rest of definition about what values are valid. And I think an VO is the perfect place where this info and rules should go.

Then calling a validate method over the object should validate the annotated properties and report a "true" or "false" and that value should be used by UI components for visuals.

As well in a service controller and delegate you will check if is true or false in order to trigger a call to your backend with the data.

What do you think?


El jue., 30 ago. 2018 a las 12:26, Carlos Rovira (<[hidden email]>) escribió:
Taro, 

another thing. Maybe you want to expose images in the example, since I see place holders, but there's no images
I fixed today in compiler and in examples pom.xml the copying of "assets" folder to js-release. So if you have assets folder with images now that should be now in your js-release folder in your next compilation then you can upload to your server so we can take a look to that explanatory images.

thanks! :)

Carlos

El jue., 30 ago. 2018 a las 12:01, Carlos Rovira (<[hidden email]>) escribió:
Hi Taro!
really great! :)

as Piotr said, I think the best way is to create a PR so we can take a look at the code.

As I comment various times in this list, I'll hope we can improve over the Flex Validators. Let me explain:

In Flex, Validation is attached to UI components and not to data to validate. Instead of that Granite Data Services, had validation through metadata 
I think that approach was better, since you can "check" data in the data object, and make UI components reflect if is valid of not in response.
But the validation could be done in a controller and not in the UI like in Flex validation. 

I'd like to have this implemented in Jewel. Could we work together on that front?

Thanks! and waiting to know about your thoughts! :)







El jue., 30 ago. 2018 a las 10:24, Piotr Zarzycki (<[hidden email]>) escribió:
Hi Taro,

Many Many Thanks for that effort. Whatever you have the pull request is the best option, so go ahead and make it. We will review your code and provide any feedback.

Thanks,
Piotr

czw., 30 sie 2018 o 03:14 Taro.Yu <[hidden email]> napisał(a):
Hello

After study the JewelExample, and search the GitHub, I can't find Validator
like Flex (only some test
 items in mustella/tests)

So I try to write some validator beads for Jewel Components

Here is live demo
https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/
<https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/

<http://apache-royale-users.20374.n8.nabble.com/file/t55/Image1.png>

How do I contribute it to Apache ? Just create Pull Request ?
do I need to prepare some document to explain the Validators ?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--


--
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Taro.Yu
Hi Carlos

about images in the example but there's no images....
This is nothing to do with compiler, I am sure all images in js-release
folder.
I think it maybe web site's problem. so I change it to github page
here is new link <https://yestaro.github.io/>  

A few years ago, I have used Telerik ASP.NET MVC
https://docs.telerik.com/aspnet-mvc/getting-started/validation
<https://docs.telerik.com/aspnet-mvc/getting-started/validation>  

That is the same as you mentioned - Validation Metadata, right ?

Telerik also has Display Metadata, and DataGrid binding will use it as
header text.

I think it is cool if royale provide the features.





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Carlos Rovira-2
Hi Yu,

El jue., 30 ago. 2018 a las 17:03, Taro.Yu (<[hidden email]>) escribió:
Hi Carlos

about images in the example but there's no images....
This is nothing to do with compiler, I am sure all images in js-release
folder.
I think it maybe web site's problem. so I change it to github page
here is new link <https://yestaro.github.io/

Now I can see the code! :)
Thanks! I like your approach as a bead I think we can integrate your changes and maybe we'll only need to move to it's own library SWC (as Network, Binding...)
and package change.
 

A few years ago, I have used Telerik ASP.NET MVC
https://docs.telerik.com/aspnet-mvc/getting-started/validation
<https://docs.telerik.com/aspnet-mvc/getting-started/validation

That is the same as you mentioned - Validation Metadata, right ?

Right! 

Telerik also has Display Metadata, and DataGrid binding will use it as
header text.

Looks great :)
 
I think it is cool if royale provide the features.

Yes, I think we can integrate what you already have, and from that point see if we need Metadata or not.
Without too much analysis it seems Metadata still has some positive points like to annotate a data object or value object
in its own properties so that property has complete info.

So we can go from that point and see what's best

thanks! :)
 





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Piotr Zarzycki
Please make pull request to get a chance to see that code for everyone.

Thanks,
Piotr

On Fri, Aug 31, 2018, 1:53 AM Carlos Rovira <[hidden email]> wrote:
Hi Yu,

El jue., 30 ago. 2018 a las 17:03, Taro.Yu (<[hidden email]>) escribió:
Hi Carlos

about images in the example but there's no images....
This is nothing to do with compiler, I am sure all images in js-release
folder.
I think it maybe web site's problem. so I change it to github page
here is new link <https://yestaro.github.io/

Now I can see the code! :)
Thanks! I like your approach as a bead I think we can integrate your changes and maybe we'll only need to move to it's own library SWC (as Network, Binding...)
and package change.
 

A few years ago, I have used Telerik ASP.NET MVC
https://docs.telerik.com/aspnet-mvc/getting-started/validation
<https://docs.telerik.com/aspnet-mvc/getting-started/validation

That is the same as you mentioned - Validation Metadata, right ?

Right! 

Telerik also has Display Metadata, and DataGrid binding will use it as
header text.

Looks great :)
 
I think it is cool if royale provide the features.

Yes, I think we can integrate what you already have, and from that point see if we need Metadata or not.
Without too much analysis it seems Metadata still has some positive points like to annotate a data object or value object
in its own properties so that property has complete info.

So we can go from that point and see what's best

thanks! :)
Reply | Threaded
Open this post in threaded view
|

Re: Jewel Validator

Taro.Yu
Hi Piotr

I take some time to review my code and add comments of method,
PR created. thanks :)



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/