Skip to Content
author's profile photo Former Member
Former Member

Problem while using m.scrollcontainer

Hi All,

I am using scrollcontainer in one of my trainning programme.During which i am facing output which is not expected.

Please go through the code which is the view in MVC architecture.If i am removing the page it is working fine.But with page i am not getting exact output.I am attchning the output for referce.The part which i mentinoed in red color is where scroll container is working instead of entire page.Please help to resolve

sap.ui.jsview("panel.Panel", {

getControllerName : function() {

return "panel.Panel";

},

createContent : function(oController) {

var pan = new sap.m.Panel({

headerToolbar : new sap.m.Toolbar({content : [new sap.m.Button({text : "Hii"})],width : "100px"}),

content : [new sap.m.Text({text : "Hello"})],

expandable : true,

expanded : true,

height : "800px",

width : "900px",

expand : function(){

alert("pan");

}

});

var pan1 = new sap.m.Panel({

headerToolbar : new sap.m.Toolbar({content : [new sap.m.Button({text : "Hii1"})],width : "100px"}),

content : [new sap.m.Text({text : "Hello"})],

expandable : true,

expanded : true

});

var hbo = new sap.m.HBox({

items : [pan,pan1]

});

var pag1 =new sap.m.Page({

content : [hbo]

});

var schrlco = new sap.m.ScrollContainer({

vertical : true,

horizontal : true,

width : "100%",

height : "100%"

});

schrlco.addContent(pag1);

return (schrlco);

}

});

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2014 at 07:03 PM

    Hi,

    Sap.m.page should be the top layer of your scroll container. Hence place scroll container inside page and return the instance of page. Also place your hbox inside scroll container.

    Have you tried enabling scrollbar properties in your page?

    Regards,

    Meganadhan S

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Former Member,


      I applied your suggestion, but no success. Could you help me ?

      I'm creating an hybrid app using Cordova.. For Android it works fine, but for iOS no success.

      This is the code:

      this.div_root = new sap.m.ScrollContainer({

      horizontal: false,

      vertical: true,

      content:[

      //<here comes the content>

      ]

      });



      this.myPage = new sap.m.Page("My_List_Page", {

      enableScrolling: true,

      content : [

      this.div_root,

      ]

      });

      return this.myPage;


      It works for every browser and Android. But for iOS, no success 😔


      thanks

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.