Hello,

I am trying to use a HorizontalPanel for a navigation bar that I am
building with a loop.  The code looks like this:

<code>
                HorizontalPanel navigation = new HorizontalPanel();
                int count = 0;
                for (final String name : artists.keySet()) {   // artists is an
instance of a LinkedHashMap<String, Object>
                        count++;

                        // create the link
                        Anchor link = new Anchor(name, "");
                        if (artists.size() == count) {
                                link.addStyleName("last");
                        }
                        link.addClickHandler(new ClickHandler() {

                                public void onClick(ClickEvent event) {
                                        /// ...
                                }

                        });
                        // add to navigation
                        navigation.add(link);
                }
</code>

If there is only 1 item in the list of artists it works, however if
there is another one added nothing shows up.  I tried debugging it in
eclipse and the only thing odd (when i inspected navigation) is that
the text in navigation>children>array>[1]=Anchor (id=474) shows up red
(where [0]=Anchor (id=470) shows up black).  Also the size property of
the children says 2 but is also in red.

The toString() of navigation shows the table with the 2 anchors
properly added, just doesnt show up on the page.


Also, I am new to GWT so any suggestions on code improvement for
accomplishing the above would be appreciated.



Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to