Thanks for your answer but I cannot seem to find the IOnClickHandler
interface. I'm using Wicket 1.3.5. 
I've tried using:

item.add(new AjaxEventBehavior("onclick") {
                                        private static final long 
serialVersionUID = 3710904016938478920L;

                                        @Override
                                        protected void 
onEvent(AjaxRequestTarget target) {
                                                System.out.println("Clicked!");
                                                selected = (MyDomainObject) 
getParent().getModelObject();
                                        }
});

but it doesn't seem to work. In Internet Explorer "Clicked!" is printed but
getParent().getModelObject() always returns null. In Firefox 3.0.5 nothing
happens at all.

/Johan


igor.vaynberg wrote:
> 
> class myitem extends item implements IOnClickHandler {
>    protected oncomponenttag(tag) {
>        tag.put("onclick").urlfor(IOnClickHandler.INTERFACE);
>   }
> 
>   public void onclick() {
>        whatever();
>   }
> }
> 
> -igor
> 
> On Mon, Jan 12, 2009 at 2:18 AM, Gohan <hal...@gmail.com> wrote:
>>
>> Hi,
>>
>> I have a DataView using a custom Item that I create when the newItem
>> method
>> is called. My question is, how do I add an onclick event handler to this
>> Item that allows me to select the model object for a particular row? Or
>> perhaps I can achieve this in some other way?
>>
>> Thanks
>> Johan
>> --
>> View this message in context:
>> http://www.nabble.com/Select-model-object-when-clicking-on-a-row-in-a-DataView-tp21411736p21411736.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Select-model-object-when-clicking-on-a-row-in-a-DataView-tp21411736p21430291.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to