Hi, I want to call a javascript function ( myFunction() ) on a component's
onclick event.

I tried this:


but then i realized that my wicket's onClick() method is overwriting the
above html one.

------
        AjaxLink agentLink = new AjaxLink("myLink") {

                public void onClick(AjaxRequestTarget target) {                 
                        
                        /* Some Code */
                }
        };
-----

So then i tried this:

------
        AjaxLink agentLink = new AjaxLink("myLink") {

                public void onClick(AjaxRequestTarget target) {
                        target.appendJavascript("alert('hi from wicket');");    
                                        
                        /* Some Code */
                }
        };
-----


But i don't see the alert when i click the link, can someone help me out?
-- 
View this message in context: 
http://www.nabble.com/calling-javascript-function-on-wicket-component%27s-onclick-tp14730927p14730927.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to