You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Lowery <sl...@gatessolutions.com> on 2012/08/30 16:55:12 UTC

AjaxRequestAttributes.setAllowDefault

We have a dropdown menu based component (based off of twitter bootstrap)
that needs to have the links' default allowed so the menu closes.  We can
create a subclass of AjaxLink that overrides the updateAjaxAttributes and
does this, but then developers have to know either to use that specialized
link or to override the updateAjaxAttributes in their link.  Is there a way
that the controlling componenent (the menu) can override the ajaxattributes
for its children links?  Currently, the updateAjaxAttributes method is
protected, so I'm not aware of a way.  Would it make sense to make this
method public and/or is there another way to accomplish this?

Re: AjaxRequestAttributes.setAllowDefault

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Making this method 'public' wont help because this method is called by
Wicket when rendering the Ajax component.
If you call it then you have to pass AjaxRequestAttributes created by
you and not used actually by Wicket.

It think it will be better if you use AjaxEventBehavior attached to
the dropdown, and extract the clicked item with dynamic extra
parameters. I.e. use JavaScript event delegation. This way your
component will be lighter too.

On Thu, Aug 30, 2012 at 4:55 PM, Steve Lowery
<sl...@gatessolutions.com> wrote:
> We have a dropdown menu based component (based off of twitter bootstrap)
> that needs to have the links' default allowed so the menu closes.  We can
> create a subclass of AjaxLink that overrides the updateAjaxAttributes and
> does this, but then developers have to know either to use that specialized
> link or to override the updateAjaxAttributes in their link.  Is there a way
> that the controlling componenent (the menu) can override the ajaxattributes
> for its children links?  Currently, the updateAjaxAttributes method is
> protected, so I'm not aware of a way.  Would it make sense to make this
> method public and/or is there another way to accomplish this?



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org