This is Vaadin's official solution to multi-tabs and out of sync problem:
https://vaadin.com/web/joonas/wiki/-/wiki/Main/Supporting+Multible+Tabs#_36_messageScroll1791001
If I remove the line
w.open(new ExternalResource(w.getURL()));
in the presented code, the application webpage is not refreshed when opening additional tabs, I don't get a different url for application tab and I got no "out of sync" errors so far.
I don't see the relation between having a separate window class (and isolating window-specific state in this class) to the fact of having a different app url for each tab that opens the application.
Is the code above required?
Thanks in advance.
Related
I'm trying to make a really simple app for a friend to display his bar's ordering website in an app for when they reopen with the social distancing measures in place. The web app already exists, so this is really a simple matter of displaying the content in a WebView.
I've got the page loading, the content is visible, the styling is done - The only problem is that it doesn't seem to be loading all the elements. There's a line of filters at the top which just display as 3 dots (i.e. loading), and when I click any of the items on the menu, nothing happens. There should be a window pops up asking for a table number etc... If I open this in the Chrome browser on my phone, rather than a webview in the app it works perfectly so I know it isn't the website.
I've done the following;
setJavaScriptEnabled(true);
setJavaScriptCanOpenWindowsAutomatically(true);
setSupportMultipleWindows(true);
I've also turned off safe browsing in the manifest in case that was blocking anything. I have also given the app permissions to use the internet. I can't figure this one out at all and nothing online seems to be helping!
Admittedly I'm a tester (automated, but still), so coding isn't my best suit. I may be missing something really simple here. Any ideas?
Scratch that. For anyone who's interested, I needed to add this line;
setDomStorageEnabled(true);
For such a simple thing it proved impossible to find info on, I just enabled everything until something worked! So hopefully you don't have to do the same if you're looking at this.
First of all, sorry for the "context" in the question title, I didn't know which word to use. I successfully launch my app by clicking over a URL from another application, but when I launch the task manager I realize that my application is not actually loaded: the caller app holds the activities. I would like how to:
Launch my app in a different "context" (sorry for the word again, which would be better?)
Be able to reload my app in the case it was already loaded (something like restarting it).
Thank you so much.
You can modify the behavior by setting "launchMode" attribute in AndroidManifest.xml to either "singleTask" or "singleInstance", both would cause your Activity to be created as the root of a new task. However it doesn't restart the Activity if it exist already, instead you should handle the Activity.onNewIntent(Intent intent) callback.
To learn more on launchMode see here: http://developer.android.com/guide/topics/manifest/activity-element.html#lmode
In addition to launchMode that Kai mentioned, you might also want to look at taskAffinity and allowTaskReparenting, depending on how your app is structured.
This is an excerpt from there that seems to match how you describe your app:
For example, if an e-mail message contains a link to a web page, clicking the link brings up an activity that can display the page. That activity is defined by the browser application, but is launched as part of the e-mail task. If it's reparented to the browser task, it will be shown when the browser next comes to the front, and will be absent when the e-mail task again comes forward.
I'm learning the NetBeans Platform and I've gone through a few tutorials and started working on a app. I've implemented the login tutorial with some changes which include 3 levels of access for a text editing application. The access levels are User, Admin, and None. Based on access level different options will be available. If the user has None, then I want to stop the window from opening and instead present a dialog indicating they don't have permission to use the module. I can't figure out how to keep the window from loading. The permissions check is within the top component constructor but I don't know how to make the window self-close.
I tried doing an immediate return from the constructor but that leaves an empty tab in the editor area. I've tried this.close(), variations on trying to get the WindowManager, etc., with no luck.
How can I make the window either not open or close immediately?
Call this.close() in the componentActivated() method of the top component. Make sure to call super.componentActivated(); before calling this.close()
So I am learning Google App Engine with Java. When modifying files i realized I dont always see my changes. I try clicking the red button to stop the web application in eclipse and then restarting the application however I dont see the changes. This even happens if i run chrome in incognito mode. I also have the same problem with IE and Firefox (By default i use firefox when developing due to my preference of firebug).
Also at times I will get annoyed with one project and start a new google app engine project. However the GAE will still be running the first one not the second one even though i close the project. Even worse was when i deleted the root project folder I still saw the index.html page though the links were broken for the project i deleted.
I am thinking there are two issues one is that my browser is storing these files in a cache. And the other is that I am not actually restarting the google app engine. Is the right procedure just to click the red square in the console in eclipse or is there something to run on the command line (in windows)?
To be brief , if i want to stop the GAE from in eclipse and restart it to see any changes i made whats the easiest way to do this on windows?
Thanks
edit:
Rumor has it that adding Google Web Toolkit to the project made my App Engine launch show up in the Development Mode pane, where it could be easily be killed or restarted. Is handling this issue this way a wise idea?
Trying out this touch command idea, i was hoping there was a command line way to restart the server similar to ruby on rails
the answer by dragon in this question would be helpful if it had more detail
The red button will stop it. You shouldn't need to run anything from the command line.
What you should do though is look at "Developement Mode" view and confirm nothing is running. It's under Window-->show view -->Other--> Google. Clicking on the gray arrows will show you what is open (running or not). Also, you can press the grey Xs to clear all stopped instances. This should confirm if something is running.
Also, look under run --> run configurations -->server. You have an option to set the port, or have it automatically set. If you are trying to run more than one project, your second one may not start if the first one has already taken the port. Keep that in mind.
As far as your browser storing Dev Mode page in cache, I don't think it can. In fact, if you close the running dev mode in instance your browser page should immediately update reflecting the fact that it has lost a connection. If it doesn't, surely you didn't manage to shut it down.
Ok, so I said the red button will stop it and it will, but you have to get the right red button. If you have more than one instance running, again look at the "Developement Mode" view, there is only one red button and you have to use the grey arrows I mention to get focus on the dev mode instance you want.
It's not really that complicated and you'll have it down by tommorrow!
Here is the Dev. Mode view. You can see I have three instances. The first is actually running, but shows red as there was an error. Clicking the grey grey Xs will get rid of the second two non-running instances and clicking the document icon with one grey x (it's not greyed out), will clear the log from the current running instance and remove the red x as there would then be no errors in the log.
Got it?
I am getting a serious problem with gwt. When I am first launching the server, I am viewing the page but later when refreshing the browser, I am getting a blank page. When I do view source, I see all the required tags such nocache.js and history frame but i get a blank screen
According to me, When you refresh the page, you are not on the home page. So you replace panels on onmodulLoad on the home page, but in other pages main panels is not generated and replaced in browser.
To check my theory. Please insert a System.out.println("isLoading"); start point of onModuleLoad. Be sure In initial case "isLoading" written to console. After try to refresh page. It it isn't written you must load your homepage whenever refreshed browser.
I hope, my solution is clear.