cancel
Showing results for 
Search instead for 
Did you mean: 

[Event] Read the content of another page

guillaume-hrc
Active Contributor
0 Kudos

Hi,

<i>The following refers to a BSP application with Pages with Flow logic.</i>

An application is composed with a <i>contentArea.htm</i> page and a <i>menu.htm</i> page.

There is a button on the <i>contentArea</i> page that allows user to save his/her inputs.

I would like to save those inputs when he/she navigates away (via the <i>menu</i> page) from the current page in order not to lose the data.

Basically, it would mean trigerring the Save button from the menu page which - as seen in various posts on this subject - is highly unadvised...

The problem is that I have to read the data (stored in <input>) on the <i>contentArea</i> page. To achieve this, I use the get_data and get_cell_value methods of CL_HTMLB_MANAGER.

The problem I face is that it uses runtime->server->request... and I can't manage to get it right from the <i>menu</i> page. The idea would be to read the content of <i>contentArea</i> at runtime.

Is there a way to achieve this with pagse with Flow logic ??

Many thanks in advance!

Best regards,

Guillaume

Message was edited by: Guillaume Garcia

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

based on the menu choosen on menu.htm are you loading different pages in contentarea.htm or ...? how are you changing the contentarea.htm content based on th menu selected from menu.htm?

1. if its differnt pages on content area for different content we could use onunload event of the page to capture moving away from the page and do the necessary processing.

2. use javascript which will be called from menu.htm to fire the savebutton on contentarea.htm

3. as the user enters values in contentarea.htm write them to serverside cookie and use it later when they come back to the page again.

let me know how the contentarea.htm content changes based on user selection in menu.htm

Regards

Raja

guillaume-hrc
Active Contributor
0 Kudos

Hi Raja,

Thanks for your answer! That is really good stuff you gave me.

Yes, the <i>menu.htm</i> performs a <b>window.open</b> on the contentArea frame to refresh its content. It sets the reference and the target in the OnInputProcessing and performs the actual window.open in the Layout.

I like the option 1) the most, for it keeps the code in the page contentArea itself

As for the 3) option, it is a bit of a problem since I do not trigger server side events when the user enters values: I have a set of custom JavaScript code that avoids round trip to the server.

Thanks again.

Best regards,

Guillaume

Message was edited by: Guillaume Garcia

guillaume-hrc
Active Contributor
0 Kudos

Hi,

I came up with an interesting mix of the 2 solutions: when there is a need to save (i.e. the user has modified some values in <i>contentArea</i>), I dynamically set a onUnload event on the <body> tag of <i>contentArea.htm</i> in the following way:

document.getElementsByTagName("BODY")[0].onunload = function() {
  var check = false;

  check = confirm("You have made modifications to the planning." +
                  "nnDo you wish to save before moving away from this page?");

  if (check == true) {
    document.getElementById('bg__Save').click();
  }
};  // end of anonymous function

However, there are 2 problems rising:

- first, because of application attributes that are set in the <i>menu.htm</i> and used in the onInputProcessing of <i>contentArea.htm</i>

- then, try not to trigger the code if you click on the Save button itself, otherwise, the application does not respond...

But, overall, it works pretty well!

Best regards,

Guillaume

PS : To be complete on the subject, the following weblog by Eddy De Clercq is of help:

/people/eddy.declercq/blog/2006/03/20/wake-me-up-before-you-go-go

Message was edited by: Guillaume Garcia

athavanraja
Active Contributor
0 Kudos

I had Eddys weblog in mind to suggest to you, but was waiting for your response to find out your exact scenario. Anyhow good that you found Eddys weblog.

Regards

Raja

Answers (0)