Re: sharing a context menu across components

2007-08-14 Thread Kirk Israel
So I haven't found what setup would provide a reference to the Behavior to the AjaxFallbackLink. Is the problem in how I'm relying on overloading the page's document.oncontextmenu to handle the right click event, and I should be using something else? As a workaround, is there any available Javascr

Re: sharing a context menu across components

2007-08-13 Thread Igor Vaynberg
what i am suggesting is this: if you only want to have a single instance of behavior per table, yet have onclick react per row you need to have some javascript on the clientside that can tell what row is clicked by appending something meaningful to the behavior's callback url. you do not need thi

Re: sharing a context menu across components

2007-08-13 Thread Kirk Israel
I guess I'm not understanding what you're suggesting. I've added a ContextMenuBehavior to the dataTableComponent row. Inside the ContextMenuComponent that is also on the page, there is an AjaxLink anonymous inner class. that overrides onClick(AjaxRequestTarget pRequestTarget) But the result of ge

Re: sharing a context menu across components

2007-08-13 Thread Igor Vaynberg
see component.getpath() -igor On 8/13/07, Kirk Israel <[EMAIL PROTECTED]> wrote: > > Where can I retrieve that path? Each row is generating a unique > behavior object instance, but in the onClick for one of the menu > items, code like > this.getRequest().getPath(); > (which, through some docu

Re: sharing a context menu across components

2007-08-13 Thread Kirk Israel
Where can I retrieve that path? Each row is generating a unique behavior object instance, but in the onClick for one of the menu items, code like this.getRequest().getPath(); (which, through some documentation surfing and trial and error seemed the only thing close to what you were talking abou

Re: sharing a context menu across components

2007-08-13 Thread Igor Vaynberg
the first one is internal to wicket - because the behavior is unique it gets an internal unique path in wicket, so you dont need to worry about it. so basically your onclick handler for the menuitem has a 1-1 link to the onclick handler of the behavior. if you want one behavior then you have many

Re: sharing a context menu across components

2007-08-13 Thread Kirk Israel
I kind of see what you're getting at, but could you give an example of the syntax for the first one? I already have a unique behavior instance for each row... do I need to add another one? Or is there some way in the onClick code to read what the path of the behavior is? (Actually I might not be t

Re: sharing a context menu across components

2007-08-13 Thread Igor Vaynberg
the event is triggered on clientside, so you need to pass back what item was clicked there. you can either do it by adding a unique behavior - which then has a unique path - which is that "id" you are passing back. or you need to append some unique id on client side using javascript so it can tell

sharing a context menu across components

2007-08-13 Thread Kirk Israel
I have a Context Menu Object and Behavior... right now I construct one Context Menu for the whole Data Table (extends AjaxFallbackDefaultDataTable) component that links to it... then on newRowItem() I add a unique ContextMenuBehavior (extends AbstractBehavior) to that item before returning. My Con