diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/ui/UIConnector.java | 20 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/ui/VUI.java | 6 |
2 files changed, 11 insertions, 15 deletions
diff --git a/client/src/com/vaadin/client/ui/ui/UIConnector.java b/client/src/com/vaadin/client/ui/ui/UIConnector.java index 3b4e4e1c7c..2a72876924 100644 --- a/client/src/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/com/vaadin/client/ui/ui/UIConnector.java @@ -264,21 +264,17 @@ public class UIConnector extends AbstractComponentContainerConnector implements scrollIntoView(connector); } - if (uidl.hasAttribute(UIConstants.FRAGMENT_VARIABLE)) { - getWidget().currentFragment = uidl - .getStringAttribute(UIConstants.FRAGMENT_VARIABLE); + if (uidl.hasAttribute(UIConstants.LOCATION_VARIABLE)) { + String location = uidl + .getStringAttribute(UIConstants.LOCATION_VARIABLE); + int fragmentIndex = location.indexOf('#'); + if (fragmentIndex >= 0) { + getWidget().currentFragment = location + .substring(fragmentIndex + 1); + } if (!getWidget().currentFragment.equals(History.getToken())) { History.newItem(getWidget().currentFragment, true); } - } else { - // Initial request for which the server doesn't yet have a fragment - // (and haven't shown any interest in getting one) - getWidget().currentFragment = History.getToken(); - - // Include current fragment in the next request - client.updateVariable(getWidget().id, - UIConstants.FRAGMENT_VARIABLE, getWidget().currentFragment, - false); } if (firstPaint) { diff --git a/client/src/com/vaadin/client/ui/ui/VUI.java b/client/src/com/vaadin/client/ui/ui/VUI.java index 096b0b60ba..d650b1734c 100644 --- a/client/src/com/vaadin/client/ui/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/ui/VUI.java @@ -128,11 +128,11 @@ public class VUI extends SimplePanel implements ResizeHandler, public void onValueChange(ValueChangeEvent<String> event) { String newFragment = event.getValue(); - // Send the new fragment to the server if it has changed + // Send the location to the server if the fragment has changed if (!newFragment.equals(currentFragment) && connection != null) { currentFragment = newFragment; - connection.updateVariable(id, UIConstants.FRAGMENT_VARIABLE, - newFragment, true); + connection.updateVariable(id, UIConstants.LOCATION_VARIABLE, + Window.Location.getHref(), true); } } }; |