Welcome Guest Search | Active Topics | Sign In | Register

Menu trouble (expandSubMenu) Options
Samuele
Posted: Tuesday, January 22, 2008 1:49:15 PM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Hi,

i'm must expand a item sub menu must i'dont bi able with expandSubMenu client command.
my code is:

Code: JavaScript
openLastInsered = function () {
        var menu = eo_GetObject("MenuHeader");
        if (menu) {
            var li = menu.getTopGroup().getItemById("LastInsered")
            if (li) li.expandSubMenu();
        }
    };


the items of menu is precompiled and the submenu of "LastInsered" item is a customitem.
If i call function in onload of page i've no result. When i call the function in ClientSideAfterUpdate of a CallBackPanel (the menu is out of this) raise an exception same "Property or Method not supported".

Thanks
Paroca
eo_support
Posted: Wednesday, January 23, 2008 3:07:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

The reason that you are getting "Property or Method not supported" shouldn't have anything to do with our menu. It's the function that you are trying to call (openLastInserted) did not exist. Try to use the normal syntax to define the menu outside of the CallbackPanel like this:

function openLastInserted()
{
.....
}

You won't be able to expand sub menu during load as the sub menu has not finished loading yet. Set the parent item's Expanded property to true to achieve that.

Thanks
Samuele
Posted: Wednesday, January 23, 2008 3:33:50 PM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
hi,

The menu and the function is already out the callbackpanel. I've used debugger and the item is find (getItemById("LastInsered")) but "li.expandSubMenu();" raise an exception.
So the error have something to do with your menu.
I've used onLoad only for trying if work correctly but i must use on ClientSideAfterUpdate of an callbackpanel.

But when i've time a make other tries.. for check.

Thanks
Samuele
eo_support
Posted: Wednesday, January 23, 2008 3:47:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

I do not see how a method on the menu item can exist during normal load but does not exist during callback. A menu item object is always created from the same prototype, regardless when it is created. Please create a small sample page that demonstrates the problem. We will be happy to take a look once we have that.

Thanks
Samuele
Posted: Thursday, January 24, 2008 1:54:03 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Now you see..

Code: Visual Basic.NET
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Pagina senza titolo</title>
    <script type="text/javascript">
    
    openSubMenu = function () {
        var menu = eo_GetObject("MenuTest");
        if (menu) {
            var li = menu.getTopGroup().getItemById("Item2")
            if (li) li.expandSubMenu();
        }
    }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <eo:Menu ID="MenuTest" runat="server" Width="300px">
            <TopGroup>
                <Items>
                    <eo:MenuItem Text-Html="Item 1" ItemID="Item1">
                    </eo:MenuItem>
                    <eo:MenuItem Text-Html="Item 2" ItemID="Item2">
                        <SubMenu>
                            <Items>
                                <eo:MenuItem Text-Html="Sub Item 1" CustomItemID="MyCustomItem">
                                </eo:MenuItem>
                            </Items>
                        </SubMenu>
                    </eo:MenuItem>
                </Items>
            </TopGroup>
        </eo:Menu>
        <eo:CustomItem ID="MyCustomItem" runat="server" Height="50px" Width="150px">
            <eo:CallbackPanel ID="CBPCustomItem" runat="server" ClientSideAfterUpdate="openSubMenu" Height="150px"
                Width="200px" GroupName="Refresh" Triggers="">
                Ops.. Don't Work!!</eo:CallbackPanel>
        </eo:CustomItem>
        <eo:CallbackPanel ID="CBPUpdate" runat="server" GroupName="Refresh" Triggers="{ControlID:BtnUpdate;Parameter:}">
            <asp:Button ID="BtnUpdate" runat="server" Text="Refresh Custom Item and Open Sub menu" /></eo:CallbackPanel>
        &nbsp;&nbsp;
    </div>
    </form>
</body>
</html>


Thanks
eo_support
Posted: Thursday, January 24, 2008 8:24:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We have confirmed that this is a bug and have fixed it. Please see your private messages for download location of the new build. The problem occurs regardless with CallbackPanel or not. However CallbackPanel catches the error and displays a message box. Without the CallbackPanel, the error may have just gone unnoticed.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.