PDA

View Full Version : redirect with post



MichaelOstrovsky
2 May 2010, 9:45 AM
Is there any extjs utility /addon to redirect to another page with post data ?

I need if for seamless data transport between https page (login) and http page(application) , and don't want the data to be displayed on URL string ( which happens on GET ).
Double-refresh of the main page (to cleanup any params ) is not an option.

I know it can be done by emulating form submission.. but i'm not sure if my append & submit of form DOM will be reliable & cross-browser.

Thanx.

UPDATE:
Post-redirect appears to cause browser warnings when refreshing the target page, so i decided to use the "window.name" transport method.

anyway, if someone needs a redirect with post data ( without any warranty ):

Ext.DomHelper.append(
Ext.getBody(),{
tag:'form',
name:'transportform',
id:'transportform',
action:"TARGETURL",
method:"POST",
cn:{
tag:'input',
type:'hidden',
name:'POST_PARAMETER',
value:'VALUE'
}
}).submit();

wm003
3 May 2010, 2:35 AM
Real redirect happens serverside, but you could try to change the url given in the Ext.form.FormPanel


url:'http://myapplicationserver/mypage.php', //or jsp, asp, pl, whatever...

instead of


url:'mypage.php', //or jsp, asp, pl, whatever...