RE: Problem with DropDownMenuDisplayer
"Matt Raible" <lists-T7vlz3gD7BdF/EzeuO4KJwC/[email protected]>
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Organization | Raible Designs, Inc. |
| Message-ID | <[email protected]> |
Thanks for all your research Tom. You might want to try changing your
struts-config.xml <messages> tag to add a null="false". That will
display ???missing.key??? instead of null.
http://struts.apache.org/userGuide/configuration.html
Matt
-----Original Message-----
From: struts-menu-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:struts-menu-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
Thomas Bednarz
Sent: Tuesday, June 29, 2004 9:07 AM
To: Struts menu user list
Subject: [struts-menu] Problem with DropDownMenuDisplayer
Matt,
I try to use the simple drop down menu. It works fine with frames too.
But there is one problem: the 'null' behind every unexpanded or leave
menu item. (This is visible on your exemples too!)
The generated code looks like this:
<table width="150px" cellpadding=1 cellspacing=1>
<tr align=left>
<td nowrap class=normal>
<b><label
style="cursor:hand;font-family:verdana;font-size:10px"
onMouseOver="this.style.color='red'"
onMouseOut="this.style.color='black'"
onClick="toggleMenuDisplay(document.getElementById('WNT'),
document.getElementById('WNT_img'))"> <img id="WNT_img"
src="../Images/Rarrow.gif" style="border-style:none"/> Windows NT
</label>
<div id="WNT" style="display:none">
<table cellpadding=0 cellspacing=0>
<tr>
<td>
<b> <a href="null" target="_self"
title="Test Menu 1.1"
style="text-decoration:none;font-family:Helvetica,Arial;font-size:10px">
Test Menu 1.1</a>
</td>
</tr>
</table>
</div>null <-------- where does this come
from?????
</td>
</tr>
</table>
I did some research in the sources and found the following:
In net.sf.navigator.displayer is a file called
DisplayerStrings.properties. There you can find the following two lines:
dd.menu.item.bottom=</table></div>
dd.menu.item.row.start=<tr><td><b>
In the source code I saw, that you read this property in
net.sf.navigator.displayer.DropDownDisplayer.java. It is the last
statement of the method displayComponents(..) [line 149]
The method displayComponents() is called in several of your displayers.
I just looked at the DropDownMenuDisplayer and found to places where it
is called:
if (components[i].getMenuComponents().length > 0) {
if (this.isAllowed(components[i])) {
sb.append(displayStrings.getMessage("dd.menu.expander",
components[i].getName(),
components[i].getName() + "_img",
displayStrings.getMessage("dd.image.expander",
components[i].getName() + "_img",
displayStrings.getMessage("dd.image.src.expand")) +
NBSP + img + title));
displayComponents(components[i], sb);
sb.append(displayStrings.getMessage("dd.menu.restore",
components[i].getName(),
components[i].getName() + "_img"));
} else {
sb.append(displayStrings.getMessage("dd.menu.restricted",
components[i].getName(),
components[i].getName() + "_img",
displayStrings.getMessage("dd.image.expander",
components[i].getName() + "_img",
displayStrings.getMessage("dd.image.src.expand")) +
NBSP + img + title));
}
The red marked code might be a problem if the key dd.menu.restore is not
found. The struts documentation does not say what is returned, if a
message is not found.
Could you please have a look at this and see, if this is the real
problem? Maybe the problem is solved if I simply define the property
dd.menu.restore but I have no idea what the value of this property
should be.
Many thanks for your help.
Tom