You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2012/05/11 10:23:50 UTC

[jira] [Commented] (WICKET-4551) Enable components underneath disabled components

    [ https://issues.apache.org/jira/browse/WICKET-4551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13273119#comment-13273119 ] 

Martin Grigorov commented on WICKET-4551:
-----------------------------------------

With normal Link it works, with AjaxLink - it doesn't.
The reason is in org.apache.wicket.ajax.AjaxEventBehavior#onComponentTag() which do not set the onclick attribute if the component is not enabled in the hierarchy.

Can be solved with:

diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBeh
index 2b78c3d..5f6db99 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
@@ -110,7 +110,7 @@ public abstract class AjaxEventBehavior extends AbstractDefaultAjaxBehavior
 
                // only add the event handler when the component is enabled.
                Component myComponent = getComponent();
-               if (myComponent.isEnabledInHierarchy())
+               if (myComponent.isEnabledInHierarchy() || canCallListenerInterface(myComponent, null))

                
> Enable components underneath disabled components
> ------------------------------------------------
>
>                 Key: WICKET-4551
>                 URL: https://issues.apache.org/jira/browse/WICKET-4551
>             Project: Wicket
>          Issue Type: Wish
>          Components: wicket
>            Reporter: J. Lind
>            Priority: Minor
>         Attachments: quickstart.zip
>
>
> I would like to force some child components to be enabled regardless of the state of the parent component. For example, I would like to have an ajax link within a form that is enabled allthough the form itself is disabled. A suggested solution to override org.apache.wicket.markup.html.link.AbstractLink#isLinkEnabled() and
> org.apache.wicket.Component#canCallListenerInterface(Method) did not work (see quickstart). Method Component#isEnabledInhierarchy might do the trick but is marked final.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira