which I have attached a back button, for which I have an event handler in my Jeedbluti app history Call the (back) When the event is removed, I can see the URL token being changed in the browser, but History.getToken () For example, if the tokens were added in the order of #A, # B, # C , when I was in # C when I last clicked I'm #b , but getToken says that its # c I think this is not causing the problem of calling the onValueChange method and so my app remains the same. The same is seen when I try with the browser's back button. I am using Firefox, but behavior in other browsers is no different. What could be the reason? My assumption was that history.back () will also destroy onValueChange () , now it seems that only history NewItem () will be able to work, then suggest my mistake if I am wrong. I am confused. How will I handle the Previous Button Events? Anywhere in my app, my code with the current code token # step 3 activates the previous event, so, when it comes to previous events, Tokens) and I have to be back hopefully token Step # 2 and I, It looks like history.back () takes a lame time in (literally Loong, about Lu milliseconds :)) I wrote some code to test it: This type of output in Google chrome It is too large to have no answer for you, but note :)
eventBus.addHandler (PrevEvent.TYPE, new PrevEventHandler () {public void onNext (PrevEvent prevEvent) {History.back () ;. System. Out.println ("token is" + history. Gate token ());}});
eventBus.addHandler (PrevEvent.TYPE, New PrevEventHandler () {public void onNext (PrevEvent prevEvent) {history. Back (); System.out.println ( "token" + history. GetToken ()); doPrev ();}}); Private Zero doPrev () {System.out.println ("Calling Previous Mode"); }
public void onValueChange such onValueChange method (ValueChangeEvent & lt; string & gt; event) {string = Event.getValue (); If (token! = Null) {presenter = faucet; If (token == "step1") {System.out.println ("step1"); // do something else if (token == "step2") {System.out.println ("step2"); // do something else if (token == "step 3") {System.out.println ("step 3"); // do Something}
public void onModuleLoad () {History. NewItem ('A'); History.newItem ("b"); History.newItem ('C'); RootPanel.get (). (New button ( "Back", new Klikhandlr () {@Override public click on zero (ClickEvent event) {System.out.println ( "is" + history KgetToken (to click back token)); History .back (); .schedule (100), the new timer () {} @Override public void run () {println (+ History.getToken () "100 milliseconds after the token")}}})) ; History.addValueChangeHandler (New ValueChangeHandler & LT; string & gt; () {@Override public void onValueChange (ValueChangeEvent & LT; string & gt; event) {println (+ History.getToken ". We handle ValueChangeEvent the history token" ());}}); }
is click back Token Token 100 million after the C C we treat ValueChangeEvent History I now click the token B. token B we treat ValueChangeEvent history. Now after Token A, there is 100 million tokens after A and click back token. We handle ValueChangeEvent on history. Now token C after 100 million tokens C
Comments
Post a Comment