cancel
Showing results for 
Search instead for 
Did you mean: 

Page context object in BSP extension required

Michael2023
Explorer
0 Kudos

Problem:

A self-developed BSP extension shall be able to send a popup when pressing a button. This popup shall allow the modification of certain characteristics in the component's appearance (e.g. number of table columns displayed, sorting, filters, etc.).

The popup is created within the BSP extension and shall be filled by JavaScript. For this purpose, the page content is created dynamically and written in a BSP BEE. This BEE shall be rendered into a string, but for this a page context (CL_BSP_PAGE_CONTEXT) is required. It must be a new page context because it shall be displayed in a new window (popup). However, only the page context of the page currently processed is available.

Does anybody have an idea? I'd be grateful for any help!

Accepted Solutions (0)

Answers (1)

Answers (1)

maximilian_schaufler
Active Contributor
0 Kudos

Hi Michael,

if you have developed your extension correctly, you should have an inherited interface attribute available:

<b>IF_BSP_ELEMENT~M_PAGE_CONTEXT</b>

If you don't see it in your extension class, then make sure the filter checkbox is unchecked.

...

ok, after reading your question again, you might have already known that, so I want to add one more thing:

You can only use a page context of the page that is currently being rendered, not a future one.

If you open a new window, a new page is loaded there - and this new page is called via another HTTP request. Therefore I doubt that it would make sense to create the content for your popup already on the page that allows the popup to be called, especially if you are depending on the page context.

You have to find a way to get your BEE rendering code within the rendering of your new page in order to be able to have the right page context available.

If you want to have both parts of this popup-thingy, the calling button as well as the HTML parts that make up the popup ocntent, within one extension, then at least you would have to use this extension in two parts in your application (or just one time with an additional, dynamic parameter): For one to display the button, and also on the result/popup-page.

In my opinion you should re-think realizing this with an extension. Maybe it would be better to just use a regular button with an onClientClick event to open the popup, and on the new page you are calling you display the popup content (maybe use the extension there).

Hope this was helpful, feel free to ask follow-ups.

Max