Hi, "click" should be used for Ajax behaviors because Wicket 6.0+ uses JavaScript event listeners. AttributeModifier modifies HTML attributes and they have to be prefixed with "on".
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Feb 15, 2016 at 9:50 AM, Kevin <[email protected]> wrote: > When i use a link (wicket 6.21.0 or 7.1.0) the java code below doesn't > change > my element. > String js = "this.style.display = 'none';"; > js += "document.getElementById('" + showLinkId + "').style.display = '';"; > this.add(AttributeModifier.replace("click", js)); > > When is use the same code but use "onclick" instead of "click", everything > works fine. > I have been told that we should us "click" instead of "onclick". > What am I doing wrong? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxEvent-click-and-onclick-tp4673590.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
