Segment2

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

Important Considerations

The following are important considerations for a Segment2 widget:

Using the Segment2 Widget in a Component or Master

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:

  1. Create a segment row template. To do so, in the Project Explorer, click the Templates tab, open the channel you want to create the segment template for (e.g. Mobile), click the context menu arrow of Segments, and then click New Template. The template is created and opens on the Visualizer Canvas. It might be a good idea to rename the template to something descriptive, such as rowMobile. To do so, on the Templates tab, click the context menu arrow of the newly-created template, and then click Rename.
  2. Drag a FlexContainer widget onto the new template on the Visualizer Canvas, and configure it how you want.
  3. Drag onto the FlexContainer the widgets that you want the segment row template to have, and configure them how you want.
  4. Once you have the segment row template configured the way you want it, if you want to copy it to other channels, click the context menu arrow of the configured template, and then click Copy. Navigate to and open the channel you want to paste it to, click the context menu arrow of Segments, and then click Paste. Rename the template if you'd like, and then make any needed modifications so that it looks and behaves correctly in that channel.
  5. On the File menu (the Project menu in Kony Visualizer), click Save All.
  6. Add a Segment2 widget to the component or master. To do so, in the Project Explorer, on the Templates tab, in the Components or Masters section, select the component or master so that it opens on the Visualizer Canvas, add (or select an existing) container widget in the component or master, and then drag a Segment2 widget onto it.
  7. In the Properties Editor for the Segment2 widget you just added, click the Segment tab. Then from the Row Template drop-down list, select the row template you want to use.
  8. From the Segment tab, click the Edit button for Master Data, and make any changes needed to the segment data.
  9. On the File menu (the Project menu in Kony Visualizer), click Save All.

Look Properties

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

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

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.

Master Data

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:

  1. Select the Segment2 widget.
  2. Drag an Image widget and Button widget onto the Segment2 widget.
  3. From the Segment2 widget properties, click the Segment tab.
  4. Click the Edit button of the Master Data option to open the Master Data dialog box.
  5. Provide the image and button widget details as shown in the following image.
  6. Click OK.

Row Template

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.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 Template drop-down list.

Section Header Template

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.

Group Cells

Specifies whether all the rows in a segment should be grouped using a rounded corner background and border.

Retain Selection

Specifies whether the segment should retain the selection made when the user navigates out of the form and revisits the form.

Full Screen Widget

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.

Separator

Specifies if the segment should display the separator between the rows.

Separator Thickness

Specifies the thickness of the separator in pixels.

Separator Color

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.

Separator Transparency

Provide the desired transparency for the separator.

Show Scrollbars

Specifies if the scrollbars of the segment must be visible all the time.

Orientation

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.

View Type

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:

Layout Alignment

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.

Selection Behavior

Specifies whether the segment will support single or multiple selection.

Following are the options:

Enable Reordering

For Kony Visualizer Version 7.3 and later, specifies whether to enable or disable reordering rows in a segment.

Autogrow Mode

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

Height

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.

Height Reference

The Segment2 height percentage is calculated based on the option selected.

Dictionary

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.

Indicator

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.

Edit Style

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.

Progress Indicator

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.

Progress Indicator Color

Specifies the color of the progress indicator as white or grey.

Note: This property is specific to the iOS platform.

Scroll Bounces

Specifies whether the scroll view bounces past the edge of the content and back again.

Note: This property is specific to the iOS platform.

Search Criteria

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.

Search By

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.

Dock Section Header

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

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.

Widget Appearance on Platforms

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.