Dynamically creating menus...

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
manight@tin.it
Beginner
Beginner
Posts: 2
Joined: Sun May 19, 2002 7:23 pm

Re: Dynamically creating menus...

Post by manight@tin.it »

Hi,

The actual code that is generated works fine so I'm thinking that it might be something else.

Does the code work without the ASP additions?

The way I would do this is change the file extension on menu_array.js from .js to .asp. This will force IIS to parse this file.

Then try something like this.

addmenu(menu=["extn<% =rs("extensionkey")) %>",,,250,1,"",style1,,"left",effect,,,,,,,,,,,,
," View Details ","dir2.asp?extn=<% =rs("extensionkey")) %>",,,0
," Show all Users ","dir2.asm?sextn=rs("extn"))",,,0
," Edit this User ","extensionedit.asp?extensionkey=<% =rs("extensionkey")) %>",,,",,,0
])

Might need a bit tweaking but it's an idea.

Cheers
Andy
smac
Beginner
Beginner
Posts: 2
Joined: Sun May 19, 2002 8:23 pm

Re: Dynamically creating menus...

Post by smac »

No, it works fine if I force the menu to be displayed (i.e. just naming the submenu 'fred'), it just doesn't seem to create the new menus...

I have used response.write to view the 'parsed' code to the client screen, and looking at the page source on the destination, the <SCRIPT> </SCRIPT> elements are there along with the addmenu code.

Generated HTML:
<SCRIPT Language=Javascript>addmenu(menu=["extn27",,,250,1,"",style1,,"left",effect,,,,,,,,,,,,," View Details ","dir2.asp?extn=27",,,0," Show all Users ","dir2.asm?sextn=4014",,,0," Edit this User ","extensionedit.asp?extensionkey=27",,,0])</SCRIPT>


I notice that there is no error generated (i.e. Javascript errors) at the client end.

Regards,

Paul.
paulm@mit-comms.co.uk
Beginner
Beginner
Posts: 4
Joined: Sun May 19, 2002 7:23 pm

Dynamically creating menus...

Post by paulm@mit-comms.co.uk »

I am trying to create a pop-up menu that will allow me to view/edit a users details.

This is all being called from a server-side script to dynamically build the client-side script to show the pop-up on a graphic next to the user's name.

When ever I try to do this, it fails with "Object required"......what am I doing wrong.

Regards,

Paul.



ASP SCRIPT:
' Add the menu for this extn....
a = "addmenu(menu=['xtn',,,250,1,'',style1,,'left',effect,,,,,,,,,,,,,' View Details ','dir2.asp?extn=KEY',,,0,' Show all Users ','dir2.asm?sextn=NUM',,,0,' Edit this User ','extensionedit.asp?extensionkey=KEY',,,0])"

a = replace(a,"KEY",rs("extensionkey"))
a = replace(a,"NUM",rs("extn"))
a = replace(a,"'",chr(34))

response.write "<SCR"
Post Reply