:: Forum >>

Context Menu using List

I've created a context menu using an AW list. I can display the list perform specific actions depending on the item the user has clicked. However when I try to hide the list at the end of the onItemClicked event, I get the following error:

Can't move focus to the control because it is invisible, not enabled, or of a type that does not except focus.

I've traced this error back to the updateCurrent function list.js. It seems that this variable:

var e2 = this.getItemTemplate(i2).getContent("box/text").element();

has e2.focus of true.

Is there any way I can alter this specific list so that e2.focus would return false?

Thanks in advance
Helen Williamson
Tuesday, January 10, 2006
You can do what I did and instead of trying to "hide" the grid, you can hide the grid. Let me explain. Instead of setting the visibility attribute or something like that, simply set the left and top styles to -1000. This will move the list off the page to the upper left, in effect hiding it. Then when you need it again, move it back into position with setPosition. I also hide it during onMouseOut. It is a simple solution that is working nice for me.
Jim Hunter
Tuesday, January 10, 2006
Thanks Jim - that worked brilliantly
Helen Williamson
Wednesday, January 11, 2006
how would one find the position of the curser in order to popup the menu?
Monday, May 15, 2006
I asked basically the same question in this thread (http://www.activewidgets.com/javascript.forum.12947.4/how-to-properly-set-oncontextmenu.html).

Helen, could you post an example of your context menu?
Neil Craig
Wednesday, June 7, 2006

This topic is archived.

Back to support forum

Forum search