If you look at the JavaScript file for this menu - you should be able to figure it out. I believe each menu item gets a number id for it's cookie. You could use your browser to see what cookie is set when you click on it.

Matt

On Oct 7, 2004, at 7:43 AM, Robert Smith wrote:

OK, great, thanks. Can you tell me more about the cookie? The contents, etc?

Robert

----- Original Message -----
From: "Matt Raible" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 07, 2004 4:28 AM
Subject: Re: [struts-menu] Setting menu tab at runtime



On Oct 6, 2004, at 4:05 PM, Robert Smith wrote:

The
 MenuComponent parentMenu = repository.getMenu(parent);

caused it. I could see the menus in the defaultRepository, but
creating a
new one and setting the displayers didn't populate them for some
reason.

The code you have above isn't in the code listed below. Are you
referring to the code from the example JSP? If you do your processing
in a servlet or filter - you shouldn't need to do anything in the JSP -
just grab the repository and render the menus. Since you're setting it
as a session variable named "repository" - you'll have to specify
repository="repository" as part of the useMenuDisplayer tag.


On
an unrelated note, what could cause submenus from being displayed. I
have a
whole bunch of pages that forward to a "query results" page which
doesn't
get listed in menu-config.xml. How do I make sure the parent tab is
still
highlighted and the submenus get displayed?

I believe the "highlight this tab" functionality is currently made possible by URL matching and then by cookies. You should be able to set a cookie in your code to highlight the appropriate tab in a query results page.

Matt


Thanks,

Robert

----- Original Message -----
From: "Matt Raible" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 06, 2004 5:50 PM
Subject: Re: [struts-menu] Setting menu tab at runtime


Where do you get the NPE at?

On Oct 6, 2004, at 3:03 PM, Robert Smith wrote:

That code gave me a null pointer exception. This is what I had to do:

MenuRepository defaultRepository =
(MenuRepository)getServletContext().getAttribute(MenuRepository.MEN U_
RE
POSIT
ORY_KEY);
MenuComponent defaultmc = defaultRepository.getMenu("Home"); //Home
is
set
in my menu-config.xml
defaultmc.setLocation("\myhomepage.html"); //Gets changed here
defaultRepository.addMenu(defaultmc);
session.setAttribute("repository", defaultmc);


Robert

----- Original Message -----
From: "Matt Raible" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 06, 2004 3:19 PM
Subject: Re: [struts-menu] Setting menu tab at runtime



On Oct 6, 2004, at 11:53 AM, Robert Smith wrote:

Hello,
I've been using the struts menu for a few weeks now, and I like
what I
see. I have a few questions if anyone can help:


1.  I have about 5 main tabs with a few dozen submenus (using the
nice
looking tabs menu). I need to add a "Home" menu to be the first
main
tabbed
menu item, but the location of it needs to be set upon the user
logging in
(instead of being pulled from the menu-config.xml). In my login
code
(a
servlet), how would I do this?

You can grab the repository from the servlet context, modify it and
stuff it into the user's session. This howto may help:


http://demo.raibledesigns.com/struts-menu/dynamicMenu.jsp


2. I'm using the TabbedMenuDisplayer, and changing tabs is slow. Has anyone experienced this?

What do you mean - the JavaScript/CSS seems slow - or the pages are
slow to load?


Matt



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Use IT products in your business? Tell us what you think of them.
Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find
out
more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ struts-menu-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-menu-user



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Use IT products in your business? Tell us what you think of them.
Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give
us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ struts-menu-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-menu-user

Reply via email to