FlexScrollContainer Events
FlexScrollContainer widget has the following events associated:
doLayout Event
This event is invoked for every widget when the widget position and dimensions are computed. This event is invoked for all the widgets placed inside flex containers. This event is invoked in the order in which the widgets are added to the widget hierarchy and expect the frame property of the widget is calculated and available for use within this event.
Syntax
Read/Write
Read + Write
Remarks
This event is used to set the layout properties of child widgets in the relation to self and peer widgets whose layout is not yet performed.
Note: The number of times this event invoked may vary per platform. It is not recommended to write business logic assuming that this function is invoked only once when there is a change in positional or dimensional properties. This event will not trigger when transformations are applied though widget is moved or scaled or rotated from its original location.
Example
Platform Availability
- iOS
- Android
- Windows
- SPA
onDecelerationStarted Event
An event callback is invoked by the platform when the user stops scrolling but the content still moves before the content actually stops. This event is invoked asynchronously.
Syntax
Read/Write
Read + Write
Example
Platform Availability
This property is available on iOS platform.
onScrollEnd Event
An event callback is invoked by the platform when the scrolling is ended. This event is invoked asynchronously.
Syntax
source [widgetref]
Optional. Handle to the widget reference on which the scrolling is ended.
Read/Write
Read + Write
Example
Platform Availability
- iOS
- Android
- Windows
- SPA
onScrolling Event
An event callback is invoked by the platform when the scrolling is in progress. This event is invoked asynchronously.
Syntax
Input Parameters
source [widgetref]
Handle to the widget reference on which the scrolling is in progress.
Read/Write
Read + Write
Example
Platform Availability
- iOS
- Android
- Windows
- SPA
onScrollStart Event
An event callback is invoked by the platform when the user starts scrolling the content. This event is invoked asynchronously.
Syntax
source [widgetref]
Optional. Handle to the widget reference on which the scrolling has started.
Read/Write
Read + Write
Example
Platform Availability
- iOS
- Android
- Windows
- SPA
onScrollTouchReleased Event
An event callback is invoked by the platform when the user touch is released from the touch surface. This event is invoked asynchronously.
Syntax
source [widgetref]
Optional. Handle to the widget reference on which the user touch is released from the display.
Read/Write
Read + Write
Example
Platform Availability
- iOS
- Android
- SPA
onScrollWidgetPosition Event
This event callback is invoked by the platform when the widget location position gets changed on scrolling. The onScrollWidgetPosition event returns the positional coordinates of the widget’s location with respect to the screen (screenX and screenY) and the parent container (frameX and frameY). This event is invoked asynchronously, and is not available for FlexForm widget.
Syntax
Read/Write
Read + Write
Example
Platform Availability
- Not Accessible from IDE
- Android, iOS, SPA, and Windows
onZoomEnd Event
An event callback is invoked by the platform when the zooming has ended. This event is invoked asynchronously.
Syntax
source [widgetref]
Handle to the widget reference on which the zooming has ended.
Read/Write
Read + Write
Remarks
For example, If you have a form with a flexScrollContainer and an image widget inside flexScrollContainer, when you pinch the screen on flexScrollContainer it will call the function configured using widgetToZoom event. If the function returns image, the image will be zoomed.
Note: This event callback is invoked only when zooming is initiated by user interaction.
Platform Availability
Available in the IDE.
Available on iOS platform.
onZooming Event
An event callback is invoked by the platform when the container is zooming. This event is invoked asynchronously.
Syntax
source [widgetref]
Optional. Handle to the widget reference on which the zooming has started.
Read/Write
Read + Write
Remarks
For example, If you have a form with a flexScrollContainer and an image widget inside flexScrollContainer, when you pinch the screen on flexScrollContainer it will call the function configured using widgetToZoom event. If the function returns image, the image will be zoomed.
Note: This event callback is invoked only when zooming is initiated by user interaction.
Platform Availability
Available on iOS platform.
onZoomStart Event
An event callback is invoked by the platform when the container is about to zoom. This event is invoked asynchronously.
Syntax
source [widgetref]
Optional. Handle to the widget reference on which the zooming has started.
widget [widgetref]
Optional. Specifies the widget that actually zooms.
Read/Write
Read + Write
Remarks
For example, If you have a form with a flexScrollContainer and an image widget inside flexScrollContainer, when you pinch the screen on flexScrollContainer it will call the function configured using widgetToZoom event. If the function returns image, the image will be zoomed.
Note: This event callback is invoked only when zooming is initiated by user interaction.
Platform Availability
Available on iOS platform.
scrollingEvents Event
This event callback is invoked while scrolling the FlexScrollContainer horizontally or vertically. The scrollingEvents event is triggered when the FlexScrollContainer is pushed or pulled beyond its horizontal or vertical boundaries.
Syntax
Events defined in scrollingEvents
onPull: This event is triggered when the FlexScrollContainer is pulled while scrolling horizontally or vertically.
onPull(widgetRef)
onPush: This event is triggered when the FlexScrollContainer is pushed while scrolling horizontally or vertically.
onPush(widgetRef)
onReachingBegining: This event is triggered when the scrolling bar reaches the beginning of the FlexScrollContainer widget.
onReachingBegining(widgetRef)
onReachingEnd: This event is triggered when the scrolling bar reaches the end of the FlexScrollContainer widget.
onReachingEnd(widgetRef)
Input Parameters
widgetRef
This parameter references the FlexScrollContainer that triggered the event.
Read/Write
Read + Write
Remarks
- In SPA and iOS, pull and push events are triggered only when the bounces property is set as true.
- When the scrollDirection Property of the FlexScrollContainer is set as vertical, the text provided in the pullToRefreshI18NKey and pushToRefreshI18NKey attributes takes precedence over the icons provided in pullToRefreshIcon and pushToRefreshIcon.
- When the scrollDirection Property of the FlexScrollContainer is set as horizontal, only the icons provided in pullToRefreshIcon and pushToRefreshIcon are displayed.
Limitations
- Desktop Web does not support onPull and onPush events.
- onPull and onPush events do not work when the scrollDirection Property is set as Both.
- When onPull and onPush events are configured, the parent container does not scroll.
- In Android, when onPull and onPush events are enabled, the scrollDirection Property cannot be modified in the same FlexForm.
- In Android, you cannot enable scrollingEvents after navigating to the FlexForm. It must be enabled before navigating to the form.
Platform Availability
- Android
- iOS
- Windows
- SPA
widgetToZoom Event
An event callback is invoked by the platform to return one of the child widgets of source to zoom. The returning source itself may not result in zooming the entire source. The container will not zoom, if a null value is returned. This event is invoked asynchronously.
Syntax
source [widgetref]
Optional. Handle to the widget reference on which the zooming has started.
Read/Write
Read + Write
Remarks
For example, If you have a form with a flexScrollContainer and an image widget inside flexScrollContainer, when you pinch the screen on flexScrollContainer it will call the function configured using widgetToZoom event. If the function returns image, the image will be zoomed.
Note: This event callback is invoked only when zooming is initiated by user interaction.
Platform Availability
Available in the IDE.
Available on iOS platform.