How to find out browser back button click using gwt history - gwt

I m using history listener for forward and back browser button.But i m not able to find out history back button click.If any idea plz rply..urgent for me...Thank you..

Your code can use the tokens sent by History management system to determine what kind of action you want to take. Suppose you are at page1 and that page is identified by the token 'page1'. Now, you move to page2. If you click the back button, you will receive the token 'page1'. You can use this to set the state related to page1. See this Google doc for more info.

Related

How can I have a separate setup process and home page in Flutter?

I am currently building an app that has a first page with two buttons: 'New users -->" and "Existing users -->". The goal is for new users to click their button and go through a setup process that ends with their home page that is saved when the app is closed. The next time a user opens the app, once they click their existing users button, I want the app to open to the home page the setup process ends at. How do I achieving this? Any help would be appreciated!
You can use GoRouter (from flutter team) plugin for handling this scenario and navigation.
https://pub.dev/packages/go_router
While initialising the router, you can provide redirect where you can handle if user should be navigated to the setup screen or home screen.
Use database / shared preference / secure storage to store whether the setup process was completed and what data was saved.
Now if you are using any framework like GetX or something you can easily navigate to the desired pages or you can use Navigator.to.... if not using a framework.
you can use something like
bool isSetupDone = // get from storage
the use this Boolean value to either alert, show/hide button/ popup message accordingly as per your usecase.

How can I programmatically add a prior state using angular ui router/ionicframework

I'm using ionicframework v1.3.0 (which is using angular-ui-router v0.2.13). After successful login, the user sees a landing page. Sometimes I want to have my user jump to a special page after login, but still be able to navigate to the landing page.
Currently, if I just use a $state.go('/special-page', someParams), then the user will not see the link for the back/home button in the ion-nav-bar. However, if the user clicks a button to navigate to the special page from the landing page, they will see the back/home button. How can I accomplish this? I thought it might be possible to splice/inject the '/landing-page' state in the navigation stack to do so.

TestCafe - Possible to set "preserveUrl" to some own value?

I use two roles in my project.
In Role1, after a couple of clicks, I come to a page with URL1 "http://acc.comp.se/signing-page". On this page, there is a Button "SignWithCustomer".
If I click on that button I will get redirected to a page with URL2 "https://acc.comp.se/LogIn/?returnUrl=webben"
Now, in real life this redirection would be a new tab, i.e. I can always go back to the first tab where URL1 is still present and continue there as if the redirection never happened.
Is there a way to save the URL1, i.e. is it possible to set the preserverUrl to something I want? Like "preserveUrl=ClientFunction(() => window.location.href)"
I want to go back to Url1, the URL just before the last button click. And I want the previous session (before redirect) to be saved.
Please find our example in the corresponding guthub thread, where we discussed a similar inquiry based on your scenario.
At present, TestCafe supports Multiple Browser Windows. You can try this feature in your scenario.

How to duplicate a application window in GWT/GXT?

we have a CRM-like application written in GWT/GXT with help of our library which wraps some GXT widgets like ComboBox or Grid from GXT to simplify interaction with relational database. When the application starts a user have to log in and after successfully login the user can see main horizontal menu and some welcome information. If the user want to do something (e. g. to find a customer) he/she has to click somewhere in the menu and a new GXT modal window appears. Now we want to give the user a possibility to open a new session (e. g. to handle a second customer and visually compare customer's data with the first customer) in a new browser window.
How to do it?
Best Regards,
Jacek
The best way I know to comunicate between browser tabs is to use HTML 5 localStorage. Here is a good tutorial. In GWT you can use gwt-storage to easily manipulate the localStorage.
If you want to open a new Window or browsertab you will need to solve two problems:
You will need to specify the session. This can be done by simply create some kind of session token-cookie. This should be flagged with http-only for security reasons). New windows will send the same cookie (and the user is logged in)
You need to specify the item, you want to show. This can be done by using the history API and store the token in the URL

Spring-webflow error popup tweak

There is a link in a spring-webflow2 based application which start different flows. Flows are shown in popup (popup=true). If the session is expired or server is unavailable, the spring-webflow shows small empty popup with "Ajax Request Error" tooltip shown on mouse over. Is it possible to tweak the popup in order to give the user an ability to either re-login or to just close the popup and retry the request?
EDIT: Or maybe some ideas how to force Spring-Dojo to make a redirect to login page?
The problem is that the session is gone and so is the conversation/flow in it. So there's no easy way to make the popup work again, because the conversation or flow state must be restored. I think the best you could achieve would be to somehow convince Dojo to redirect back to the login url.