on 04-28-2016 11:43 AM
Hi,
Requirement :
I have a view in my web dynpro application. Inside that view I have embedded an Iframe. The source of this Iframe is link of a BSP Application.
Inside my BSP Application, I am calling a javascript function which fills up a variable declared inside it. Now I need the data of this variable inside my Web Dynpro Application.
Things tried :
I created a page attribute, which i tried filling inside the JavaScript function but failed. I observed that it is possible to pass page attribute data into a javascript variable but not vice-versa. Then I tried to create a cookie inside the JS function and tried to read the cookie inside the Web Dynpro using
' cl_bsp_server_side_cookie=>get_server_cookie' but again failed since I used to set the cookie inside the JS but while reading, didn't get anything.
Finally I created a button in BSP, on the click of which OnInputProcessing event gets triggered, here i got the data by reading the UI Element (textarea)
and then from here i exported the data, but this involves an extra event(i.e. a button click) which I don't want.
Kindly suggest the solution.
SA
1) If both your webdynpro application and BSP are in the same session(which i doubt), then go as below
-> Create a global class in SE24(say zcl_test) and create a public static attribute(say lv_test)
-> Populate this static attribute from your BSP as zcl_test=>lv_test = 'test'.
-> Access this static attribute from webdynpro as zcl_test=>lv_test
2) If both applications are in different session with different users then do as below in BSP, where lv_attr is your variable which you want to transfer to WD
EXPORT lv_attr TO SHARED BUFFER indx(st) ID 'ZTEST'.
Now fetch this variable in WD as
data: lv_attr type string.
IMPORT lv_attr = lv_attr FROM SHARED BUFFER indx(st) ID 'ZTEST'.
This will also not work if your applications are running on different application servers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me make my requirement more clear:
I have a JS function in my BSP where I perform some calculation. Now the data in one of the variable inside the JS needs to be exported to my WebDynpro Application. What I have found is that we cannot pass the JS variable value to page attribute of my BSP appl but vice-versa is possible. If I am able to get the data into my BSP page attribute then it will be possible for me to pass the data to my WD Appl through various ways. Simply speaking, requirement is to get the JS variable data into my ABAP variable.
'try mapping the value of your textArea in html to the page attribute as below'
This statement contradicts
'value="<%= lv_page_attr %>"'
As I have already mentioned, value of my textArea cannot be assigned to my page attribute as it is gives below error.
'<%= lv_page_attr %>' = value;
'textedit.htm:14 Uncaught ReferenceError: Invalid left-hand side in assignment'
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.