:: Forum >>

Posting not working with AW.HTTP.Request

Hey I am unable to get the request object to post to another url. When I click on the button it does nothin.

var obj5 = new AW.UI.Button;
obj5.setId("button");
obj5.setControlText("Log On");
obj5.onClick = function()
{
var req = new AW.HTTP.Request;
req.setURL("userinfo.jsp");
req.setUsername("user");
req.setPassword("pass");
req.setRequestMethod("POST");
req.request();
};
obj5.refresh();
michael( newpublicsphere )
Wednesday, May 23, 2007
Any updates on this. I am facing similar problem
Viswanath AT
Viswanath AT
Thursday, August 23, 2007
This might help:

http://www.activewidgets.com/javascript.forum.13995.9/how-can-i-send-a.html

Karl Thoroddsen
Thursday, August 23, 2007
I want to call another jsp on click of a button and I also tried XML.Table
login.onClick = function logg()
{
var req = new AW.XML.Table;
req .setURL('loginval.jsp');
req .setRequestMethod('POST');
req .setParameter('uid', uname.getControlText());
req .setParameter('pwd', pname.getControlText());
req .request();
};
This does nothing when I use with AW.XML / AW.HTTP.
Only if I add the following, the second jsp is executed but gets loaded in the first jsp itself.
req .response = function(text)
{
document.open();
document.write(this.getResponseText());
document.close();
};

1. Do we need to have <FORM METHOD=POST ACTION="loginval.jsp">
also?

2. How do we get the second jsp loaded on click of a AW.Button?

3. Is there any other way to pass parameters to another jsp, instead of appending them in URL?
Viswanath AT
Friday, August 24, 2007
If you want to navigate to another page you should just use

window.location = newURL;

When you send a request with AW.HTTP.Request class the result is returned in response() callback, it does not change the content of the current page.
Alex (ActiveWidgets)
Friday, August 24, 2007

This topic is archived.


Back to support forum

Forum search