Anchors are used as menu items on webpage. inside ui.xml it look like
this.

<div id="topmenu" >
        <g:InlineLabel addStyleNames="{style.namespacing}"
                ui:field='loggedInName' visible='false'>WOOP!</g:InlineLabel>
        <g:Anchor ui:field="contact">
                <span style="cursor:pointer;margin-right:5px;">Kontakt</span>
        </g:Anchor>
        <g:Anchor ui:field="sitemap">
                <span style="cursor:pointer;margin-right:5px;">Sitemap</span>
        </g:Anchor>
        <g:Anchor ui:field="login" visible="true">
                <span style="cursor:pointer;margin-right:5px;">Log In</span>
        </g:Anchor>
        <g:Anchor ui:field="logout" visible="false">
                <span style="cursor:pointer">Log Ud</span>
        </g:Anchor>
</div>

inside class click on anchor is handled like this. The thing to notice
here is that a new History items is added.

        @UiHandler("contact")
        void onClickContact(ClickEvent e) {
                MainIndexInstance.runAsyncAction(new MainIndexAction() {

                        @Override
                        public void handle(MainIndexInstance ins) {
                                contentArea.clear();
                                Contact contact = ins.getContact();
                                History.newItem("contact", false);
                                contentArea.add(contact);
                        }
                });
        }

now the styling lokks like this.

                #topmenu a {
                color:gray;
                }
                #topmenu a:link {
                color:#0090cd;
                }
                #topmenu a:visited {
                color:#0090cd;
                }
                #topmenu a:hover {
                color:#0090cd;
                }

                #topmenu a:active {
                        color:#0090cd;
                }

Hover on the links work as intednded the color changes, but when you
press on the link the active or visited styling doesn't apply. My
guess is it has something to do with adding new History item. It would
be nice to hear other ideas on why this might happen and maybe even
how to solve it.

-- 
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-tool...@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