Fórum
problem with Making AJAX Request Using Alloy UI In JavaScript
Parth Ghiya, modificado 9 Anos atrás.
problem with Making AJAX Request Using Alloy UI In JavaScript
Junior Member Postagens: 35 Data de Entrada: 02/07/13 Postagens Recentes
Hi
i am a newbie and followed some tutorials for the same topic.
My Requirement: Making AJAX Call in Javascript using Alloy UI
Here is my current situation
In My JavaScript i have written this to make a AJAX Request
var selectedHospitalId = A.one("#" + portletNameSpace + "hospital").get('value');
var portletResourceId=portletNameSpace+"getHospitalistsNames";
var getHospitalistsNames = Liferay.PortletURL.createResourceURL();
getHospitalistsNames.setPortletId(portletNameSpace + "parth");
getHospitalistsNames.setResourceId("test1");
var myAjaxRequest = A.io.request(
getHospitalistsNames.toString(), {
dataType:'text',
method : 'POST',
data : {
hospitalId : selectedHospitalId
},
on : {
success : function() {
}
}
});
But the serveResource Method in my java controller class doesnt get called..!!
Any Leads on the same topic????
i am a newbie and followed some tutorials for the same topic.
My Requirement: Making AJAX Call in Javascript using Alloy UI
Here is my current situation
In My JavaScript i have written this to make a AJAX Request
var selectedHospitalId = A.one("#" + portletNameSpace + "hospital").get('value');
var portletResourceId=portletNameSpace+"getHospitalistsNames";
var getHospitalistsNames = Liferay.PortletURL.createResourceURL();
getHospitalistsNames.setPortletId(portletNameSpace + "parth");
getHospitalistsNames.setResourceId("test1");
var myAjaxRequest = A.io.request(
getHospitalistsNames.toString(), {
dataType:'text',
method : 'POST',
data : {
hospitalId : selectedHospitalId
},
on : {
success : function() {
}
}
});
But the serveResource Method in my java controller class doesnt get called..!!
Any Leads on the same topic????
Pankaj Kathiriya, modificado 9 Anos atrás.
RE: problem with Making AJAX Request Using Alloy UI In JavaScript
Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
Any JS error you are getting in browser's error console?
Parth Ghiya, modificado 9 Anos atrás.
RE: problem with Making AJAX Request Using Alloy UI In JavaScript
Junior Member Postagens: 35 Data de Entrada: 02/07/13 Postagens Recentes
Nope...
The request is successful with status :200 ok
but the call doesnt go to serveResource in java controller class...
The request is successful with status :200 ok
but the call doesnt go to serveResource in java controller class...
Pankaj Kathiriya, modificado 9 Anos atrás.
RE: problem with Making AJAX Request Using Alloy UI In JavaScript
Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
You have set portletId in resourceUrl. Do you have any such portlet? Itseems you have set wrong portletId in resourceUrl.
Parth Ghiya, modificado 9 Anos atrás.
RE: problem with Making AJAX Request Using Alloy UI In JavaScript
Junior Member Postagens: 35 Data de Entrada: 02/07/13 Postagens Recentes
what should i do then??
Created the ResourceURL in Javascript and then set it's ID...
If i create the ResourceURL in JSP and then pass it to JS, it works fine
Created the ResourceURL in Javascript and then set it's ID...
If i create the ResourceURL in JSP and then pass it to JS, it works fine
Ketan Savaliya, modificado 9 Anos atrás.
RE: problem with Making AJAX Request Using Alloy UI In JavaScript
Regular Member Postagens: 117 Data de Entrada: 03/03/11 Postagens Recentes
It's better to do bellow way..
if you want to set portletId in js then do like..
var portletId = "<portlet:namespace />";
portletId = portletId.substring(1,portletId.length-1);
Then set it to your resource url...
getHospitalistsNames.setPortletId(portletId);
HTH!!
Regard's
Ketan Savaliya
parth:
create the ResourceURL in JSP and then pass it to JS, it works fine
if you want to set portletId in js then do like..
var portletId = "<portlet:namespace />";
portletId = portletId.substring(1,portletId.length-1);
Then set it to your resource url...
getHospitalistsNames.setPortletId(portletId);
HTH!!
Regard's
Ketan Savaliya
Parth Ghiya, modificado 9 Anos atrás.
RE: problem with Making AJAX Request Using Alloy UI In JavaScript
Junior Member Postagens: 35 Data de Entrada: 02/07/13 Postagens Recentes
Hi ..
I am passing the portlet namespace from JSP to JS and i am sure i am passing the right portlet:Namespace !
problem is call doesnt go to the serveResource Method in java controller class
I am passing the portlet namespace from JSP to JS and i am sure i am passing the right portlet:Namespace !
problem is call doesnt go to the serveResource Method in java controller class