Client ContextMenuHide Event not firing

This post has 16 replies

Top 500 Contributor
Posts: 18
darthdart Posted: Wed Jun 17, 2009 @ 12:19 AM
this is just a basic menu that I attach to a dynamically populated div. The div changes background-color on its mouseover event and I used the contextmenuhide event to change the class of the div back to a white background-color for the div.

it was working fine before, but when I changed it to CA 2009.1.. wierd enough it stopped working... the contextmenuhide stopped working

<code>
<ComponentArt:Menu id="divSectionMenu"
Orientation="Vertical"
ContextMenu="Custom"
DefaultGroupCssClass="MenuGroup"
SiteMapXmlFile="~/AuthoringSectionMenuFile.xml"
DefaultItemLookID="DefaultItemLook"
DefaultGroupItemSpacing="1"
ImagesBaseUrl="images/"
EnableViewState="false"
ExpandDelay="200"
runat="server">
<ClientEvents>
<ContextMenuHide EventHandler="tempFunction" />
<ItemSelect EventHandler="divSectionMenu_OnItemSelect" />
</ClientEvents>
<ItemLooks>
<ComponentArt:ItemLook LookID="DefaultItemLook" CssClass="MenuItem" HoverCssClass="MenuItemHover" ExpandedCssClass="MenuItemHover" LabelPaddingLeft="10" LabelPaddingRight="10" LabelPaddingTop="3" LabelPaddingBottom="4" />
<ComponentArt:ItemLook LookID="BreakItem" CssClass="MenuBreak" />
</ItemLooks>
</ComponentArt:Menu>

<script type="text/javascript">
function tempFunction()
{
//change the div background
if (divHighlighted != "")
OnMouseOut(document.getElementById(divHighlighted));
/*OnMouseOut is my method that changes the className of the div
does a little cleaning up work etc.. etc..*/
}
</script>

</code>

it's as simple as that.. I even changed the function to just do a simple alert("Hello world"). it wouldn't even work.. anobody have a clue on this?
Top 25 Contributor
Posts: 179
conet Posted: Fri Jun 19, 2009 @ 12:42 AM
i can only say it does not work for me either!
i've got the new beta release...
the contextmenushow event works fine.

i'm working with showContextMenuAtEvent()
Top 500 Contributor
Posts: 18
darthdart Posted: Wed Jun 24, 2009 @ 11:11 PM
got a temporary fix for it.. I used the "GroupCollapseBegin" event instead of the ContextMenuHide. though it might not be the perfect fix but for now it's all that I was able to come up with.
Top 25 Contributor
Posts: 179
conet Posted: Wed Jun 24, 2009 @ 11:15 PM
a statement of the component art team would be nice...
Not Ranked
Posts: 9
gfunny72 Posted: Tue Oct 27, 2009 @ 9:29 PM

I'm having this problem too,  the

 

<ContextMenuHide EventHandler="Menu1_onContextMenuHide" /> 

is not firing -

Did this get resolved?  Or does anyone have a hack?

 

Top 10 Contributor
Posts: 1,736
Chris Posted: Wed Oct 28, 2009 @ 9:05 AM

Hi,

 

This is verified as currently working in 2008.2.1202, 2009.1.2002, and 2009.2.1509.

 

I'm including my working sample.

 

Hope this helps.

 

Cheers,

Christopher Moncayo,
Solutions Architect
ComponentArt Inc.
Not Ranked
Posts: 9
gfunny72 Posted: Thu Oct 29, 2009 @ 7:25 AM

Thanks!   I upgraded to 2009.2.1509 and it still isn't working.  I've cleared out the cache, I've tried adding the handler a couple different ways by:

 

<ContextMenuHide EventHandler="Menu1_onContextMenuHide" />



and also by:

function Menu1_onContextMenuHide(sender, eventArgs)
{
  alert('Hi');
}

function Menu1_onLoad(sender, eventArgs)
{
    Menu1.add_contextMenuHide(Menu1_onContextMenuHide);
}

 

...just to clarify - this should be called whenever the menus visibility disappears right?  Its a context menu.

 

Top 10 Contributor
Posts: 1,736
Chris Posted: Thu Oct 29, 2009 @ 10:20 AM

Hi,

 

Have you tried my sample?

 

Cheers,

Christopher Moncayo,
Solutions Architect
ComponentArt Inc.
Not Ranked
Posts: 9
gfunny72 Posted: Fri Oct 30, 2009 @ 5:42 AM

It works in your sample but not my app.  Is there anything I can look at debugging to the javascript to check to see where it is choking?  Or any thoughts on any other javascript  that could interfere with this?  Perhaps some of other javavascript events on the page?   Here is my code:

function Menu_onHide(sender, e)
          {
              alert(123);
          }


<ComponentArt:Menu id="Menu1"
                          Orientation="Vertical"
                          ContextMenu="Custom"
                          DefaultGroupCssClass="MenuGroup"
                          SiteMapXmlFile="~/_common/xmlMenus/DynamicScheduleHoverMenu.xml"
                          DefaultItemLookID="DefaultItemLook"
                          DefaultGroupItemSpacing="1"
                          ImagesBaseUrl="~/_images/HoverMenu/"
                          EnableViewState="false"
                          ExpandTransition="Fade"
                          CollapseTransition="Fade"
                          HoverCssClass="HoverStyle"
                          ExpandDelay="200"
                          TopGroupExpandOffsetY="10"
                          runat="server">
                        <ClientEvents>
                          <ItemSelect EventHandler="Menu1_onItemSelect" />
                          <Load EventHandler="Menu1_onLoad" />
                          <ContextMenuHide EventHandler="Menu_onHide" />
                        </ClientEvents>
                        <ItemLooks>
                          <ComponentArt:ItemLook LookID="DefaultItemLook" CssClass="MenuItem" HoverCssClass="MenuItemHover" ExpandedCssClass="MenuItemHover" LeftIconWidth="20" LeftIconHeight="18" LabelPaddingLeft="10" LabelPaddingRight="10" LabelPaddingTop="3" LabelPaddingBottom="4" />
                          <ComponentArt:ItemLook LookID="BreakItem" CssClass="MenuBreak" />
                        </ItemLooks>
                            <ServerTemplates>
                              <ComponentArt:NavigationCustomTemplate id="AddShift">
                                <Template>
                                   Hola!
                                </Template>
                              </ComponentArt:NavigationCustomTemplate>

                              <ComponentArt:NavigationCustomTemplate id="AddProfessional">
                                <Template>
                                    Hi There.
                                </Template>
                              </ComponentArt:NavigationCustomTemplate>
                            </ServerTemplates>
                        </ComponentArt:Menu>

Not Ranked
Posts: 9
gfunny72 Posted: Fri Oct 30, 2009 @ 12:41 PM
Any suggestions on how I can debug this? - I'm really digging in and comparing the working sample against my app.
Not Ranked
Posts: 9
gfunny72 Posted: Fri Oct 30, 2009 @ 2:00 PM
I found the problem - the onMenuHide event does not fire when you display the menu by Menu1.showContextMenuAtEvent

... I changed it to open the menu as in your demo Menu1..showContextMenu(e);  and it worked.
Top 10 Contributor
Posts: 1,736
Chris Posted: Mon Nov 2, 2009 @ 8:43 AM

Excellent, I'm glad this is working now.

 

Cheers,

Christopher Moncayo,
Solutions Architect
ComponentArt Inc.
Top 25 Contributor
Posts: 179
conet Posted: Mon Nov 9, 2009 @ 3:15 AM
what about showContextMenuAtEvent()?
Not Ranked
Posts: 2
RareA1r Posted: Wed Apr 21, 2010 @ 10:50 PM
The event ContextMenuHide is only working when using ShowContextMenu but when using any other way to show the control like showContextMenuAtPoint or showContextMenuAtEvent the event does not fire.
Is there any solution for this problem cause i'm trying to open my context menu in a spesific position and i can not do that using the ShowContextMenu option.
Top 10 Contributor
Posts: 1,603
harish Posted: Tue Apr 27, 2010 @ 7:57 AM

Hello,

 

As you have submitted the support ticket for the same issue; I have replied for the same via the support ticket.

 

Thank you.

 

Harish Malhotra

Page 1 of 2 (17 items) 1 2 Next >