Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10116

Re: sap.m.List does not maintain display position after returning from detail view

$
0
0

Hi Jay,

 

I've checked coding. Unfortunatelly there is no such a feature from SAP (at least in current release). But if you know jQuery/DOM/CSS - you should be able to make a workaround.

 

What I've done.

 

1. I have found runtime element, which changes it's position by scrolling of the list.

list.png

 

For me it was a direct parent of my list.

 

2. In ListItemTap event I save a scroll postion in a following way:

                              oList.posContainer = $('#'+evt.oSource.oParent.sId).parent();                              oList.posTransform = oList.posContainer.css('transform');                              oList.posTransformWebKit = oList.posContainer.css('-webkit-transform');

 

oList for me a global variable (not good, but for this example is OK).

 

First line I save a jQuery object, which is responsible for scrolling

Second and third - scroll positions for different browsers via css. Some of them use transform css property, other use -webkit-transform

 

3. Attached handler for event onBeforeShow scrolls the List.

          this.getView().addDelegate({ onBeforeShow: function(evt) {                if (evt.direction == "back") {                    oList.posContainer.css('transform',oList.posTransform);                     oList.posContainer.css('-webkit-transform',oList.posTransformWebKit);                }          }});

 

this code is placed inside onInit() method of the view controller.

scrolling is done via css.

 

Checked on iPhone: position set correctly, but the next tap on the List leads to flicking.

I think, it's a safari issue. There some tricks, how to avoid it: look for -webkit-backface-visibility

 

Best Regards

Konstantin


Viewing all articles
Browse latest Browse all 10116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>