Yep. Though what is missing now, and which I added as a TODO some days ago, but will fix immediately now, is that the component path contains ':', which gives troubles with javascript. I propose to replace the ':' with '_' (the colons with underscores).
Eelco On 3/10/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > use an attribute modifier. > > you can get the component to print out its id by calling > Component.setOutputMarkupId(true). > then add an attribute modifier that adds javascript to the onclick event. > > -Igor > > > > On 3/10/06, Karl-Erik Rønsen <[EMAIL PROTECTED]> wrote: > > > > When attaching a javascript function event handler to some element in a > > static html page i would do this... > > > > document.getElementById( "myButton" ).onclick = function() { > > // do stuff > > } > > > > ... for some HTML like this ... > > > > <input type="button" id="myButton" value="Click me!" /> > > > > When creating a custom component with Panel, i cant attach event handlers > > this way when the component will be used multiple times in one page, as > the > > HTML element id would be duplicated. > > > > What is the best way to attach event handlers to HTML elements in > > components, avoiding the problem described? > > > > Thanks in advance. > > > > Karl-Erik > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > > that extends applications into web and mobile media. Attend the live > webcast > > and join the prime developer group breaking into this new coding > territory! > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > _______________________________________________ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user