Foros de discusión
how to pass parameter using Resourceresponse from jsp to java page
Rewati Raman, modificado hace 11 años.
how to pass parameter using Resourceresponse from jsp to java page
Junior Member Mensajes: 97 Fecha de incorporación: 24/02/12 Mensajes recientes
i have to pass two value from jsp to portlet class
using
<aui: input> and <aui:button>
and i want to retreive it in portlet class
as my basic requirement is to download a file as per the submited value on client side i am using resourceresponse
but i couldnt able to pass the value
i can able to pass using actionrequest but i wont able to use resourceresponse and viceversa
so pls give some suggestion im in need
using
<aui: input> and <aui:button>
and i want to retreive it in portlet class
as my basic requirement is to download a file as per the submited value on client side i am using resourceresponse
but i couldnt able to pass the value
i can able to pass using actionrequest but i wont able to use resourceresponse and viceversa
so pls give some suggestion im in need
David H Nebinger, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Resource request does not receive the parameters from forms that the action request gets.
You'll have to manually build your parameters and append them to the resource request url.
You'll have to manually build your parameters and append them to the resource request url.
Rewati Raman, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Junior Member Mensajes: 97 Fecha de incorporación: 24/02/12 Mensajes recientes
sir,
if u hava any sample for that code then it would be very great for me because im stuggling to solve that issue
how should i use resourse response with action request
so that i could retreive value using actionresponse and and give the downloading popup to jsp page using resourceresponse
if u hava any sample for that code then it would be very great for me because im stuggling to solve that issue
how should i use resourse response with action request
so that i could retreive value using actionresponse and and give the downloading popup to jsp page using resourceresponse
David H Nebinger, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Two separate things. When you're within an action handler, you're not connected to a resource request.
Your page is the one that issues requests, so the page will have the urls for either the action or resource request.
Your page is the one that issues requests, so the page will have the urls for either the action or resource request.
Rewati Raman, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Junior Member Mensajes: 97 Fecha de incorporación: 24/02/12 Mensajes recientes
thanks for response,
but is there any way that i could pass the values from jsp to filter the data and generate the file using resourseresponse
im not getting any solution for that
but is there any way that i could pass the values from jsp to filter the data and generate the file using resourseresponse
im not getting any solution for that
Amit Doshi, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
The code that I written above will pass the Value From jsp only.
Now what you need to do in the background, it depends on you. You can filter or Generate the file using I/O .
Now what you need to do in the background, it depends on you. You can filter or Generate the file using I/O .
Amit Doshi, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Hi Rewati,
The Below is the code for making the Call for ResourceURL with Javascript
On Button Click Call JavaScript Function as follows
Now on the ServeResource method you can get the value using below code
Your work is done now. You will get the Required Parameter using ajax.
Hope it helps.
Thanks & Regards,
Amit Doshi
The Below is the code for making the Call for ResourceURL with Javascript
<portlet:resourceurl var="SubmitURL" />
<input type="text" name="txt1" id="txt1">
<input type="button" onclick="helpful();" value="Submit">
On Button Click Call JavaScript Function as follows
function helpful()
{
var textvalue=document.getElementById('txt1').value;
$.ajax ({
url:'<%=SubmitURL%>',
type: 'POST',
data : ({
textVal: textvalue
}),
success: function()
{
alert('success');
}
});
}
Now on the ServeResource method you can get the value using below code
final String textValue= resourceRequest.getParameter("textVal");
Your work is done now. You will get the Required Parameter using ajax.
Hope it helps.
Thanks & Regards,
Amit Doshi
Rewati Raman, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Junior Member Mensajes: 97 Fecha de incorporación: 24/02/12 Mensajes recientesAmit Doshi:
Hi Rewati,
The Below is the code for making the Call for ResourceURL with Javascript<portlet:resourceurl var="SubmitURL" /> <input type="text" name="txt1" id="txt1"> <input type="button" onclick="helpful();" value="Submit">
On Button Click Call JavaScript Function as followsfunction helpful() { var textvalue=document.getElementById('txt1').value; $.ajax ({ url:'<%=SubmitURL%>', type: 'POST', data : ({ textVal: textvalue }), success: function() { alert('success'); } }); }
Now on the ServeResource method you can get the value using below codefinal String textValue= resourceRequest.getParameter("textVal");
Your work is done now. You will get the Required Parameter using ajax.
Hope it helps.
Thanks & Regards,
Amit Doshi
thanks for ur response and ill try to implement it
Pradeep Kumar Badhai, modificado hace 11 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Junior Member Mensajes: 50 Fecha de incorporación: 6/09/11 Mensajes recientes
I am also looking for something similar to this problem: how to pass parameter using Resourceresponse from jsp to java page. I have also the same issue, I tried to mock the input value in JSP, It works. I am using Spring MVC portlet
<portlet:resourceURL var="JSPResourceURL">
<portlet:param name="system" value="APP" />
<portlet:param name="mngmtCo" value="NA" />
<portlet:param name="beginDate" value="01/01/2007" />
<portlet:param name="endDate" value="01/01/2013" />
</portlet:resourceURL>
5th request is in the dropdown list about kind of report, HTML / PDF / EXCEL
This works but this is just test for one set of input, Client cannot input the different record from screen. For this if any solution, Please let me know.
Thanks you in advance
Pradeep
<portlet:resourceURL var="JSPResourceURL">
<portlet:param name="system" value="APP" />
<portlet:param name="mngmtCo" value="NA" />
<portlet:param name="beginDate" value="01/01/2007" />
<portlet:param name="endDate" value="01/01/2013" />
</portlet:resourceURL>
5th request is in the dropdown list about kind of report, HTML / PDF / EXCEL
This works but this is just test for one set of input, Client cannot input the different record from screen. For this if any solution, Please let me know.
Thanks you in advance
Pradeep
Razeena P, modificado hace 7 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
New Member Mensajes: 11 Fecha de incorporación: 8/08/16 Mensajes recientes
Hai Mr. Pradeep...
Even I'm facing the same problem . Did u fix this issue? If so can you please help to solve the corresponding.
Thank You in advance
Razeena P
Even I'm facing the same problem . Did u fix this issue? If so can you please help to solve the corresponding.
Thank You in advance
Razeena P
Pradeep Sharma, modificado hace 7 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
Junior Member Mensajes: 50 Fecha de incorporación: 6/09/11 Mensajes recientes
Hello,
function passParameterUsingResourceURL(parameter1, parameter2){
var pouupUrl = "<%=HtmlUtil.escapeJS( passParameterUsingResourceURL.toString()) %>" +"&<portlet:namespace/>parameter1=" + parameter1;
AUI().use('aui-base','aui-io-plugin-deprecated','liferay-util-window','liferay-portlet-url','aui-dialog-iframe-deprecated',function(A) {
popUpWindow=Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view: true,
modal: true,
resizable: false,
width:860,
height:700,
}
}
).plug(
A.Plugin.IO,
{
autoLoad: false
}).render();
popUpWindow.show();
popUpWindow.titleNode.html("Copy Filter [" + parameter2 + "]" );
popUpWindow.io.set('uri',pouupUrl);
popUpWindow.io.start();
});
}
Hope this will give some idea how to pass parameter using ResourceURL.
function passParameterUsingResourceURL(parameter1, parameter2){
var pouupUrl = "<%=HtmlUtil.escapeJS( passParameterUsingResourceURL.toString()) %>" +"&<portlet:namespace/>parameter1=" + parameter1;
AUI().use('aui-base','aui-io-plugin-deprecated','liferay-util-window','liferay-portlet-url','aui-dialog-iframe-deprecated',function(A) {
popUpWindow=Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view: true,
modal: true,
resizable: false,
width:860,
height:700,
}
}
).plug(
A.Plugin.IO,
{
autoLoad: false
}).render();
popUpWindow.show();
popUpWindow.titleNode.html("Copy Filter [" + parameter2 + "]" );
popUpWindow.io.set('uri',pouupUrl);
popUpWindow.io.start();
});
}
Hope this will give some idea how to pass parameter using ResourceURL.
Razeena P, modificado hace 7 años.
RE: how to pass parameter using Resourceresponse from jsp to java page
New Member Mensajes: 11 Fecha de incorporación: 8/08/16 Mensajes recientes
Thanks for your reply....Its working fine