You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Johan Compagner <jc...@gmail.com> on 2007/01/29 14:52:13 UTC

DefaultRequestTargetResolverStrategy.resolveListenerInterfaceTarget method

Hi,

We do this in that method (last few lines)


            if (component == null || !component.isEnabled() ||
!component.isVisibleInHierarchy())
            {
                log
                        .info("component not enabled or visible, redirecting
to calling page, component: "
                                + component);
                return new RedirectPageRequestTarget(page);
            }
            if (!component.isEnableAllowed())
            {
                throw new UnauthorizedActionException(component,
Component.ENABLE);
            }

            // Ask the request listener interface object to create a request
            // target
            return listener.newRequestTarget(page, component, listener,
requestParameters);


especially the !component.isEnabled() part in the first if.
and what we do then when the component is not enabled.
Doing a redirect to the target page..

What if this is NOT a form submit or a link click?
What if it is a IResourceListener? (and maybe the same for a ajax request)
Then a redirect to that page shouldn't happen! And i think if it is a label
then i still want the iresource listener to happen
(Just like in swing then i can if i choose generate a disabled look of the
image i want to stream)

So i guess that if is much to general.. somebody has an idea about this?
You really only want to do that redirect to page when it is really also a
"page/action"  request

johan