Hi all,
I have a value in a javascript variable and I want to pass it in new java variable declared in the AbstractPortalContent.
It's possible ?
This is my code:
myPageContext.addRawText("<script language='JavaScript'>"+
"var array =window.opener.htmlb_formid'_htmlbElements';"
"var arr = window.opener[array];" +
"var comp = arr['id_component'];" +
"var valore = window.opener[comp].getValue();" +
"</script>");
String my_valore = valore;
Some can help me?
Thanks in advance
Stefano
Hi Stefano,
I think I don't understand completely...
You don't want to do it all at once within the same method, do you? (Because this doesn't make any sense for the JS part is evaluated at Client Side runtime, some ages after the Java method has been processed.)
If you want to return this value to the AbstractPortalComponent later on, you could just pass it as a parameter and on Java Side read it from servlet request.
Hope it helps
Detlev
Hi Stefano,
I too have also found this issue. It is not possible to use the addRawText method to add this information. My requirement was to add in meta tags by using the addRawText method but after raising a support call with SAP they said it was not possible. However, we did find a way to add in css or javascript declaration by adding this information into the includes. Then you can use context.writeHeadIncludes() which then becomes part of the context.
I hope this helps.
Nick Mitchell
Add a comment