You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Nazaret Kazarian (JIRA)" <ji...@apache.org> on 2011/06/03 12:33:47 UTC
[jira] [Created] (WICKET-3768) findSubmittingButton causes
StackOverflowError when called from Form.isEnabled
findSubmittingButton causes StackOverflowError when called from Form.isEnabled
------------------------------------------------------------------------------
Key: WICKET-3768
URL: https://issues.apache.org/jira/browse/WICKET-3768
Project: Wicket
Issue Type: Bug
Affects Versions: 1.4.17
Reporter: Nazaret Kazarian
Priority: Critical
Reference: https://cwiki.apache.org/WICKET/conditional-validation.html
Section about isolating nested forms.
The above documentation suggests that to isolate a nested form from its enclosing form we may override isEnabled( ) on the inner form. However, when the inner form is submitted with the inner submit, the isEnabled( ) call causes an infinite loop, because after finding the submitting component (the button) it executes some validations. Specifically it checks whether the submitting component is enabled in the hierarchy. This causes the parent component's (form) isEnabled( ) to be called which goes into the infinite recursive call.
The offending code is the following in the org.apache.wicket.markup.html.form.Form class (line 603):
if (!component.isEnabledInHierarchy())
{
throw new WicketRuntimeException("Submit Button " +
submittingComponent.getInputName() + " (path=" +
component.getPageRelativePath() + ") is not enabled");
}
Am I missing something? If it's a bug, is it safe to remove this validation?
Thanks in advance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-3768) findSubmittingButton causes
StackOverflowError when called from Form.isEnabled
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov updated WICKET-3768:
------------------------------------
Priority: Major (was: Critical)
> findSubmittingButton causes StackOverflowError when called from Form.isEnabled
> ------------------------------------------------------------------------------
>
> Key: WICKET-3768
> URL: https://issues.apache.org/jira/browse/WICKET-3768
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.4.17
> Reporter: Nazaret Kazarian
> Attachments: findSubmittingButton-demo.rar
>
>
> Reference: https://cwiki.apache.org/WICKET/conditional-validation.html
> Section about isolating nested forms.
> The above documentation suggests that to isolate a nested form from its enclosing form we may override isEnabled( ) on the inner form. However, when the inner form is submitted with the inner submit, the isEnabled( ) call causes an infinite loop, because after finding the submitting component (the button) it executes some validations. Specifically it checks whether the submitting component is enabled in the hierarchy. This causes the parent component's (form) isEnabled( ) to be called which goes into the infinite recursive call.
> The offending code is the following in the org.apache.wicket.markup.html.form.Form class (line 603):
> if (!component.isEnabledInHierarchy())
> {
> throw new WicketRuntimeException("Submit Button " +
> submittingComponent.getInputName() + " (path=" +
> component.getPageRelativePath() + ") is not enabled");
> }
> Am I missing something? If it's a bug, is it safe to remove this validation?
> Thanks in advance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-3768) findSubmittingButton causes
StackOverflowError when called from Form.isEnabled
Posted by "Nazaret Kazarian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nazaret Kazarian updated WICKET-3768:
-------------------------------------
Attachment: findSubmittingButton-demo.rar
Quickstart reproducing the problem. Just press inner submit.
> findSubmittingButton causes StackOverflowError when called from Form.isEnabled
> ------------------------------------------------------------------------------
>
> Key: WICKET-3768
> URL: https://issues.apache.org/jira/browse/WICKET-3768
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.4.17
> Reporter: Nazaret Kazarian
> Priority: Critical
> Attachments: findSubmittingButton-demo.rar
>
>
> Reference: https://cwiki.apache.org/WICKET/conditional-validation.html
> Section about isolating nested forms.
> The above documentation suggests that to isolate a nested form from its enclosing form we may override isEnabled( ) on the inner form. However, when the inner form is submitted with the inner submit, the isEnabled( ) call causes an infinite loop, because after finding the submitting component (the button) it executes some validations. Specifically it checks whether the submitting component is enabled in the hierarchy. This causes the parent component's (form) isEnabled( ) to be called which goes into the infinite recursive call.
> The offending code is the following in the org.apache.wicket.markup.html.form.Form class (line 603):
> if (!component.isEnabledInHierarchy())
> {
> throw new WicketRuntimeException("Submit Button " +
> submittingComponent.getInputName() + " (path=" +
> component.getPageRelativePath() + ") is not enabled");
> }
> Am I missing something? If it's a bug, is it safe to remove this validation?
> Thanks in advance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3768) findSubmittingButton causes
StackOverflowError when called from Form.isEnabled
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044563#comment-13044563 ]
Igor Vaynberg commented on WICKET-3768:
---------------------------------------
moving to onconfigure() wont work, he wants it to be different between render and processing, onconfigure() is there for the opposite reason - to make that value stable across that boundary.
> findSubmittingButton causes StackOverflowError when called from Form.isEnabled
> ------------------------------------------------------------------------------
>
> Key: WICKET-3768
> URL: https://issues.apache.org/jira/browse/WICKET-3768
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.4.17
> Reporter: Nazaret Kazarian
> Assignee: Igor Vaynberg
> Attachments: findSubmittingButton-demo.rar
>
>
> Reference: https://cwiki.apache.org/WICKET/conditional-validation.html
> Section about isolating nested forms.
> The above documentation suggests that to isolate a nested form from its enclosing form we may override isEnabled( ) on the inner form. However, when the inner form is submitted with the inner submit, the isEnabled( ) call causes an infinite loop, because after finding the submitting component (the button) it executes some validations. Specifically it checks whether the submitting component is enabled in the hierarchy. This causes the parent component's (form) isEnabled( ) to be called which goes into the infinite recursive call.
> The offending code is the following in the org.apache.wicket.markup.html.form.Form class (line 603):
> if (!component.isEnabledInHierarchy())
> {
> throw new WicketRuntimeException("Submit Button " +
> submittingComponent.getInputName() + " (path=" +
> component.getPageRelativePath() + ") is not enabled");
> }
> Am I missing something? If it's a bug, is it safe to remove this validation?
> Thanks in advance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3768) findSubmittingButton causes
StackOverflowError when called from Form.isEnabled
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044555#comment-13044555 ]
Martin Grigorov commented on WICKET-3768:
-----------------------------------------
You can move your logic from isEnabled() to onConfigure().
> findSubmittingButton causes StackOverflowError when called from Form.isEnabled
> ------------------------------------------------------------------------------
>
> Key: WICKET-3768
> URL: https://issues.apache.org/jira/browse/WICKET-3768
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.4.17
> Reporter: Nazaret Kazarian
> Attachments: findSubmittingButton-demo.rar
>
>
> Reference: https://cwiki.apache.org/WICKET/conditional-validation.html
> Section about isolating nested forms.
> The above documentation suggests that to isolate a nested form from its enclosing form we may override isEnabled( ) on the inner form. However, when the inner form is submitted with the inner submit, the isEnabled( ) call causes an infinite loop, because after finding the submitting component (the button) it executes some validations. Specifically it checks whether the submitting component is enabled in the hierarchy. This causes the parent component's (form) isEnabled( ) to be called which goes into the infinite recursive call.
> The offending code is the following in the org.apache.wicket.markup.html.form.Form class (line 603):
> if (!component.isEnabledInHierarchy())
> {
> throw new WicketRuntimeException("Submit Button " +
> submittingComponent.getInputName() + " (path=" +
> component.getPageRelativePath() + ") is not enabled");
> }
> Am I missing something? If it's a bug, is it safe to remove this validation?
> Thanks in advance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WICKET-3768) findSubmittingButton causes
StackOverflowError when called from Form.isEnabled
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-3768.
-----------------------------------
Resolution: Won't Fix
Assignee: Igor Vaynberg
the recommendation in the wiki is bad. it is bad form to make isenabled() change values between render and processing stages. use IFormVisitorParticipant as suggested later.
> findSubmittingButton causes StackOverflowError when called from Form.isEnabled
> ------------------------------------------------------------------------------
>
> Key: WICKET-3768
> URL: https://issues.apache.org/jira/browse/WICKET-3768
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.4.17
> Reporter: Nazaret Kazarian
> Assignee: Igor Vaynberg
> Attachments: findSubmittingButton-demo.rar
>
>
> Reference: https://cwiki.apache.org/WICKET/conditional-validation.html
> Section about isolating nested forms.
> The above documentation suggests that to isolate a nested form from its enclosing form we may override isEnabled( ) on the inner form. However, when the inner form is submitted with the inner submit, the isEnabled( ) call causes an infinite loop, because after finding the submitting component (the button) it executes some validations. Specifically it checks whether the submitting component is enabled in the hierarchy. This causes the parent component's (form) isEnabled( ) to be called which goes into the infinite recursive call.
> The offending code is the following in the org.apache.wicket.markup.html.form.Form class (line 603):
> if (!component.isEnabledInHierarchy())
> {
> throw new WicketRuntimeException("Submit Button " +
> submittingComponent.getInputName() + " (path=" +
> component.getPageRelativePath() + ") is not enabled");
> }
> Am I missing something? If it's a bug, is it safe to remove this validation?
> Thanks in advance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira