cancel
Showing results for 
Search instead for 
Did you mean: 

Event value across pages

Former Member
0 Kudos

How to get the subscribed event data across pages?

I have 6 pages, with team viewer as common iview in all pages. When a user click on first item say "employee1"in team viewer event is captured and is working fine. now how to retain the same event data across all my 6 pages.

for e.g when user clicks on 3 pages the data for employee1 should load .Any help would be appreciated.

below is my receive event function (Courtesy Prakash)

<script language="javascript">

EPCM.subscribeEvent( "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged", window, "receiveEvent");

function receiveEvent(Evt) {

var pernr = Evt.dataObject;

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var inputfield = eval(func("pernr"));

if (inputfield)

inputfield.setValue(pernr);

var form = document.all(htmlb_formid);

form.submit();

}

</script>

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Sorry for my lously explaination of problem, I understand that the data is available across pages, what i am trying to do is to read this read in doafterprocessinput()and pass this value to import parameters.

Former Member
0 Kudos

I guess cookies wud solve ur problem...Save it in a cookie..and read the cookie in the PAI...It works..

Regards.

Former Member
0 Kudos

Any ideas Peter

Former Member
0 Kudos

I didn't understand ur question...

U can always get the stored data from Data Bag by accessing it...it doesn't matter where u are in the portal(works across all pages)..

I guess thatz i how u submit your data to the server..

Regards,

Former Member
0 Kudos

Peter

I am storing the eventdata in clientbag now how do i submit back to server without any event. I am getting the value when i print alert.

Event is captured in first page and stored,when i go to second page if there is no event raised i want to use the eventdata stored in previous page.

<script language="javascript">

EPCM.subscribeEvent( "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged", window, "receiveEvent");

function receiveEvent(Evt) {

var pernr = Evt.dataObject;

EPCM.storeClientData ( 'urn:myOwnNameSpace', 'myvarname', pernr);

if ( pernr != null ){

pernr = EPCM.loadClientData('urn:myOwnNameSpace', 'myvarname');

}

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var inputfield = eval(func("pernr"));

if (inputfield)

inputfield.setValue(pernr);

var form = document.all(htmlb_formid);

form.submit();

}

</script>

Former Member
0 Kudos

Peter Thanks Very Much, still not getting the value

<script

language="javascript">

EPCM.storeClientData("urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged");

function receiveEvent(Evt)

{

var pernr = EPCM.loadclientdata("urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged");

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var inputfield = eval(func("pernr"));

if (inputfield) inputfield.setValue(pernr);

var form = document.all(htmlb_formid); form.submit();

}

</script>

Former Member
0 Kudos

Guess you are not storing the value..watz the value u trying to store?

Go thru the syntax!

Try something like this:

EPCM.storeClientData("urn:com.sap.pct.hcm.orgmanagement:CurrentObject","ObjId", "objectChanged");

Then use LOAD as:

var pernr = EPCM.loadclientdata("urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "ObjId");

Also, where u calling this function:receiveEvent(Evt) ?

Regards.

Message was edited by: Peter

Former Member
0 Kudos

Simply store and load using EPCM.storeClientData("urn:com.sap.xx:....."); and then use EPCM.loadClientData("urn:com.sap.xx:....."); to get the data on any page.

It works across the pages for sure...

Let me know if u need more.

Regards,

P.S: Consider awarding points for helpful answers.