Titanium JIRA Archive
Alloy (ALOY)

[ALOY-722] ScrollableView is automatically repositioning itself to currentPage=0 when Alloy Model updates

GitHub Issuen/a
TypeSub-task
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsModels
Labelsalloy
ReporterAngus Johnston
AssigneeUnknown
Created2013-06-26T06:15:51.000+0000
Updated2018-03-07T22:26:09.000+0000

Description

per Tony Lukasavage, am submitting this to Jira. http://developer.appcelerator.com/question/153922/scrollableview-is-automatically-repositioning-itself-to-currentpage0-when-alloy-model-updates#comment-179293 ive got a ScrollableView, whose Label(s) contents are updating, as the Model's data is updating (every X seconds). The ScrollableView, has 2 Views embedded. What's happening, is that if the user has swiped & is looking at the second View (in the ScrollableView - ie currentPage = 1) and then the Model data is updated via data binding - then the ScrollableView is automatically respositioning itself back to the first View (ie. currentPage = 0). Obviously this is very annoying for the user, who then needs to swipe back to currentPage = 1. I've tried turning scrollingEnabled OFF and using "swipe" event to transition to the second View (currentPage=1). Not ideal as it doesnt fit with how a user expects this UI element to act. However didn't work anyway, as soon as the Model updates the ScrollView repositions straight back to currentPage=0
 
<Alloy>
        <TableViewRow id="LBProw" dataId="" model="{alloy_id}" >
 
            <ScrollableView id="sView">
 
                <View id="view1a" >
                    <Label id="thetitle" text="{thetitle}" />
                    <Label id="heading1" text="{heading1}" />
                    <Label id="value1"   text="{value1}"   />
                    <Label id="heading2" text="{heading2}" />
                    <Label id="value2"   text="{value2}"   />
                </View>
 
                <View id="view1b">
                    <Label id="thetitleb" text="{thetitle}" />
                    <Label id="heading3"  text="{heading3}"  />
                    <Label id="value3"    text="{value3}"    />
                    <Label id="heading4"  text="{heading4}"  />
                    <Label id="value4"    text="{value4}"    />
                </View>
 
            </ScrollableView>
 
        </TableViewRow>
 
</Alloy>

Comments

  1. Angus Johnston 2013-07-06

    hi, any updates on this as yet ?
  2. Tony Lukasavage 2013-07-08

    No, not yet, and there likely will not be until after Alloy 1.2.0 is released, which is tentatively scheduled for mid-August.

JSON Source