This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes concatenation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "concatenation" Watch "concatenation" New topic
Author

concatenation

bibsie kau
Greenhorn

Joined: Jan 31, 2005
Posts: 2
hi
i have a for loop, in wich im creating a submenu dynamically.

how do i make the values of this menu unique?

HoverMenuItem instance need to be unique.
I thought of doing this:
HoverMenuItem itemDept = itemSubDept.addMenuItem("dept", value);

for(int i=0; i< reslist.size(); i++){
value = reslist.get(i).toString();
HoverMenuItem itemDept = itemSubDept.addMenuItem("dept", value);
}
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

OK, so you thought of doing that... does that work? What happens? What do you want to happen instead? And what is a HoverMenuItem, and does that matter?


[Jess in Action][AskingGoodQuestions]
Priyaa V Kumar
Ranch Hand

Joined: Aug 12, 2004
Posts: 32
You can add the value of loop variable to the menuitem's name



The menuitems would be created with names dept0, dept1 and so on.

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: concatenation
 
Similar Threads
ejbActivate() and ejbPassivate() methods are called million times!!! :(
XSLT/XPath - Find unique text node value
Company won't pay for the last paycheck
reading from a properties file
Passing checkbox data from JSP to SELECT statement