Too much recursion with swfupload - swfupload

I am facing a too much recursion error when using swfupload in IE9. It works for the first time i load the object, but once I navigate to a different part of the site and come back to the upload page, these kinds of calls start occuring:
out of stack space - swfupload.speed.js Line 72:
return this.speedSettings.user_file_queued_handler.call(this, file);
I never unload the swfupload(flash) component specfically from the webapp.
What is going wrong?

Flash object does behave funkily when it is instatiated but not available/hidden on the page.
(see: SWFUpload startUpload() fails if not called within the file_dialog_complete_handler)
So I ended up re-instantiating the object when coming back to the view containing it. Seems to solve the problem.

Related

How to make an eclipse partstack not disappear when the last part is closed?

I'm working on a project with a main window consisting of a mpartstack where I add parts dynamically from another part. The problem is that when the last part gets closed the mpartstack disappears and the other part takes up all the space. When I try to add new parts nothing happens.
I've tried fiddling around with the preDestroy function in the parts that are added to the stack by trying to add a new part. The preDestroy works occasionally but far from satisfactory.
I've looked far and wide to try to find any clue on what to do but I've found nothing except for some bug reports on the matter.
So: can a mpartstack be in a uncloseable state or is there any textbook way to intercept a part that is about to be closed?
Thanks in advance
/K
Add the tag NoAutoCollapse to the MPartStack definition in the model.

How to know UIWebView won't load anymore?

I know that there are delegate methods.
In my case, the scenario is little bit different. When I load my request, there are subsequent calls that happens. So the page get loaded back to back with 3 urls. After that, it stops.
When it is done loading everything, after that actually I wanted to do something like 'autosubmit', which is not possible for mobile browsers. I am looking for a work around. But for that too, I need to make sure that the webView has done loading.
So my question here is, is there any proper way to find out that the web view has finally stopped loading, and then I can try something to do my 'autosubmit' part?
I have an answer to the detecting when the web view is done loading part of your question... Unfortunately, the most reliable method I have found is to increment a counter whenever webViewDidBeginLoad: is called and decrementing it whenever webViewDidFinishLoading: and webViewDidFailWithError: is called. Whenever the counter is equal to 0 you know that the web view is not loading.
Placing this check in the webViewDidFinishLoading: and webViewDidFailWithError: methods will allow you to determine when the web has completed or stopped loading (in the case of a failure).

Reloading an iframe in GWT

I am currently working on a GWT project where I am displaying an HTML file within an iframe in my application. This HTML file is actually being written to as it is getting displayed, and I am hoping to be able to reload the frame so that the changes made to the HTML file are reflected on screen. I am able to do this two different ways that both work when running in development mode, however neither seem to work when the project is deployed.
The first method I tried was setting the frame's URL to itself:
frame.setUrl(frame.getUrl());
The second method I tried using JSNI:
public native void refresh() /*-{
if($doc.getElementById('__reportFrame') != null) {
$doc.getElementById('__reportFrame').src =
$doc.getElementById('__reportFrame').src;
}
}-*/;
When deployed, the frame gets displayed in a Window, and when the file is finished being written to, a call to either of these refresh methods is made, and the frame refreshes to contain the finished HTML file. When I am deployed, the call to refresh does not reload the contents of the frame, however if I bring up the frame's context menu (in Firefox), then go into 'This Frame', and click Reload, it successfully reloads the frame to contain the finished HTML file. I have tested this on multiple versions of Firefox without any luck.
Does anyone have any suggestions? Why would the behavior be different from one mode to the other?
Thanks.
wow, google is really fast with his search^^
You can use some JSNI to do this. Create a method such as
protected native void reloadIFrame(Element iframeEl) /-{
iframeEl.contentWindow.location.reload(true); }-/;
Then call it with your iFrame element
so your question you posted twice was already answerd here
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/64aa7712890652d3
We had a requirement where one GWT application(parent) had another GWT application(child) loaded in an iframe. The child application had to refresh the iframe after it performs certain DB operations. We used JSNI to accomplish the same.
private native void refreshChild(String url)/*-{
$wnd.location.href=url;
}-*/
In case, if the child frame needs to be redirected to another webpage, the url can be modified accordingly.
We did try to use the reload() method, but it did not help.
The above piece of code, of course needs to be written in the child application.

gtkmm-Window remains empty

In our project, we're using gtkmm and we have several classes that extend Gtk::Window in order to display our graphical interface.
I now found out what call produces the behaviour (described in the previous revision. The question now slightly changed.)
We're displaying one window, works like a charm.
Then, we have a window which displays various status messages. Let's call it MessageWindow. It has a method setMessage(Glib::ustring msg) which simply calls a label's set_text().
After some processing, we hide this window again and we now show a toolbar. Just yet another simple window, nothing crazy.
For all windows applies: The main thread calls show() on the window and creates a new thread which calls Gtk::Main::run() (without argument).
That's how it should be, until now.
The problem starts here: The main thread now wants to call MessageWindow::setMessage("any string"). a) if I call this method, the message window reacts completely correctly. But afterwards, the toolbar-window is displayed empty. b) if I don't call it, the message window doesn't change the label (which is absolutely clear), and the toolbar window is displayed as it should.
Seems like the windows are messing up each other.
Now the question:
If my gui-thread is blocking in Gtk::Main::run(), how can I now change the text of a label?
We're using gtkmm-2.4 (and no, we cannot upgrade)
Any help is appreciated.
Wow! That's complicated...
First: you should not manipulate windows from several threads. That is you should have just one GUI thread that does all the GUI work, and let the other threads communicate with it.
It is theoretically possible to make it work (in Linux; in Windows it is impossible) but it is more trouble than it is worth.
Second: the line Gtk::Main main(argc, argv) is not a call, it is an object declaration. The object main should live for the duration of the program, so if you use it in a object constructor, as soon as you return from it, the object will be destroyed! Just put it at the top of the main function and forget about it.
UPDATE: My usual approach here is to create a pipe, a g_io_channel to read, and write bytes on the other end.
Other option, although I didn't test it is to call get the GMainContext of the main thread and then g_idle_source_new() and attach that source to the main context with g_source_attach(). If you try this one and it works, please post your result here!

GWT MVP Presenter Unable to Update View Listbox Component

I am writing a GWT MVP application using the gwt-platform library (very nice once you get used to it). My issue occurs when my presenter attempts to update the contents of a Listbox. The problem occurs on line 66 of the below file:
https://github.com/dartmanx/mapmaker2/blob/master/src/main/java/org/jason/mapmaker/client/presenter/MapmakerStackPanelPresenter2.java
I am sure that the application is calling the onSuccess() method (a breakpoint in the debugger works), and that the result is populated.
One thing I've noticed is that the associated view, MapmakerStackPanelViewImpl2.java, seems to be initialized twice. I find myself wondering if I'm trying to update a control on that view that is not attached to the actual user interface. That file is here:
https://github.com/dartmanx/mapmaker2/blob/master/src/main/java/org/jason/mapmaker/client/view/MapmakerStackPanelView2.java
Any help would be appreciated.
The problem was that there were two copies of the view floating around. I used Gin to inject the view into the constructor of the presenter, and problem went away.