PDA

View Full Version : Javascript form.submit failed in IE with AbstractWizardFormController



nico drapier
Mar 4th, 2009, 08:21 AM
Help!!!!!

I have a problem using javascript with AbstractWizardFormController in IE

I use a wizard with 2 pages.
The first page contains a form with some fields, a Dojo dataGrid. and some submit buttons (two _finish buttons and a _target1 button)

When you click an item on the datagrid I want to view the details of it into the second page.

So for that i wrote a small javascript
like this :


function getDetails(e) {
var _grid = dijit.byId('gridNode');
var _row =_grid.getItem(e.rowIndex);
var item = _grid.store.getValue(_row, 'internalID');
var form = document.getElementById('residentQuestionnaireFrm' );
form.action = form.action+'&selectedItem='+item+'&_target1';
form.submit();
};


this works fine in Mozilla FireFox but not in IE.

After debugging the code I found in my ParameterMap a key and value _finish and also my key and value _target1
I looks like IE gets first the _finish parameter before de _target1 and therefor calls the processFinish function and not the getTargetPage function.

Is there anyway to solve this problem?

nico drapier
Mar 4th, 2009, 10:33 AM
All,

I have found a temporary solution, I override the isFinishReqsuest()


@Override
protected boolean isFinishRequest(HttpServletRequest request) {
if (WebUtils.hasSubmitParameter(request, "selectedItem") &&
WebUtils.hasSubmitParameter(request, "_target1")) {
return false;
}
return super.isFinishRequest(request);
}


I don't know where to report the Bug.
even when you set the form.action to _target1,
a javascript form.submit() in IE browser put the _finish button in the the request.ParameterMap.
Mozilla FireFox doesn't.