Tuesday, April 29, 2014

Re: menus with UIBinder

This still looks terrible to me! :-)

Well with Java 8 syntax it will become itm_Login.setScheduledCommand(this::executeLogin());. (without any new ScheduledCommand() { ... })


Well ok personally I would never use MenuBar + MenuItem because I like to have real hyperlinks so I can open things in tabs. I would have used something like FlowPanel + PopupPanel to build the menu and Hyperlink + GWT Places to build the menu items.

Sounds interesting. Can you give an example? 

Eh no sorry, would be too much code. Take a look at http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCheckBox and notice how the URL hash fragment changes when switching menu items. In the showcase a click handler is used on the menu items so you can not open them in tabs. But instead of a click handler you can also use a Hyperlink that contains the hash fragment, e.g. #!CwCheckBox. Then you have an URL that can be opened in tabs easily and the app can put itself into the correct state based on the URL hash fragment.

This Google Groups UI is a good example for having such URLs.

-- J.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment