Fórum

How to pass query string in Iframe portlet dynamically

Sumalatha N, modificado 9 Anos atrás.

How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 31 Data de Entrada: 30/01/13 Postagens Recentes
Hi,
I have configured iframe portlet, if i need to send query string dynamically how can i pass it?

Thanks,
Sumalatha
thumbnail
Zsigmond Rab, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Sumalatha,

I think, you could write a hook for modifying the IFrame portlet and put the dynamic parameters together somehow for example in a modified init.jsp of that.

Regards,
Zsigmond
Sumalatha N, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 31 Data de Entrada: 30/01/13 Postagens Recentes
Hi Zsigmond,

Actually i need to pass query string dynamically from search portlet to iframe portlet.
How can i configure URL for this?
for example if my URL is: http://www.example.com/testresults/index.html?querystring=test

when i configure URL,"http://www.example.com/testresults/index.html" default page is loading in iframe portlet, but i need to append query string from search portlet to iframe portlet and display results.

any ideas please?
thumbnail
Zsigmond Rab, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Sumalatha,

I meant that to modify the init.jsp file to modify the src preference with extending the original url with parameters.

However, it's possible to pass parameters to the iframe's src url dynamically also as the LPS-2918 ticket specifies.

I hope it helps.

Regards,
Zsigmond
Sumalatha N, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 31 Data de Entrada: 30/01/13 Postagens Recentes
Hi Zsigmond,
Thanks for the information.
I have modified init.jsp and finally i am able to pass parameters to iframe dynamically.
thumbnail
michael hamlett, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 30 Data de Entrada: 23/05/13 Postagens Recentes
can you send me the change you made?
thanks

mhamlett@goldencorral.net
sumalatha N, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 31 Data de Entrada: 30/01/13 Postagens Recentes
Hi michael,

Following are the steps to configure Iframe portlet:
1. Added Iframe portlet on home page
2. Configured URL for Iframe portlet without query string
http://localhost:8090/testpag/results/
3.Send query string value dynamically
<input name="iframe_query" id="iframe_query" type="hidden" value="dynamic value" />
_query is my parameter name

you can set dynamic value after submitting form also
document.getElementById("iframe_query").value=encodeURI(dynamic value);

hope you understand
sumalatha N, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 31 Data de Entrada: 30/01/13 Postagens Recentes
sumalatha N:
Hi michael,

Following are the steps to configure Iframe portlet:
1. Added Iframe portlet on home page
2. Configured URL for Iframe portlet without query string
http://localhost:8090/testpag/results/
3.Send query string value dynamically
<input name="iframe_query" id="iframe_query" type="hidden" value="dynamic value" />
_query is my parameter name

you can set dynamic value after submitting form also
document.getElementById("iframe_query").value=encodeURI(dynamic value);

step3 you can do from which ever page you want to send dynamic value.

hope you understand
thumbnail
michael hamlett, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

Junior Member Postagens: 30 Data de Entrada: 23/05/13 Postagens Recentes
<input name="iframe_query" id="iframe_query" type="hidden" value="dynamic value" />
_query is my parameter name

where do you code this?

I want to go to a page on the liferay portal with an IFRAME
http://localhost:8080/testpage?storenumber=1

on the testpage is an IFRAME portlet that calls the URL http://another.com/storedisplay.aspx?storenumber=?

I want to pass the "1" to the storedisplay.aspx page
so the iframe now shows the results of storedisplay.aspx?storenumber=1

michael
Nunglen Photo, modificado 9 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

New Member Mensagem: 1 Data de Entrada: 07/06/14 Postagens Recentes
It’s such a pleasure to teach when you work like that!

_________________________________________________________________________

I like this site Free4stuff.net so much. Nice to see you all.
thumbnail
Diego García, modificado 8 Anos atrás.

RE: How to pass query string in Iframe portlet dynamically

New Member Postagens: 5 Data de Entrada: 01/08/14 Postagens Recentes
The Liferay documentation shows how to do that:
https://www.liferay.com/es/community/wiki/-/wiki/Main/Iframe+Portlet
This documentation works for me, using Liferay 6.2

But there are two important things to have in mind in the URL construction:
  • The value for the parameter p_p_id must not begin with underscore.
  • The rest of the parameters must begin with underscore.

Example:
I had a page /hotel with one iframe portlet with the namespace:
_48_INSTANCE_3hqzfAF7JyXE_ (I saw that namespace in the portlet option: Look and feel > advance styling)
I needed to pass the dynamic parameter trDate to the iframe.

With that info, this URL worked for me:
http://192.168.13.6:8080/en/web/guest/hotel?p_p_id=48_INSTANCE_3hqzfAF7JyXE&_48_INSTANCE_3hqzfAF7JyXE_iframe_trDate=20160302