How to handle Browser History using UiBinder ?

102 views
Skip to first unread message

suresh babu

unread,
Nov 29, 2011, 9:41:43 AM11/29/11
to Google Web Toolkit
Hi All,

Can any one tell me how to handling Token with History using UiBinder (Without MVP).

Any help would be greatly appreciated.

Regards
Suresh Babu G


Thomas Broyer

unread,
Nov 29, 2011, 11:31:01 AM11/29/11
to google-we...@googlegroups.com
UiBinder is about generating widget/layout code from XML, it has nothing to do with handling navigation within your app; i.e. instead of writing:

    this.textBox = new TextBox();
    this.textBox.setText("some text");
    this.textBox.addStyleName(cssResource.textbox());
    String textBoxPlaceholderId = HTMLPanel.createUniqueId();
    HTMLPanel htmlPanel = new HTMLPanel("<label class='" + cssResources.label() + "'>" + SafeHtmlUtils.htmlEscape(myConstants.label()) + " <span id='" + textBoxPlaceholderId + "'></span></label>");
    htmlPanel.addAndReplaceElement(textBox, textBoxPlaceholderId);

    initWidget(htmlPanel);

you simply write:
<g:HTMLPanel>
   <label class="{style.label}"><ui:msg from="{myConstants.label}"/> <g:TextBox ui:field="textBox">some text</g:TextBox></label>
</g:HTMLPanel>

It has really nothing to do with "handing token with history".

suresh babu

unread,
Nov 29, 2011, 11:55:25 PM11/29/11
to google-we...@googlegroups.com
Thank you for your quick reply, so how can I manage history without using MVP framework.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/y5fJNj7KvDgJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Regards
Suresh Babu G



Alexandre Ardhuin

unread,
Nov 30, 2011, 3:00:21 AM11/30/11
to google-we...@googlegroups.com

saida dhanavath

unread,
Dec 1, 2011, 3:45:58 AM12/1/11
to google-we...@googlegroups.com
Hi, 

If you follow MVP or not is not a big matter here, I suggest you to use GWT's Activities and Places framework built only for history management needs.

As Thomas said, UIBinder is nothing to do with history management.

If you which widget container needs to be bookmarked, You can write Place and Activity for that widget container and put all of the onModuleLoad of your module and that's it ActivityManager manages the tokens and getting back the previous status of the UI.


above link helps you in writing Activities and Places, remember your application need not to follow MVP always, but its best practice to manage the application well.

Regards,
Saida. 
--
Regards,
Saida Dhanavath
Reply all
Reply to author
Forward
0 new messages