"value that is placed in the onClick event (which has the action for the
link or button that has the behavior placed on)"
You has an parameter determining the action to be take, why don't you use
polimorfism?

"My behavior just adds a function call before any other action and I want
this function call to resume the wicket action"
You has an behavior common to onClick of a link or onSubmit of a button. Do
you consider to use inheritance instead of composition in this especific
case because:

"I want this function call to resume the wicket action"

public class CustomLink/CustomButton extends Link/Button{
    @override
     onClick or onSubmit(){
        callFunctionBeforeAnyOtherAction();
        callAction();
    }
    protected abstrat void callAction();
}



On Thu, Sep 3, 2009 at 8:42 AM, Arie Fishler <arie....@gmail.com> wrote:

> The behvavior is not AbstractDefaultAjaxBehavior just one extending
> AbstractBehavior.
>
> Can I get it somehow from the onComponentTag of the behavior? I actually
> need the value that is placed in the onClick event (which has the action
> for
> the link or button that has the behavior placed on)
>
> My behavior just adds a function call before any other action and I want
> this function call to resume the wicket action (ajax click on a link or
> submit of a button) right after the function of the behavior is executed
>
> On Thu, Sep 3, 2009 at 2:09 PM, Pedro Santos <pedros...@gmail.com> wrote:
>
> > To one of the decorations script must to be appended the script
> responsible
> > to call the behavior. You can get it invoking the
> > AbstractDefaultAjaxBehavior.getCallbackScript() protected method.
> >
> > On Thu, Sep 3, 2009 at 7:59 AM, Arie Fishler <arie....@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > We have been implementing the getAjaxCallDecorator for links that
> > > extends AjaxLink
> > > in order to manipulate the way the wicket-ajax is called on these
> links.
> > >
> > > I have a need to do something similar with a behavior and not sure how
> to
> > > implement.
> > >
> > > I have a behavior that is applied (added) to different links. This
> > behavior
> > > needs to manipulate and control when the actual wicket-ajax call is
> > > executed
> > > for the link it is on.
> > >
> > > It is like the behavior needs an access to the function call that
> > activates
> > > the ajax on the link. Is there a way for a behavior to get it?
> > >
> > > Cheers,
> > > Arie
> > >
> >
>

Reply via email to