I'm no javascript guru but I'd suggest some kind of global variable ... var checked = true;
if (checked == true) { // uncheck stuff checked = false; } else { // check stuff checked = true; } that ain't a nice way but javascript ain't nice anyway :-D regards michael Mathias P.W Nilsson wrote: > > Thanks I have looked at it and this is what I got so far > > protected void onComponentTag(ComponentTag tag) > { > checkComponentTag(tag, "a"); > checkComponentTagAttribute(tag, "href", "#"); > > CheckGroup group = (CheckGroup)findParent(CheckGroup.class); > > > if (group == null) > { > throw new WicketRuntimeException( > "LinkGroupSelector component [" + > getPath() + > "] cannot find its parent CheckGroup. > All LinkGroupSelector > components must be a child of or below in the hierarchy of a CheckGroup > component."); > } > > Form form = (Form)group.findParent( Form.class ); > if (form == null) > { > throw new WicketRuntimeException( > "LinkGroupSelector component [" + > getPath() + > "] Cannot find form for the given > component"); > } > > > tag.put( > "onclick", > "var cb=document.forms['" + form.getMarkupId() + > "'].elements" + > "['" + group.getInputName() + > "']; if (cb!=null) { if (!isNaN(cb.length)) { > for(var > i=0;i<cb.length;i++) { cb[i].checked=this.checked; } } else { > cb.checked=this.checked; } }"); > > super.onComponentTag(tag); > } > > > problem here is the this.checked in the javascript. The tag isn't a > checkbox so this.checked can not be used. any pointers on what toggle to > use for a link? > ----- Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/checkboxes-and-Link-tp16757399p16804111.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]