A Segment2 widget consists of multiple segments (rows or records) and each segment can have multiple child widgets. You can use Segment2 widgets to create menus and grouped lists in your applications.
To learn how to use this widget programmatically, refer Kony Visualizer Widget guide.
You can place a Segment2 widget within a number of parent widgets, and you can place a number of child widgets within a Segment2 widget.
You can add a Segment2 widget to the following widgets:
Flex Form | VBox Form |
FlexContainer | FlexScrollContainer |
ScrollBox (vertical orientation only) | Tab |
Popup | VBox widget (but not an HBox) |
You can place the following widgets within a Segment2 widget:
Button |
Calendar |
FlexContainer |
Image2 |
Label |
Phone |
RichText |
Slider |
Switch |
TextArea2 |
TextBox2 |
Listbox |
The following are important considerations for a Segment2 widget:
Note: iOS, Android, and Windows platforms, if your segment has large data sets (more than 20 records with each record having more than 15 widgets), set the segment as a Screen Level Widget.
The height of the Segment2 widget is determined by the content of the widget. If you set the Screen Level Widget to True, then the height of the Segment2 widget is the form height excluding headers and footers.
One you add a Segment2 widget to a component or master, you cannot drop other widgets onto that segment widget. To add a widget to a Segment2 widget in a component or master, create a segment row template, populate it with the widgets you want it to have, and then you configure the segment widget in the component or master to reference that row template. Once the segment widget in your component or master is populated width content from the row template, you can edit the segment widget's master data to have the per-row customized data that you need.
Note: A segment template can only apply to one channel. To work around this, create the segment template for one channel, copy it, and then paste it into the other channels.
To use a Segment2 widget in a component or master:
Look properties define the appearance of the widget. The following are the major properties you can set:
For descriptions of the properties available on the Look tab of the Properties pane, see Look.
Skin properties define a skin for the widget, including background color, borders, and shadows. If the widget includes text, you can also specify the text font.
For the Segment2 widget, you can apply a skin and its associated properties for the following states:
Skin | Definition |
---|---|
Row |
The skin that is applied for each row. |
Row - Focus |
The skin that is applied when user focuses on a row. |
Section Header |
The skin that is applied to the Section Header of Segment2 widget. |
Widget |
The skin that is applied to the entire Segment2 . |
Row - Alternate |
The skin that is applied to every alternate even numbered row in the segment. |
Blocked UI |
The skin that is to block the interface until the action in progress (for example, a service call) is completed. Note: Blocked UI is available only for SPA platforms. |
Pressed |
The skin to indicate that the row of the segment is pressed or clicked. |
Refresh - Pull | The look and feel of a widget when the scroll bar is pulled. |
Refresh - Push | The look and feel of a widget when the scroll bar is pushed. |
For more information about applying skins, see Understanding Skins and Themes.
Segment2 properties specify properties that are available on any platform supported by Kony Visualizer, and assign platform-specific properties.
Note: Properties that can be forked are identified by an icon located to the left of the property. For more information, see Fork a Widget Property.
The master data is enabled only when the widgets are added to the Segment2 widget.
The following example illustrates using the Master Data property to add an image and button to the Segment2 widget:
Indicates the common template to be used for each row while creating the row and filling the data. This can be overridden at the row level when setting the data using the template key.
Note: Only those templates that are created from Project Explorer >Templates > Segments are visible on the Row Template drop-down list.
Specifies the common template to be used for each section while creating the section header and filling the data. This is optional parameter and if not provided the default template provided by each platform will be used. It can also be provided at each section level when setting the data. You can create a new template without going to the Templates section using the Create New option from the drop-down list. You can also edit a template inline in the segment.
Note: Only those templates that are created from Project Explorer >Templates > Segments are visible on the Row Header Template drop-down list.
Note: When a Section Header is provided along with the rows/items, the Section Header is "clamped" to the top of the scrollable area (on the Form) as one scrolls through a long list of items (for example, if you have a long list of contacts that all begin with the letter "A", the "A" header will be fixed at the top until you scroll down past the last "A" item). This behavior can be clearly seen iPhone's Contacts application.
This behavior of Section Headers is available on iOS and Android platform and is enabled when the Screen Level Widget has been set to true.
Specifies whether all the rows in a segment should be grouped using a rounded corner background and border.
Specifies whether the segment should retain the selection made when the user navigates out of the form and revisits the form.
Specifies whether the widget should occupy the whole container or not. You must set the value to true if your segment has large data sets (more than 20 records with each record having more than 15 widgets) to facilitate a better reuse of the widgets and a different scrolling behavior.
Note: This property is available only when a Segment2 widget is placed in a VBox form.
Specifies if the segment should display the separator between the rows.
Specifies the thickness of the separator in pixels.
Specifies the color of the separator between rows of a Segment2 widget. Click the color sampler to open the color picker from where you can select a separator color.
Provide the desired transparency for the separator.
Specifies if the scrollbars of the segment must be visible all the time.
Specifies how you can stack the widgets within the Segment2. You can set the orientation of the Segment2 as horizontal or vertical.
Following are the options:
Note: This property is avialable only when Segment2 widget is placed in a VBox form.
Specifies the view type of a segment. The following are the available view types that you can select and their appearances on iPhone native client:
Page: The rows of the segment appear in pages and you need to scroll through the pages to view the rows.
Specifies the direction in which the widgets are laid out.
Default: LEFT
The options are:
Note: This property is avialable only when Segment2 widget is placed in a VBox form.
Specifies whether the segment will support single or multiple selection.
Following are the options:
For Kony Visualizer Version 7.3 and later, specifies whether to enable or disable reordering rows in a segment.
This property is applicable only when the segment is placed inside a flex container and View Type is set as Table. It specifies the segment to grow when the new content is added.
Following are the options:
Rules and Priorities of Autogrow-Mode property
Note: Preferred Height in the above statement refers to the cumulative height of the segment contents (rows - defined using templates, section headers / footers, separators etc.).
Specifies the height of the Segment2 in terms of percentage. The percentage is with reference to the value of Height Reference property.
Note: This property is unavailable on Flex Forms.
The Segment2 height percentage is calculated based on the option selected.
Note: This property is unavailable on Flex Forms.
Specifies whether the dictionary must be enabled for easy navigation.
If the dictionary property is enabled, alphabets from A to Z appear on the screen and when you select any alphabet, all the corresponding results that start with the selected alphabet are displayed.
Note: This property is applicable if Screen Level Widget property is set to true and the section headers have been set.
Note: This property is specific to the iOS platform.
Specifies the indicator type as rowSelect, rowClick, or none. Based on your selection, the behavior is exhibited:
Following are the options:
If the user selects the indicator, the related content appears in the next screen .
If the user selects the disclosure button, the detailed content appears.
Note: This property is specific to the iOS platform.
Specifies the way in which the edit feature of Segment2 can be enabled.
Following are the options:
Note: This property is specific to the iOS platform.
Specifies whether the progress indicator is displayed.
Default: true (the progress indicator appears on the widget)
Note: This property is specific to the iOS platform.
Specifies the color of the progress indicator as white or grey.
Note: This property is specific to the iOS platform.
Specifies whether the scroll view bounces past the edge of the content and back again.
Note: This property is specific to the iOS platform.
Specifies the search criteria to be applied when searching has been enabled.
Note: This property applies only when the Full Screen Widget property is enabled, View Type is set to Table, and a template is selected for Search By property.
The options are:
Note: This property is specific to the iOS platform.
Specifies the identifier of the widget placed inside the row of the Segment2. Search will be performed against the content present inside the widget.
Note: Note: This property is applicable only when Full Screen Widget property is enabled, View Type is set to Table, and a template is selected for Row Template property.
Note: This property is specific to the iOS platform.
Specifies whether to dock the section header at the top of the segment while scrolling the section content. If you are scrolling the segment data, the next section header will be docked on top of the segment
Note: This property applies only when the Full Screen Widget property is enabled and View Type is set to Table.
For example, if you scroll the segment data shown in the following figure, as the segment data scrolls up, the Samsung Phones docked header moves out oThe Samsung header f view. and is replaced with the HTC Phones section header, which is now docked.
Note: This property is specific to the Android platform.
Actions define what happens when an event occurs. On a Segment2 widget, you can run an action when the following events occur:
For more information, see Add Actions.
The appearance of the Segment2 widget varies as follows
Platform | Appearance |
---|---|
Android | |
iOS | |
Windows Phone | |
SPA |
Rev | Author | Edits |
8 | SHS | SHS |
Copyright © 2013 Kony, Inc. All rights reserved. |