You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by martin-g <gi...@git.apache.org> on 2016/08/17 08:40:16 UTC

[GitHub] wicket issue #177: Expensive validator wicket 7.x

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.
---

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.
> ---