what do you want to do when the button is clicked? invoke a listener or simply go to a page?
if go to a page just do: String pageurl=urlfor(MyPage.class); and pass that string to your js which can later do window.location=url; -igor On Nov 9, 2007 7:37 AM, dd du <[EMAIL PROTECTED]> wrote: > Hi, igor, thanks for your response, I am not sure I understand what you > mean, can you make it a little bit more specific or direct me to example or > where to start to look at it? I am thinking to pass an url to javascript, > when a button created from javascript is clicked, then direct it to the url, > which points to a page generated in wicket, but this is not a short-cut way, > also I am trying to download wicket source code to see how AjaxLink class is > implemented since when an ajax link is clicked, the > onClick(AjaxRequestTarget) method is called, maybe I can borrow some ideas > there, but the wicket site has no source code to download, the release zip > file does not contain the source code for wicket, only source code for the > examples, any way to get the wicket open source code? > > Thanks > > > > On 11/9/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > there is no magic here. look at how Link#getURL() works - it generates > > a url that invokes onLinkClicked on that Link component. you can use > > much the same mechanism and pass that url to your javascript. > > > > -igor > > > > > > On Nov 8, 2007 8:22 PM, dd du <[EMAIL PROTECTED]> wrote: > > > Hi, all, > > > I am new to wicket, I have a question about calling javascript from > > wicket, > > > suppose I create a page from wicket, from this page I click a button, > > which > > > wicket will call a javascript function, this function will create a > > dialog > > > window with fancy GUI controls, from these controls, if I click one of > > them, > > > an event handler from that javascript file will be called, inside this > > > handler, I need to call back to a wicket java method to handle business > > > logic, now how can I do that? I know if wicket creates all the GUI > > controls, > > > wicket can handle the events easily, but I want javascript to create > > them > > > since it deals with fancy style sheets. > > > > > > Is there a way wicket can handle events generated from javascript > > created > > > buttons? or a way calling back to wicket java code from javascript code? > > > > > > Thanks > > > > > > David > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]