You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by amichalowski <gi...@git.apache.org> on 2016/08/16 22:13:55 UTC
[GitHub] wicket pull request #177: Expensive validator wicket 7.x
GitHub user amichalowski opened a pull request:
https://github.com/apache/wicket/pull/177
Expensive validator wicket 7.x
We need to call database stored procedure in validator.
It is quite expensive and it shouldn't be called after every key press.
I would like to propose a little validation improvement.
Similar pull request but different branch:
[https://github.com/apache/wicket/pull/176](https://github.com/apache/wicket/pull/176)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/amichalowski/wicket expensive-validator-wicket-7.x
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/177.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #177
----
commit b359050e614967d983e7cef18b6cc8ddf93fa366
Author: Artur Micha\u0142owski <am...@gmail.com>
Date: 2016-08-16T21:18:20Z
Expensive validators
commit d9d5658285bb9f25b3ab2a25e38b23d0f6846c8c
Author: Artur Micha\u0142owski <am...@gmail.com>
Date: 2016-08-16T21:40:00Z
organize imports
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request #177: Expensive validator wicket 7.x
Posted by amichalowski <gi...@git.apache.org>.
Github user amichalowski closed the pull request at:
https://github.com/apache/wicket/pull/177
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
Re: [GitHub] wicket issue #177: Expensive validator wicket 7.x
Posted by Emond Papegaaij <em...@topicus.nl>.
Hi,
I agree. This is best implemented as part of the validator. You could for
example create a validator decorator that only forwards the calls to the
actual validator when expensive validation is required. This condition can
depend on many factors, but in your case, you could check if the current
request is Ajax. However, how do you differentiate between Ajax updates on
keypresses and a full Ajax form submit? It might be better to flag the
request(cycle) with metadata to prevent the expensive validation.
Best regards,
Emond
On woensdag 17 augustus 2016 08:40:16 CEST martin-g wrote:
> Github user martin-g commented on the issue:
>
> https://github.com/apache/wicket/pull/177
>
> Thank you for your contribution!
>
> I am not sure it is a good idea, though.
> With this change we will make all Ajax form component submits
> "non-expensive", i.e. a subset of validator will be used. I guess some
> applications will need to enable an expensive validator in some use case,
> so we will have to make it configurable. And it will become more complex
> than it needs to be.
>
> IMO it is simple enough to check whether the current request is Ajax one
> in the validator and decide what to do. One can even use request
> parameters/headers for even more flexibility.
>
> This is just my opinion! Let's see what others think too.
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
[GitHub] wicket issue #177: Expensive validator wicket 7.x
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:
https://github.com/apache/wicket/pull/177
Thank you for your contribution!
I am not sure it is a good idea, though.
With this change we will make all Ajax form component submits "non-expensive", i.e. a subset of validator will be used. I guess some applications will need to enable an expensive validator in some use case, so we will have to make it configurable. And it will become more complex than it needs to be.
IMO it is simple enough to check whether the current request is Ajax one in the validator and decide what to do. One can even use request parameters/headers for even more flexibility.
This is just my opinion! Let's see what others think too.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket issue #177: Expensive validator wicket 7.x
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:
https://github.com/apache/wicket/pull/177
Another Wicket developer commented in the dev@ mailing list: http://markmail.org/message/o3qsaetsloo73lwt
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket issue #177: Expensive validator wicket 7.x
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:
https://github.com/apache/wicket/pull/177
@amichalowski Please close this PR. We don't have permissions to close it ourselves. Thanks!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---