Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
UltraWebMenu_ItemClick not always executing CallServer in Firefox
posted

Hi!

I have a UltraWebMenu on a Master Page and I have the ClientSideEvent UltraWebMenu_ItemClick registered.  In the ItemClick I call the server using a ClientCallBack approach i.e. CallServer(parameter) and on the server side in the RaiseCallbackEvent method various things are performed that are needed for my page to work correctly.

My problem is that in Firefox the ItemClick event for the UltraWebMenu is executed but it does NOT always execute the CallServer command but it always works in IE 7.  The strange thing is that if I insert alert("test"); after the CallServer command in the ItemClick event it seems to always work in Firefox as well.

Is there a bug with ClientSideEvents for UltraWebMenu in Firefox or am I doing something wrong?

 

Here is the ClientSide Event for the UltraWebMenu ItemClick:

function UltraWebMenu1_ItemClick(menuId, itemId)
{
   CallServer('1' + ';' + itemId, '');
}

 

Here is the UltraWebMenu definition in the MasterPage:

<ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" DisabledClass="" FileUrl=""
                            Font-Bold="True" ForeColor="White" ItemSpacingTop="2" JavaScriptFilename="" JavaScriptFileNameCommon=""
                            LeafItemImageUrl="" ParentItemImageUrl="" SeparatorClass="" StyleSetName="" TargetFrame=""
                            TargetUrl="" TopItemSpacing="Compact" TopSelectedClass="" Width="100%" BorderCollapse="True"
                            ItemSpacingSubMenus="2" BorderStyle="None" Style="float: left; position: relative;
                            top: 57px; font-size: x-large; font-weight: bolder;" HideDropDowns="False">
                            <IslandStyle BorderStyle="Outset" BorderWidth="1px" Cursor="Default" Font-Names="MS S***rif"
                                Font-Size="8pt" ForeColor="Black">
                            </IslandStyle>
                            <TopSelectedStyle CssClass="menuButtonSelected">
                                <BorderDetails WidthBottom="1px" WidthLeft="1px" WidthRight="1px" WidthTop="1px" />
                            </TopSelectedStyle>
                            <HoverItemStyle Cursor="Default" Font-Overline="False" ForeColor="White">
                                <Margin Bottom="0px" Left="0px" Right="6px" Top="0px" />
                                <Padding Bottom="0px" Left="0px" Right="0px" Top="0px" />
                            </HoverItemStyle>
                           
                            <ItemStyle Font-Bold="False" Font-Names="Arial" Font-Size="9pt">
                                <Margin Right="6px" />
                            </ItemStyle>
                            <DisabledStyle BorderStyle="Solid" ForeColor="LightGray">
                                <BorderDetails WidthBottom="1px" WidthLeft="1px" WidthRight="1px" WidthTop="1px" />
                            </DisabledStyle>
                            <Levels>
                                <ignav:Level Index="0" />
                            </Levels>
                            <ExpandEffects ShadowColor="LightGray"></ExpandEffects>
                            <MenuClientSideEvents ItemClick="UltraWebMenu1_ItemClick" />
                        </ignav:UltraWebMenu>

 

I sincerely hope there is a solution to this!!!

Parents
  • 475
    Offline posted

    Hi again!

    This must be the strangest problem I have ever encountered.  It seems that a small delay is needed after the CallServer command in the ItemClick ClientSideEvent for this to work in Firefox.  The reason the CallServer command worked if an alert() command was executed directly after it is that the alert box delays the exiting from the ItemClick event.  The idea to use some kind of a sleep function to create this delay then came to my mind and here is the fix/hack I created for this.

    /* To fix that CallServer is not being executed in Firefox */
        var sleepTimeMSeconds = 100;
        var startMSeconds = (new Date()).getTime();
        var sleeping = true;
        while(sleeping)
        {
            var alarmMSeconds = (new Date()).getTime();
            if((alarmMSeconds - startMSeconds) > sleepTimeMSeconds)
            {
                sleeping = false;
            }
        }

    By letting the code "sleep" for only 1/10 of a second after the CallServer command was enough for the CallServer to execute successfully in Firefox.

    I don't know why this is needed in Firefox, but it's very strange having to create such a odd solution to get things to work correctly.

    Is this a bug in UltraWebMenu ItemClick ClientSideEvent or is it a Firefox bug?

    Please try to reproduce to find out which!

Reply Children
No Data