0

How do I generate the URL to navigate to a particular place in slotted? I know that to navigate the current user to a particular place, it would just be (assuming slottedController is defined and pointing to a valid SlottedController instance):

slottedController.goTo(new MyDesiredPlace(param1, param2));

However, my use case is to generate a URL to be inserted into an e-mail, and when the recipient receives the e-mail, they'll click the URL and should be navigated to the specified place. How would I generate such a URL in slotted?

Jeff Evans
  • 1,257
  • 1
  • 15
  • 31
  • As it might not seems constructive I prefer to add this by comment : have you considered not Nesting activities ? http://blog.ltgt.net/gwt-21-activities-nesting-yagni/ implementation example https://github.com/ronanquillevere/GWT-Multi-Activities – Ronan Quillevere Dec 26 '13 at 23:28
  • I fail to see the relevance of this comment. The original question was about how to do something in the Slotted framework, and it stands on its own. Debates over whether or not to use a particular framework are a separate issue. – Jeff Evans Dec 30 '13 at 07:24
  • I know, I just wanted to point out another way of organizing a gwt application when dealing with urls and places. I did not know If you knew about Thomas Broyer article that's all. Sorry if it was no usefull. – Ronan Quillevere Dec 31 '13 at 08:57

1 Answers1

0

SlottedController has two method for helping create Urls: createToken() and createUrl(). The createToken() will create a history token that appears after the #, which can be used with GWT Hyperlink. The createUrl() is the same as the token method, but prepends the current URI, which can be used with Anchor or external links like an email.

As a note, SlottedController can only be run on the client, so there is currently no way to create the URL on the Server side. The URL must be created on the client and passed back to the server.

JeffgNpc
  • 314
  • 4
  • 11