Issue Details (XML | Word | Printable)

Key: SM-36
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: Matt Raible
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts Menu

Two problems when using ListMenuDisplayer.java

Created: 09/May/06 02:13 AM   Updated: 10/May/06 01:48 AM   Resolved: 10/May/06 01:48 AM
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.4


 Description  « Hide
Moved from SourceForge http://sourceforge.net/tracker/index.php?func=detail&aid=1212739&group_id=48726&atid=453974:

Two problems when using ListMenuDisplayer.java. I am
using version 2.3

1. In the displayComponents method the domId should
be unique in the menu. Why are we using menu title?
Can we use menu name instead because that should
be unique? Does this cause any other problems?

Change:
String domId = StringUtils.deleteWhitespace
(getMessage(menu.getTitle()));

To:
String domId =
StringUtils.deleteWhitespace(getMessage
(menu.getName()));

This worked for me! I was having problems because
some of my menu titles were the same and since menu
name should be unique, I would think it would be better
to use name.

2. In the displayComponents method the following code
is putting an extra </li> in the html. I commented it out
and it cleaned up the html.

Here is the lines that I commented out:

if (i==(components[i].getMenuComponents().length-1))
{ // last one
out.println("</li>");
}

Comments

Date: 2006-03-23 07:27
Sender: derich
Logged In: YES
user_id=1484064

I experienced the same issue with this double menu titles in
2.3. A change of this in future releases would be quite nice.
:)
I also prefer his recommendation to use the menu name
instead of the title.

Regards

Matt Raible added a comment - 10/May/06 01:48 AM
Fixed - thanks for your suggestions.

Matt Raible made changes - 10/May/06 01:48 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]