lodhur wrote:
> That what I need is a javascript function which contains
> the correct call of my window
> (similar to the "onlick"-content of the wicket generated link).
You /really/ need to learn how to work things out for yourself. Allow me
to lead you through such a process.
So, you want something similar to onclick in an AjaxLink...
Let's see, it's similar to AjaxLink...
Oh, I know... Why don't we go and see how AjaxLink works?
<pushes CTRL+SHIFT+T in Eclipse, types AjaxLink, pushes enter>
Hmmm, that looks pretty compact and simple. Oh, look; all the work is
done in the constructor, where we add something called an
"AjaxEventBehavior" for the "onclick" javascript event.
It looks like onClick() for the AjaxLink is called by the onEvent()
function in that behavior. Hmmm... I wonder how that works?
<ctrl+clicks on AjaxEventBehavior>
Oh, look, in onComponentTag() we put an attribute into the HTML tag. The
name is pulled from the "event" variable (so "onclick" for the AjaxLink)
and the value of the attribute is the return value from getEventHandler().
I wonder where getEventHandler() comes from and what it does?
<goes and looks>
Ah, it just calls getCallbackScript().
That's not in this class - it must be in the super class.
<goes and looks>
Oh, yes, look - it's in AbstractDefaultAjaxBehavior. Maybe I can just
use that?
AbstractDefaultAjaxBehavior behavior = new AbstractDefaultAjaxBehavior() {
protected void respond(AjaxRequestTarget target) {
// Do stuff here.
}
};
Then in my Javascript for the page I can just invoke the JavaScript
generated by behavior.getCallbackScript();
Yes, mmm, that seems to work.
That wasn't so hard to work out, now, was it?
Regards,
Al
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]