Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Fix element height proportional to screen height

Hello,

I am developing a UI5 view using sap.m library components.

In my page, I have a flexbox - containing a table and a button below the table.

// Table

   var oTab = new sap.m.Table( "oTab", { ....... } );

// Layout - Implementing a FlexBox becuase table should be left justified and button should be center justified

  var LayoutParent = new sap.m.FlexBox( "LayoutParent", {

       items: [ oTab,

                   new sap.m.Button({

                                     text: "Back",

                                     icon : "sap-icon://sys-back-2",

                                     press: [oController.handle_back, oController],

                                     layoutData: new sap.m.FlexItemData({alignSelf: sap.m.FlexAlignSelf.Center })

                                   })

              ],

       direction: "Column"

       });

  // Page  

  var page2 =  new sap.m.Page({

       title: "Report",

   layout: LayoutParent,

   content: [LayoutParent]

  });

The number of records in the table oTab is dynamic.

With the above code, when the number of elements in the table oTab is more than what can be accomodated in the browser, we have to scroll down to view the button "Back".

I want to adjust the view such that the button "Back" is always visible in default browser size (no scrolling to view button) and the table oTab above the button adjusts itself based on browser height (e.g. introduces a scrollbar for table records).

Thanks in advance for any suggestions to implement this.

Thanks,

Indrajit

Former Member
Not what you were looking for? View more on this topic or Ask a question