/** * Update the state of your existing page without performing a full navigation. * <br/> * This will perform a pseudo navigation updating the history token with the new states. */ public void updateState(Multimap<String, String> state) { if(currentPage != null) { currentPageToken = historyTokenFactory.createHistoryToken(currentPage.name(), state); HistoryWrapper.newItem(currentPageToken.toString(), false); currentPage.pageUpdate(currentComponent, currentPageToken); } else { logger.error("Cannot update the state before a page has loaded."); } }
private <C> void navigate(final PageNode<C> toPageInstance, final Multimap<String, String> state) { final HistoryToken token = historyTokenFactory.createHistoryToken(toPageInstance.name(), state); logger.debug("Navigating to " + toPageInstance.name() + " at url: " + token.toString()); navigate(new Request<>(toPageInstance, token), true); }
/** * Update the state of your existing page without performing a full navigation. * <br/> * This will perform a pseudo navigation updating the history token with the new states. */ public void updateState(Multimap<String, String> state) { if(currentPage != null) { currentPageToken = historyTokenFactory.createHistoryToken(currentPage.name(), state); HistoryWrapper.newItem(currentPageToken.toString(), false); currentPage.pageUpdate(currentComponent, currentPageToken); } else { logger.error("Cannot update the state before a page has loaded."); } }
private <C> void navigate(final PageNode<C> toPageInstance, final Multimap<String, String> state) { final HistoryToken token = historyTokenFactory.createHistoryToken(toPageInstance.name(), state); logger.debug("Navigating to " + toPageInstance.name() + " at url: " + token.toString()); navigate(new Request<>(toPageInstance, token), true); }
/** * Initialize the anchor's href attribute. * * @param toPage * The page type this transition goes to. Not null. * @param state * The page state. Cannot be null (but can be an empty multimap) */ private void initHref(Class<P> toPage, Multimap<String, String> state) { PageNode<P> toPageInstance = navigation.getNavGraph().getPage(toPage); HistoryToken token = htFactory.createHistoryToken(toPageInstance.name(), state); String href = "#" + token.toString(); setHref(href); }
/** * Initialize the anchor's href attribute. * * @param toPage * The page type this transition goes to. Not null. * @param state * The page state. Cannot be null (but can be an empty multimap) */ private void initHref(Class<P> toPage, Multimap<String, String> state) { PageNode<P> toPageInstance = navigation.getNavGraph().getPage(toPage); HistoryToken token = htFactory.createHistoryToken(toPageInstance.name(), state); String href = "#" + token.toString(); setHref(href); }