vendredi 26 août 2016

Using GWT's formPanel in IE 11, the getResults() does not return the real result but the hidden frame's name? It works well in Chrome

I am new for GWT and I have a problem about it, please help. thanks!

I have a web app implemented using GWT. Its function is to retrieve a sub set of data from a DB. Now it works well using Chrome (v 52) but does not work well under IE 11. In IE 11, instead of the requested DB data, the hidden frame's name is given by the getResults() method. Details are as following:

I am using a type of formPanel to contain and provide the selection options, and to receive the requested result (by the hidden iframe created because of the form). Some pseudo codes are as below:

aForm = new HiddenForm(); //HiddenForm() is a customized sub class of formPanel
aForm.addSubmitCompleteHandler(new SubmitCompleteHandler() {
        @Override
        public void onSubmitComplete(final SubmitCompleteEvent event) {
            final String aResult = event.getResults();
                Window.alert("aResult is:" + aResult);
                ...
        }
 });
aForm.addData(...);//a customized method of hiddenform that allows me to provide selection options to DB
aForm.setAction(...); 
aForm.submit();

The 'aResult' content displayed in Chrome seems reasonable, they are some data stored in my DB. But in IE 11, the 'aResult' content is displayed as the hidden frame's name, such as frame_(module name)_1.

The questions are (1) why the code does not work well in IE, and (2) why it behaves differently between IE and Chrome?

I have done a few 'research' on this issue below. No conclusion yet.

  1. I have manually added a submit button (GWT style) into the 'aform' as well as the rootPanel, as mentioned here: GWT FormPanel not submitting in IE - works fine on FF, Chrome, Safari. Also I have tried to change the order between adding the 'aform' to its parent (rootPanel) and adding elements to the 'aform'. But neither of the tries help.

  2. I have observed the DOM content during the running time, under both IE and Chrome. In Chrome, both the form I submitted and its relevant (hidden) iframe were created and manipulated as my expectation in timeline. But in IE, from its developer tool (F12), it seems the form I submitted, the 'aform', was not added into the dynamic DOM while only the relevant iframes are added; BUT, at a moment during the running time, when I was click the refresh button of that IE's developer tool, it seems the content of the 'aform' is actually there, being added. The point is that, showing the update of the iframe in DOM does not need clicking the refresh button while showing the update of the 'aform' does need that. I just cannot tell the exact status of the DOM in IE at the running time.

  3. In the customized HiddenForm class, in its submit() method, the result is handled as well: in the relevant onSubmitComplete() method, the added 'aform' is removed from its parent. So in this way, at the end of one trial of the run, the added personal forms, the 'aform'(s), will be removed. I have once commented this "removing" process, so the added 'aform' (s) were still there in the client-side page when I have finished one trial of the run. But, still the same problem there in IE, no real result sent back but only the iframe's name.




Aucun commentaire:

Enregistrer un commentaire