Home - Forums-.NET - FlyTreeView (ASP.NET) - Problem with FlyContextMenu FlyMenuItem

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Problem with FlyContextMenu FlyMenuItem
Link Posted: 12-Nov-2008 20:50
Hi,

I'm having a very strange issue and can not find a solution as of yet. I have also tried to reproduce this in a test case but have not been able to so far.

I have a TreeView, I open a node and it has 30+ children nodes. If I right click one of these child nodes, I have a javascript handler defined for one of the menu items. No postback occurs. At the top of the form is an a href that has a javascript handler defined for it (ie. href="javascript:doSomething()" ).

When i right click on the menu item for a child node,  its handler is executed. I then go back to the top of the form and click the href at the top of the form and its javascript executed. This occurs up until the 21st child node. Click on the 22nd child node, the menu item handler executes, but when I go back to the top of the form to click the href, nothing happens.

At first I thought some javascript was getting dynamically executed and causes the rest of the javascript to fail, but then realized that it is something to do with  the browser focus.

I have to scroll back up to the top of the form to click my href. When I click the href, the browser immediately scrolls back down a bit to make the child node whose menu item I had clicked visible. This causes my href button at the top to become not visible and I have to scroll back up try again. No matter what I do I can not get the href at the top to execute. If I then fully expand my window so that no scrolling is necessary and redo my scenario with the same exact child node, everything works fine.

I then noticed that if I click some other href's on the page, the page will scroll down without navigating to the href. After scrolling down, the href is still visible on the page, so if I click it again, it will navigate. Regardless this is a problem as I am now clicking twice on an href to get it to execute.

To try and isolate the issue, I commented out all of the javascript in my menu item handler. I get the issue still, so I know it has nothing to do with what I am doing in the handler.

I also tried using instead of a plain href at the top of my form , an asp:LinkButton and an asp:Button (using onClientClick to execute my javascript), and these also have the same behaviour as the href.

My question, what kind of focusing is done after the menu item's handler is executed. As this code is obfuscated I can't really debug anything. As an experiment, I tried setting the focus to my href at the top of the form as the last line of my javascript menu item handler. I see the href now get focus after the handler executes, but as soon as I click the href, it does not work and the browser scrolls down again to bring the node into view....

Thanks for any help.

I am using version 4.3.2.99 and this bug is only happening in IE 6/7, and not FireFox 3.0.

Rich
Link Posted: 12-Nov-2008 21:04
Rich,

FlyTreeView calls focus() on context menu when node element is clicked, and after menu items is clicked it also calls focus() of original node element.

As usual, it would be perfect to have test case that reproduces the issue.