cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Panels - Controlling position of content

former_member239819
Participant
0 Kudos

I have a number of Panels which, when expanded, show the corresponding questions for that particular 'Category'

The issue I have is, say for example I answer the questions for the 1st panel, the content will scroll down, eventually hiding the panel... fair enough.

However, when I click on the Next Panel/Category (Production Area), I need to the page to scroll back up to the first question in the Category, or maybe even just display the selected category at the top of the page.

Is this possible?

Currently, the user has to continually scroll back if when they select the next Category.

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

Hi Adam,

You can use jQuery domref to handle this.

oPanel.getDomRef().scrollIntoView()

Or you can use .focus() dom method or even m.page has a scrolling feature, not sure if it is public method or not.

You can also find many blogs which uses scroll eg.,

https://archive.sap.com/discussions/thread/3824204

BR,

Mahesh

former_member239819
Participant

Perfect solution. Thank you!

if (oEvent.getParameters().expand) {
   var focusID = oEvent.getParameter("id");
   var elmnt = sap.ui.getCore().byId(focusID);
   elmnt.getDomRef().scrollIntoView(true);

Answers (1)

Answers (1)

former_member185280
Active Contributor
0 Kudos

If you don't end up with the desired functionality using Panels you may want to look into the anchor bar functionality of the object page layout or the wizard functionality.

AnchorBar

ObjectPageLayout

Wizard

Regards,
Christian