Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:47

Urgent Help Required. Please Help.


Poster: jnigtin
Dated: Thursday November 30 2006 - 23:36:41 GMT

I have created our menu system but have 1 last problem that I really need to get fixed. If I can get this fixed we will be purchasing the corporate license, but it is contingent on this.

1) I have added an onfunction which calls a function to create new menu dynamically.
2) The new menu is created fine using a modified version of m_addMenu.
3) I then remove the onfunction by setting it to ''.
4) I then add a showmenu=XXX to the parent for the new menu.

The new menu is created fine, however I cannot get the new menu to showup. If I move the mouse to another menuitem and return, the new menu show perfectly.

I have tried itemOn for the new menu but that doesnt show it.
I have tried to manually call: _p1(this);_mot=$P(_mot);
I have tried everything I can think of but cannot get the menu to show after the new submenu is built.

All I basically need is some code that performs the opening of a submenu, when the mouse is already over that cell. A 'Reopen' submenu function or the actual function in the obfuscated code that performs the opening of a submenu.

Regards

Jim Nightingale
RBSGC


Poster: Andy
Dated: Friday December 1 2006 - 0:45:41 GMT

If we can see the code that you are using we will probably be able to see where the problem is.

You could use the popup("menuname",1); function to display the menu but if it still fails to show it might be that the menu hasn't actually been rendered and there are several reasons for why this could be. Seeing the code will help us advise further.

Regards,
Andy


Poster: jnigtin
Dated: Friday December 1 2006 - 4:26:13 GMT

When I used popup("menuname",1); it closed any menus that were currently open and just showed the new menu as an orphan.

I think the problem is that the mouse is already in the current menuitem and there is some check which is stopping it from showing because the mouseover event hasnt fired again.

Its very hard to give all of the code here because it uses databases and webservice calls to retrieve new data, however that is all working perfectly and the new menu is back at the client at the right time we just cant get the newly created menu to show after it is built.

I might be able to get this up to an external webserver tommorrow if needed but that will take quite a bit of time.

What we are tryign to accomplish is to have a button that when the user hovers over it will show a vertical menu of a very complex tree structure. We pre-build all levels except the last (about 500 items ) at about 5-10 per menu. When the user gets to the last level we use ASP.NET AJAX to retrieve that last level. We cannot completely pre-build the menu because it has over 7000 items, so we want to load on demand the last level and then not do another ajax call to reload it.
Code:
//This does not need to be an ajax call, it could be an onfunction call
function GetAjaxMenu_OnComplete(result) {
   //Params(Out): MenuScript | parentid | id | parenttext

   //Example result:
   //------------------
   //aI('text=1yr;clickfunction=ssC("1yr", 4, 19);');
   //aI('text=2yr;clickfunction=ssC("2yr", 4, 19);');
   //aI('text=3yr;clickfunction=ssC("3yr", 4, 19);');
   //aI('text=5yr;clickfunction=ssC("5yr", 4, 19);');
   //|1000|1001|Rolling Issues

   var aResults = result.split('|');
   var parentid = aResults[1];
   var id = aResults[2];
   var parenttext = aResults[3];
   var ir = _itemRef;

   //Add new menu
   mm_addMenu2(id, aResults[0], ir);

   //Change calling menu item to be a showmenu=gmXXXX
   mm_changeItemProperty('gm' + parentid, parenttext, 3, 'gm' + id, 0);

   //Change onfunction to remove AJAX call
   mm_changeItemProperty('gm' + parentid, parenttext, 42, '', 1);

   //Show new menu ****Not working*****
   itemOn (ir);
}



function mm_addMenu2() {
   var a = arguments;
   var n = _m.length;
   with(milonic=new menuname("gm" + a[0])) {
      style=menuStyle;
      overflow='scroll';
      _bl =_mi.length;
      eval(a[1])
   }
   mm_createNewMenus();
   return n;
}

function mm_changeItemProperty(menuName, itemName, codeRef, newValue, updateDisplay) {
   menuName = menuName.toLowerCase();

   for (i=0; i<_mi.length; i++)
      if (_mi[i][1].replace(/\ \;/ig,' ') == itemName && _m[_mi[i][0]][1] == menuName)
         break;
   
   if (i == _mi.length)
      return;

   _mi[i][codeRef] = newValue;

   if (updateDisplay)
      BDMenu(_mi[i][0]);
}


We are really up agaisnt the wall on this after having gone through a diferent menu that never got back to us with problems we were encoutnering so had to switch to a diferent product. We really liek this menu and have it working 99% of the way, we just need that last fix and we are good to go.


Poster: Andy
Dated: Friday December 1 2006 - 13:38:11 GMT

Don't worry, I'll get to this issue once I get the time. I'm have to deal with customer enquiries before I can deal with the Forum because the Forum is a free service.

Please note that you can expedite your request by becoming a customer and using the tech support system. If we cannot provide 100% satisfaction, I guarantee you'll be refunded in full and that's company policy throughout.

Regards,
Andy


Poster: jnigtin
Dated: Friday December 1 2006 - 13:56:03 GMT

If it helps I can buy a professional license now, but it will take a few days for us to get a purchase order through to order the corporate or world license.


Poster: jnigtin
Dated: Friday December 1 2006 - 14:16:04 GMT

I tried popup("menuname",1); and it keeps the current menu open, shows the new menu, however it closes the parent menu above the current menu.

I also wrote code to completely take Ajax out of the picture and it is still the same when the new menu is called directly from the onfunction

Code:
function NonAjaxTest() {
   result = "aI('text=1yr;clickfunction=ssC(\"1yr\", 4, 19);');aI('text=2yr;clickfunction=ssC(\"2yr\", 4, 19);');aI('text=3yr;clickfunction=ssC(\"3yr\", 4, 19);');aI('text=5yr;clickfunction=ssC(\"5yr\", 4, 19);');|1000|1001|Rolling Issues";
   //Params(Out): MenuScript | parentid | id | parenttext
   var aResults = result.split('|');
   var parentid = aResults[1];
   var id = aResults[2];
   var parenttext = aResults[3];
   
   var ir = _itemRef;

   n = mm_addMenu2(id, aResults[0], ir);

   mm_changeItemProperty('gm' + parentid, parenttext, 3, 'gm' + id, 0);
   mm_changeItemProperty('gm' + parentid, parenttext, 42, '', 0);

   //itemOn (ir);
   popup("gm" + id, 1);
}


Poster: Andy
Dated: Sunday December 3 2006 - 11:40:43 GMT

Would it be possible for you to mock up something that we can see?

We don't have any syntax for your functions, therefore it's difficult to know how to operate them.

Regards,
Andy


Poster: jnigtin
Dated: Monday December 4 2006 - 14:40:29 GMT

Here is a demo with the menu and the problems.

http://www2.rbsgc.com/gbmclientcontrols/test/test.htm

Go down any submenu until you see a grey circle.
Hover over that to build a new submenu for that section.
The new menu will not show with itemon(currentmenu).
If you go off that menu and come back the newly built menu will display as normal.

If you get a jscript error click on this url to fix it:
http://www2.rbsgc.com/gbmclientcontrols/test/scripts/securityselector_data.aspx


Poster: jnigtin
Dated: Monday December 4 2006 - 15:01:59 GMT

We also seem to be having an issue where the menu doesnt close if you fire an onfunction event in one cell and move thru another quickly and then out of the menu.

Thanks
Jim


Poster: Andy
Dated: Monday December 4 2006 - 17:48:51 GMT

I'm getting errors on that page, even after clicking the link; which, incidently, is giving me an error.


Poster: jnigtin
Dated: Monday December 4 2006 - 18:56:34 GMT

Sorry lots of security hoops to jump thorugh here.

Please try http://www2.rbsgc.com/gbmclientcontrols/test/test.html


Poster: jnigtin
Dated: Tuesday December 5 2006 - 14:20:07 GMT

Hi Andy,

I was wondering if you had a chance to look at this yet? If you could just let us know if you think you can fix this problem and what sort of timeframe it would take to fix it if you can.

We are getting massive pressure from our trading floor to get this out and if you think we can get this fixed then we have no problem ordering the world wide license. But if it is going to take a considerable amount of time we will have to drop the menu and just go back to a tree view.

Regards
Jim


Poster: jnigtin
Dated: Monday December 11 2006 - 15:49:30 GMT

I guess this is not possible to fix then


Poster: Andy
Dated: Monday December 11 2006 - 15:57:48 GMT

I'm sure it's possible but Milonic Tech Support is taking up a large amount of my time at the moment and I'm not sure anybody else on here can help.

Unfortunately, I cannot expedite your request as you are not yet a customer. As I say there is no rick regarding buying the menu, if we cannot do as you require then you'll get your money back.

If you can purchase the Corporate License as previously stated we should be able to push this issue forward and get it resolved.

Regards,
Andy


Poster: jnigtin
Dated: Monday December 11 2006 - 16:11:27 GMT

We have no problem purcahsing the license, but we need to know if it can be fixed and how long it will take.

All we are asking is a timeframe because we cannot wait for a month to just be told here is your money back because it cant be fixed.

It will take a minimum of 1 week and maybe more (because of the holidays) to get a purchase order through. If it does take 2 weeks, and then because we are a new customer and go to the bottom of the list it will take another month after that, then that is too long and we have to go another route.

If you wish to check that our company is bone fide, the home webpage is http://www.rbsgc.com. We don't run any unlicensed software here, everything has a valid corporate license if we use it. There is just a lot of beaurocracy to get things approved.


Poster: Andy
Dated: Monday December 11 2006 - 17:00:23 GMT

The code that you initially gave me earlier in this thread seems to work fine.

However, the links in this thread either return a 404 error or "Access Denied" If you can sort a links out so that we can see where the code is failing I should be able to sort this out.


Poster: jnigtin
Dated: Monday December 11 2006 - 17:22:00 GMT

Hi Andy,

Thanks for getting back to me. We have put the purchase order in and asked them to expedite it, but it will still likely be slow as it goes through the approval process.

The link is fixed here:

http://www2.rbsgc.com/gbmclientcontrols/test/test.html

If you go down to any last level menu and hover the menu doesnt show until you mouseout and then go back.


Poster: Andy
Dated: Monday December 11 2006 - 18:36:35 GMT

Hi,

Can you please send over the AJAX code that you use. I'd like to see how you are calling data from the server.

Looks like we may need to write an AJAX module but need to know the technique you use for getting access to the data.

Cheers,
Andy


Poster: jnigtin
Dated: Monday December 11 2006 - 19:15:54 GMT

Hi Andy,

This example does not use any AJAX at all because we wanted to make sure the bug was not caused by AJAX. This page simply builds a new menu in javascript and tries to open it.

The bug appears to be that
Code:
itemOn (ir);
does not work if you create a new menu and do not trigger a new mouseon event for the parent cell. My hunch is that there is some sort of check to only open a menu if the user has moved to a new parent cell, and not the same parent as when last called. Because in our menu, when you hover over a cell it does not have a submenu at that time, when you call itemOn, it thinks the new submenu is already open and does nothing.


Here is our AJAX Database implementation, if it helps you out in any other way:

With my ajax implementation all I do is call a webservice using ASP.NET AJAX web service methodology found here. http://ajax.asp.net/docs/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx. Here is how we do it:

C# Code for building a single menu line at PageLoad. Use this to build all parent menus that wont use ajax.
Code:
sb.AppendFormat ("aI(\"onfunction=GetAjaxMenu('{0}', '{1}', '{2}');text={2};menustyle=ajaxmenuStyle;\");", dbRow["parentid"].ToString (), dbRow["id"].ToString (), dbRow["Description"].ToString ().Trim ());


Javasctipt File
Code:
function GetAjaxMenu(parentid, id, parenttext) {
   //Params(In): ssotoken | parentid | id | parenttext
   requestSimpleService = WebService.GetAjaxMenu (__ssotoken + '|' + parentid + '|' + id + '|' + parenttext, GetAjaxMenu_OnComplete, GetAjaxMenu_OnTimeout, GetAjaxMenu_OnError);
    return false;
}
function GetAjaxMenu_OnComplete(result) {
   //Params(Out): MenuScript | parentid | id | parenttext
   var aResults = result.split('|');
   var parentid = aResults[1];
   var id = aResults[2];
   var parenttext = aResults[3];

   if (currentId == id) {
      var ir = _itemRef;

      n = mm_addMenu2(id, aResults[0], ir);

      mm_changeItemProperty('gm' + parentid, parenttext, 3, 'gm' + id, 0);
      mm_changeItemProperty('gm' + parentid, parenttext, 42, '', 0);
      mm_changeItemProperty('gm' + parentid, parenttext, 29, '', 1);
      mm_changeItemProperty('gm' + parentid, parenttext, 24, '/images/arrow.gif', 1);

//#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#
//Milonic menu code fails to open the new menu here
      itemOn (ir);
//#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#

   }
}
function GetAjaxMenu_OnTimeout(result) {
   alert('A timeout occurred. Please press F5 to refresh the page and try again. If that fails, please contact the Help Desk.');
}
function GetAjaxMenu_OnError(result) {
   alert('An error occurred. Please press F5 to refresh the page and try again. If that fails, please contact the Help Desk.\n\nError Details:\n' + result);
}
[/code][/u][/b]

Webservice Method
Code:
   public string GetAjaxMenu (string Params) {
      //////////////////////////////////////////////////////////////////////////////////////////////////////////
      //Params(In):   ssotoken | parentid | id | parenttext
      //Params(Out):   MenuScript | parentid | id | parenttext
      //////////////////////////////////////////////////////////////////////////////////////////////////////////
      string[] aParams = Params.Split (new char[] { '|' });
      string parentid = aParams[1];
      string id = aParams[2];
      string parenttext = aParams[3];

      StringBuilder sb = new StringBuilder ();
      string filter = String.Format("parentId = {0}", id);
      DataView dv = new DataView (MasterList, filter, "parentId, id", DataViewRowState.CurrentRows);
      DataTable dt = dv.ToTable ("Tree");

      int c = 1;
      foreach (DataRow dbRow in dt.Rows) {
         sb.AppendFormat ("aI('text={0};clickfunction=YourFuncHere();');", dbRow["Description"].ToString ().Trim ());
         sb.AppendLine ();
         c++;
      }

      return String.Concat (sb.ToString (), "|", parentid, "|", id, "|", parenttext);
   }


Poster: Andy
Dated: Monday December 11 2006 - 19:32:39 GMT

Thanks for the code, will go through it and let you know if I need anymore info.

For your information: itemOn isn't the function you need. itemOn only takes care of the colors and other properties changed when the user mouses over a menu item. The function you need is _popi(ITEMREFERENCE) as this is the function that calls itemOn and does all the necessary coding to open the sub menu. However, this is returning an error for which I am working on but looks like it might be more efficient for us to create a new function based on data being returned from the server, this is why I needed to see how you are requesting the data. Will need to develop something that works on the fly from external data and something that we hope will be done sometime this week.

Regards,
Andy


Poster: jnigtin
Dated: Monday December 11 2006 - 20:00:22 GMT

Thanks Andy,

_popi(ir) fixed our non AJAX page, I will try it now on the AJAX one and see if it works there too.