Slide View

Purpose

This component is provided by the ui:slide-view element. The element displays slides from a specified set. It presents one slide at a time. All slides must be of the same size.

This component, together with Slide Model API and Slide Renderer API, allows authors to separate the data from the presentation. The contents of each slide is retrieved from the underlying model. The corresponding renderer defines how to display the data on an XDIME page. In other words, the model provides the data, and the renderer renders the data into a DOM element which can then be displayed on an XDIME page by the selected ui:slide-view element. The model and renderer must form a pair, i.e. the model depends on the renderer, and the renderer depends on the corresponding model.

Exported Features

cf2:ui.SlideView

Imported Features

cf2:ObservablePropertyPrototype

Markup

This component is provided by the ui:slide-view element.

JavaScript

This component provides the following methods:

next()

Displays the next slide. If ui:slide-view is displaying the last slide and the loop property is set to 'false', then the method does nothing and returns false.

previous()

Displays the previous slide. If ui:slide-view is displaying the first slide and the loop property is set to 'false', then the method does nothing and returns false.

Properties

The following table lists the observable properties associated with this component.

Property Description Type Access
loop Specifies whether the slides should be displayed in the loop. The possible values are: 'true' and 'false'. boolean read/write
hasNext Determines whether the next() method will change the slide being shown; true if it will, false otherwise. If the total property is '0', or the renderer property is null, then it returns false. This property can be bound to the enabled property of the Button component that selects the next slide to automatically disable the button when the next slide is not available. boolean read
hasPrevious Determines whether the previous() method will change the slide being shown; true if it will, false otherwise. Returns false if the total property is '0', or the renderer property is null. This property can be bound to the enabled property of the Button component that selects the previous slide to automatically disable the button when the previous slide is not available. boolean read
model Specifies the slide model. SlideModel read/write
renderer Specifies the slide renderer. SlideRenderer read/write
current The index of the slide being displayed. [0,total) or '-1' if total is 0 read/write
total The total number of slides. The value of this property is equal to the value returned by the getSlideCount() method. See Slide Model API for details. int read

Related topics