Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Release 5.6
Kony Widget User Guide - Ver 17.0
October, 2014
This document contains information proprietary to Kony, Inc., is bound by the Kony license agreements and
may not be used except in the context of understanding the use and methods of Kony Inc, software without
prior, express, written permission. Kony, Empowering Everywhere, Kony MobileFabric, and Kony Visualizer
are trademarks of Kony, Inc. Microsoft, the Microsoft logo, Internet Explorer, Windows, and Windows Vista
are registered trademarks of Microsoft Corporation. Apple, the Apple logo, iTunes, iPhone, iPad, OS X,
Objective-C, Safari, and Xcode are registered trademarks of Apple, Inc. Google, the Google logo, Android,
and the Android logo are registered trademarks of Google, Inc. Chrome is a trademark of Google, Inc.
BlackBerry, PlayBook, Research in Motion, and RIM are registered trademarks of BlackBerry. All other
terms, trademarks, or service marks mentioned in this document have been capitalized and are to be
considered the property of their respective owners.
Revision History
l ScrollBox
l TabPane
l Popup
l Calendar
l CheckBox
8/1/2014 17.0 l ComboBox
l DataGrid
l ListBox
l RadioButton
l TextArea
l TextBox
l Browser
l SegmentedUI
Table of Contents
1. Overview 61
1.1 Scope 61
1.5 Contact Us 62
2.2.1 setVisibility 66
2.2.2 setFocus 69
2.2.3 setEnabled 70
2.2.4 setGestureRecognizer 71
2.2.5 removeGestureRecognizer 75
2.2.6 setBadge 76
2.2.7 getBadge 77
3. Container Widgets 85
4. Form 86
4.1.1 enabledForIdleTimeout 91
4.1.2 footers 92
4.1.3 headers 93
4.1.4 id 94
4.1.5 info 95
4.1.6 menuFocusSkin 96
4.1.7 menuItems 97
4.1.8 menuNormalSkin 98
4.1.9 needAppMenu 99
5. HBox 196
5.1.2 id 198
6. VBox 253
6.1.2 id 255
7. ScrollBox 306
7.1.2 id 309
8. TabPane 353
8.1.4 id 359
9. Popup 400
9.1.3 id 404
11.1.2 id 484
12.1.8 id 535
13.1.2 id 616
14.1.2 id 656
15.1.5 id 714
16.1.2 id 770
17.1.1 id 805
18.1.1 id 834
19.1.2 id 849
20.1.2 id 885
21.1.4 id 953
22.1.2 id 1008
23.1.2 id 1018
24.1.1 id 1066
25.1.2 id 1099
26.1.3 id 1137
27.1.3 id 1190
29.1.4 id 1265
30.1.4 id 1302
31.1.4 id 1352
32.1.3 id 1406
33.1.4 id 1456
34.1.2 id 1500
35.1.2 id 1531
36.1.2 id 1549
37.1.4 id 1585
38.1.1 id 1693
39.1.1 id 1712
40.1.1 id 1737
41.1.3 ID 1754
1. Overview
Widgets are visual components that enhance development of mobile applications through minimal coding
effort. When the widgets are combined with an application, the widgets hold all the applications data and the
available interactions with this data.
Widgets often take the form of on-screen tools. The developers use different implementations of the widgets
available in the Integrated Development Environment (IDE) to build Graphical User Interfaces (GUI). All the
widgets described in this document are drag-and-drop widgets
All the Kony supported devices, development languages, and browsers are listed at, Supported Devices and
Browsers.
1.1 Scope
This document describes the usability of widgets, properties, and events within the IDE. This document
explains the classification and structure of all the widgets within the IDE and also describes the Layout.
Conventions Explanation
n User input text, system prompts and responses
n File Path
Monospace n Commands
n Program Code
n File Names.
n Emphasis
Italic n Names of Books and Documents
n New Terminology.
n Windows
n Menus
n Buttons
Bold n Icons
n Fields
n Tabs
n Folders.
URL Active link to a URL.
Note: Provides helpful hints or additional information.
1.5 Contact Us
We welcome your feedback on our documentation. Write to us at techpubs@kony.com.For technical
questions, suggestions, comments, or to report problems on Kony's product line, contact
productsupport@kony.com.
Kony Studio widgets are small chunks of code that are re-used without additional compilation. Some widgets
support interaction with the user (for example: Button, Label, Checkbox, and so on). Others act as containers
that group the widgets added to them (for example: Form, Row, Column, and so on).
The widgets are based on a common behavior definition and are made available across all supported native
and browser platforms, enabling you to deliver a consistent user experience across all devices using these
reusable components.
Kony Client libraries also include support for platform specific properties. The platform specific properties
allow you to have a native look and feel on the respective platforms. The IDE enables the development of
common functionality across all platforms, but also offers the ability for you to customize device specific
properties that are available only on certain platforms. Using this capability, you can maintain one code base,
but still deliver an optimized application experience for a specific device by configuring additional device or
platform properties provided by the platform.
These are a set of widgets that hold component widgets within them. The container widgets trigger events
upon receiving user actions. The following is a list of Container Widgets:
l Form
l HBox
l VBox
l TabPane
l Popup
l ScrollBox
These widgets are components that act independently of the Container Widgets. The following is a list of
Basic Widgets:
l Button
l Calendar
l CheckBoxGroup
l ComboBox
l DataGrid
l Image
l Label
l Line
l Link
l ListBox
l MenuItem
l RadioButtonGroup
l RichText
l Slider
l TextArea
l TextBox
l Browser
l Camera
l Chart
l Hz Image Strip
l ImageGallery
l Map
l ObjectSelector3D
l Phone
l PickerView
l Segment
l Switch
l SignatureCapture
l Video
l setVisibility
l setFocus
l setEnabled
l setGestureRecognizer
l removeGestureRecognizer
l setBadge
l getBadge
2.2.1 setVisibility
Use this method to set the visibility of the widget. The property animationConfig is supported only on the
following widgets:
l HBox
l VBox
l Button
l Calendar
l Image
l Label
l SegmentedUI
Default : true
Syntax
Note: The parameter animationConfig is supported only on iOS ( version 5.0 and above) and Android
(version 2.3 and above) platforms.
Note: This method is not applicable on Form, Popup, and Alert. It is also not applicable if the widget is
placed in a Segment.
When the widget is placed in a Segment, the default Visibility is set to true. If you want to change the value
to false, you can do so by using the Segment methods.
Input Parameters
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
None
Exceptions
Error
JavaScript Example
//Creating a form.
var frmBasicConf= {id:"form",title:"Form for kony Common widget API
Test",isVisibile:true};
var form = new kony.ui.Form2(frmBasicConf,{},{});
//Creating a button.
var btnBasic ={id:"btn",text:"button",isVisible:true};
var btn =new kony.ui.Button(btnBasic, {}, {});
Platform Availability
2.2.2 setFocus
Note: We recommend you not to call this method in preShow of a form as it is not respected by all
platforms. In Android platform, this method is not respected in preShow of a form. You can give focus to a
particular widget only after it is rendered on the screen, hence it should be called in postShow of a form.
Default : true
Syntax
JavaScript: setFocus(focus)
Note: This method is not applicable in Form widget. On BlackBerry platform to get the focus away from a
widget you need to setFocus to another widget. This is default SDK behavior.
Input Parameters
Return Values
None
Exceptions
Error
JavaScript Example
//Creating a form.
var frmBasicConf= {id:"form",title:"Form for kony Common widget API Test",
isVisibile:true};
var form = new kony.ui.Form2(frmBasicConf,{},{});
//Creating a button.
var btnBasic ={id:"btn",text:"button",isVisible:true};
var btn =new kony.ui.Button(btnBasic, {}, {});
Platform Availability
2.2.3 setEnabled
Syntax
Note: Browser widget does not support this method in Server side Mobile Web, SPA, and Desktop Web
platforms.
Input Parameters
Return Values
None
Exceptions
Error
Example
//Creating a form.
var frmBasicConf= {id:"form",title:"Form for kony Common widget API Test",
isVisibile:true};
var form = new kony.ui.Form2(frmBasicConf,{},{});
//Creating a button.
var btnBasic ={id:"btn",text:"button",isVisible:true};
var btn =new kony.ui.Button(btnBasic, {}, {});
Platform Availability
2.2.4 setGestureRecognizer
This method allows you to set a gesture recognizer for a specified gesture for a specified widget. You can set
a Gesture recognizer only for a Form, a Box, and a Scroll Box.
Note: This method is applicable on Form, Box, and ScrollBox widgets only.
Syntax
Input Parameters
l 1 for TAP
l 2 for SWIPE
l 3 for LONGPRESS
setupParams [array of arrays] - Mandatory
Specifies an object that has the configuration parameters needed to setup a gesture recognizer.
The configuration parameters vary based on the type of the gesture.
Gesture Type:TAP
For example,{fingers:1,taps:1}
Gesture Type:SWIPE
For example,
{fingers:1,swipedistance:50,swipevelocity:75}
For example,{pressDuration:1}
onGesturefunction(widgetRef,gestureInfo)
l widgetRef - specifies the handle to the widget on which the gesture was
recognized.
l gestureInfo - specifies an array that provides information about the gesture.
The contents of this array vary based on the gesture type.
The Kony platform populates the details in the gestureInfo array. This array has the
following key-value pairs:
l gestureType [number] - indicates the gesture type; 1 for TAP, 2 for SWIPE, and
3 for LONGPRESS.
l gesturesetUpParams [object] - this array is the set up parameters passed
while adding the gesture recognizer.
l gesturePosition [number] - indicates the position where the gesture was
recognized. Possible values are: 1 for TOPLEFT, 2 for TOPCENTER, 3 for
TOPRIGHT, 4 for MIDDLELEFT, 5 for MIDDLECENTER, 6 for MIDDLERIGHT,
7 for BOTTOMLEFT, 8 for BOTTOMCENTER, 9 for BOTTOMRIGHT, 10 for
CENTER.
l gestureY [number] - specifies the Y coordinate of the point (in pixels) where
the gesture has occurred. The coordinate is relative to the widget coordinate
system.
Return Values
Exceptions
Error
Example
//To add a TAP gesture recognizer on a hbox with ID hbx1 placed on a form
frm1
var tapGesture=frm1.hbx1.setGgestureRecognizer(1,setupTblTap,myTap);
Platform Availability
l iPhone/iPad
l Android
l BlackBerry
l Windows Phone
l SPA
2.2.5 removeGestureRecognizer
This method allows you to remove a specified gesture recognizer for a specified widget. You can remove the
gesture recognizer from a Form, a Box, and a Scroll Box.
Note: This method is applicable on Form, Box, and ScrollBox widgets only.
Syntax
JavaScript: removeGestureRecognizer(uniqueIdentifier)
Input Parameters
uniqueIdentifier - Mandatory
Indicates the type of gesture added to the form.
Return Values
None
Exceptions
Error
Example
//To add a TAP gesture recognizer on a hbox with ID hbx1 placed on a form
frm1
var tapGesture=frm1.hbx1.setGestureRecognizer(1,setupTblTap,myTap)
//To remove the TAP gesture recognizer on a hbox with ID hbx1 placed on a
form frm1
frm1.hbx1.removeGestureRecognizer(tapGesture);
Platform Availability
l iPhone/iPad
l Android
l BlackBerry
l Windows Phone
l SPA
2.2.6 setBadge
This method enables you to set the badge value to the given widget at the upper, right corner of the widget.
The color for badge can be defined using a skin.
Note: For iOS platform, this method is applicable on Box, Label, Button, Image, TextBox, and TextArea
widgets only.
Note: For Android platform, this method is applicable on Button and Image widgets only.
Syntax
Input Parameters
Return Values
None
Exceptions
Error
Example
//To set a badge value with skin "badgeSkin" on a box with ID hbx1 placed
on a form frm1, use the following code:
frm1.hbx1.setBadge("2","badgeSkin");
Platform Availability
l iPhone/iPad
l Android/Android Tablet
For more information about the badge APIs refer the Kony API Reference Document.
2.2.7 getBadge
This method enables you to read the badge value (if any) attached to the given widget.
Note: For iOS platform, this method is applicable on Box, Label, Button, Image, TextBox, and TextArea
widgets only.
Note: For Android platform, this method is applicable on Button and Image widgets only.
Syntax
JavaScript: getBadge()
Lua: getbadge(widget)
Input Parameters
Return Values
Exceptions
Error
Example
//To get a badge value on a box with ID hbx1 placed on a form frm1, use the
following code:
var badgeVal =frm1.hbx1.getBadge();
alert("badge value is::"+badgeVal);
Platform Availability
l iPhone/iPad
l Android/Android Tablet
For more information about the badge APIs refer the Kony API Reference Document.
When you add a widget to a form, the widget uses the default skin unless you specify a skin for the widget in
the widget skin properties.
For more information about creating skins, see the section Configuring Widget Skins in the Kony Studio User
Guide.
The following sections describe the support for Dynamic Skinning and Platform Specific Skin Limitations.
A widget can have more than one skin defined (for example, normal skin, focus skin, etc.) Dynamic Skinning
allows you to change the skin of a widget during runtime.
This means that you can set a skin for a widget dynamically through code.
For example, for a button in a Phone Widget, if you want to display different skins for successful and
unsuccessful dial attempts, enter the following:
function clickphone()
local retvalue = phone.dial("555-2368");
if retvalue == -1 then
frm1.btn1.skin = errorskin;
else
frm1.btn1.skin = successskin;
end
end
In the above code snippet, if the dial attempt is a failure, the errorskin is applied on the button. If the dial
attempt is a success, the successskin is applied.
Note: For Dynamic Skinning, you must ensure that the skin exists for the widget in the IDE before the code
is executed. JavaScript is not supported on Windows 6.x platform.
The following table lists the widgets and platforms which support dynamic skinning:
Windows
Android/
iPhone Mango/ Mobile
Widget Android BlackBerry SPA/Playbook
/iPad Windows Web
Tablet
6.x
Form Yes Yes Yes Yes Yes Yes
HBox Yes Yes Yes Yes Yes Yes
VBox Yes Yes Yes Yes Yes Yes
Button Yes Yes Yes Yes Yes Yes
Calendar Yes Yes Yes Yes Yes
CheckBoxGroup Yes Yes Yes Yes Yes
ComboBox Yes Yes Yes Yes
Image Yes Yes Yes Yes
Label Yes Yes Yes Yes Yes Yes
Line Yes Yes
Link Yes Yes Yes Yes
ListBox Yes Yes Yes Yes Yes
RadioButtonGroup Yes Yes Yes Yes Yes
Rich Text Yes Yes Yes
Windows
Android/
iPhone Mango/ Mobile
Widget Android BlackBerry SPA/Playbook
/iPad Windows Web
Tablet
6.x
TextArea Yes Yes Yes Yes
TextBox Yes Yes Yes Yes
ScrollBox Yes Yes Yes Yes Yes Yes
Yes
Signature (supported
on 6.x)
Video Yes Yes
iPhone
J2ME
BlackBerry
l Supports transparency for background and borders. Transparency is not supported for Fonts.
l If the skin style is set as transparent and a border is specified, the border color fills up the entire widget.
Therefore we recommend not using the skin type transparent along with a border.
l The form will ignore styles for widgets, when the size or the number of elements exceeds certain limit
(depending on blackberry device). For example, when there are 4 elements in a segment and 15 data
points are available, then segment may not apply style of the form or the CSS style depending on the
type of blackberry device.
Android
l Platforms do not support adding skins for the default App Menu items.
Mobile Web
l Skins are only supported for Form, Box, Label, and Button widgets to a limited extent.
l For box widgets, an on-focus skin is not implemented
l In button widget you can only change font color
Mobile Web Basic Devices
The following skin attributes are not supported on Mobile Web Basic devices:
Note: These units are used because support for pt or px based font is not uniform across basic
devices.
The following skin attributes are not supported on Mobile Web BJS devices:
The following are the restrictions for skin attributes for mobile Web Advanced platform:
l In the case of form backgrounds for gradients, the gradient is applied only up to the point where the
form ends. In cases where the form size is less than the screen height, a white background will appear
to cover the rest of the screen. This is only in case of BB Torch & Android devices less than 2.3
versions. To overcome this problem, the developer can provide an empty HBox or VBox with
padding/margin to the top and the bottom of the widget to cover the full screen size of the device. This
may cause a side effect of causing the form to scroll down.
l Focus skin for all widgets is not supported.
l Windows Phone browser (IE 7 browser) does not support transparency because the RGBA property is
not supported. Hence, for the widgets accessed from Mobile Web on Windows Phone, transparency
for widgets (background, font, and border) is not supported.
3. Container Widgets
Container widgets are a set of widgets that can hold component widgets within them.
l Form
l HBox
l VBox
l TabPane
l Popup
l ScrollBox
4. Form
Form is a visual area (basic application screen) that holds other widgets. You can use a form to set a title and
scroll content (similar to a web browser). The entire contents of the form except the headers and footers scroll
together. A form is the top most container widget. A form can contain any number of widgets but cannot
contain another form.
The screen width occupied by the form is the total available width of the mobile device; the virtual height is
determined by the number of widgets on the form (the total height of the form is sum of the virtual heights of its
first level visible child widgets).
For example, if Form1 has Button1, Button2, Button3, and an HBox (the height of the box in turn is the sum of
the heights of its child widgets), then the height of Form1 is the sum of the heights of Button1, Button2,
Button3, and an HBox. Form1 Width is the available screen width of the phone.
Form Lifecycle
A form lets you add other container and widgets to create a widget hierarchy. A form fills the device screen
provided for an application (excluding the device level screen controls like status bar).
Form stacking:
Typically a form is shown by a user action on another form. That means the navigation between forms happen
by the events on another form. All the navigation actions are pushed into the stack to track the navigation
path, so that the user can navigate back to the previous forms in the exact reverse order of its forward
navigation. When navigation to a form that is already visited and available in the middle of the stack, the target
form is brought back to the top of the stack by popping all the above forms out of the stack. Currently this
stack is not exposed directly to the developers and in future there will be APIs around manipulating this stack
directly.
Lifecycle Methods:
A form is defined to have a lifecycle method that gets called at appropriate events. These events allow you to
manage the application for better resource handling.
addWidgets - called when the form is used for first time either
Any of the following can trigger the addWidgets method of form1 if form1 is not yet initialized:
l form1.label1
l form1.title
l form1.show()
init - called immediately after an addWidgets event for any initializations required for the form. Init initializes
the form and any widgets.
In case of Server side Mobile Web and SPA, addWidgets and init events gets called as soon as the form is
created. In case of native platforms, as an optimization, these events are deferred until the first access.
preShow - called just before a form is visible on the screen. A form can be made visible by explicitly calling
the show method of the form.
postShow - called immediately after the form is visible on the screen. A form is made visible by explicitly
calling the show method of the form.
onHide - called when the form goes out of the screen. A form can go out of the screen when another form is to
be shown.
onDestroy - called when a form is destroyed. A form is destroyed when the developer explicitly calls destroy
and this event gets called before destroying the form.
A form provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
Events, and Methods.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
For backward compatibility with support for all deprecated properties and behaviors, use the constructor
kony.ui.Form.
Form Types
Kony platform allows you to develop truly native applications (which use native widgets) or Hybrid
applications. Hybrid applications are a version of the native application where some forms of the application
are rendered in the WebView while others are rendered using the native SDK. You can choose the forms to be
either native or web-based. The web-based forms can either be statically packaged (Static) along with the
application or loaded from a URL(Dynamic).
Depending on the nature of the application developed, the developer can choose one of the following form
types when creating a new form:
l Native
l Web-based
l Static
l Dynamic
The characteristics of each type of form are listed in the table below:
Form Type
Characteristics Web-based
Native
Static Dynamic
Rendering engine used
Native SDK UIWebView UIWebView
to display form
UI definition (the
packaged along with the packaged along with the downloaded from the
widget layout and
application application server
skins)
UI logic (logic that
alters the user packaged along with the packaged along with the downloaded from the
experience based on application application server
business rules)
downloaded from the downloaded from the
Business Data downloaded from the server
server server
The form lays out the first level child widgets one below the other. Each widget occupies the same width as
form and the height is determined by the preferred height of the widget.
Note: For a form, there is no limit set on the vertical height and hence a form never declines the child
widgets request for preferred height.
l enabledForIdleTimeout
l footers
l headers
l id
l info
l menuFocusSkin
l menuItems
l menuNormalSkin
l needAppMenu
l skin
l title
l type
4.1.1 enabledForIdleTimeout
Idle time indicates the amount of time that a user has not interacted with the application. Some of the
applications require a notification to be raised when a user has not interacted with the form for a specified
amount of time. For example, a banking app might require a notification after 5 minutes of inactivity by the
user. At the same time, applications also need an ability to not raise this notification for certain forms in the
application. For example, ATM Locator forms in a banking app, enabledForIdleTimeout property indicates, if
the form is going to raise the notification after a specific period of inactivity (set using the API
kony.application.registerForIdleTimeout.)
Default: false (the session will not expire after a period of inactivity).
If you want the session to expire after a period of inactivity (for example, you might require a Bank Accounts
page of a site to expire after a period of inactivity), you can enable the time out period set in code by selecting
the checkbox.
For more information about enabled for idle timeout, see API kony.application.registerForIdleTimeout in the
Kony API User Guide.
Syntax
JavaScript: enabledForIdleTimeout
Lua: enabledforidletimeout
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.1.2 footers
A footer is a section of the form that is docked at the bottom of the form (does not scroll along with the content
of the form). It accepts an array of kony.ui.Box object references with horizontal orientation that are added as
footer docked at the bottom of the Form. These footers can be reused across forms.
Syntax
JavaScript: footers
Lua: footers
Type
JavaScript: Array(kony.ui.Box)
Lua: Table
Read / Write
JavaScript Example
//Defining a form with footers:[hbox3,hbox4], Where hbox3 and hbox4 are the
horizontal boxes which were created and made accessible and btn2 is present
in hbox3.
var frmBasic = {id:"frm", type:constants.FORM_TYPE_NATIVE, title:"Welcome",
skin:"frmSkin", needAppMenu:true, enabledForIdleTimeout:true, headers:[hbo
x1,hbox2], footers:[hbox3,hbox4], menuNormalSkin:"mSkin", menuFocusSkin:"m
FSkin", menuItems:[menu1,menu2]};
var frmLayout ={displayOrientation:constants.FORM_DISPLAY_ORIENTATION_BOTH,
paddingInPixel:false, padding:[5,5,5,5]};
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.1.3 headers
A header is a section of the form that is docked at the top of the form (does not scroll along with the content of
the form). It accepts an array of kony.ui.Box object references with horizontal orientation that are added as
header docked at the top of the Form. These headers can be reused across forms.
Syntax
JavaScript: headers
Lua: headers
Type
JavaScript: Array(kony.ui.Box)
Lua: Table
Read / Write
JavaScript Example
//Defining a form with headers:[hbox1,hbox2], Where hbox1 and hbox2 are the
horizontal boxes which were created and made accessible and btn1 is present
in hbox1.
var frmBasic = {id:"frm", type:constants.FORM_TYPE_NATIVE, title:"Welcome",
skin:"frmSkin", needAppMenu:true, enabledForIdleTimeout:true, headers:[hbo
x1,hbox2], footers:[hbox3,hbox4], menuNormalSkin:"mSkin", menuFocusSkin:"m
FSkin", menuItems:[menu1,menu2]};
var frmLayout ={displayOrientation:constants.FORM_DISPLAY_ORIENTATION_BOTH,
paddingInPixel:false, padding:[5,5,5,5]};
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.1.4 id
id is a unique identifier of form consisting of alpha numeric characters. Every Form should have a unique id
within an application.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
//Creating a form.
Yes
Platform Availability
4.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
frm.info = {key:"FORM"};
//Reading info of the form.
alert("form info is ::"+frm.info);
No
Platform Availability
4.1.6 menuFocusSkin
This is a skin property of a form level menu and it determines the look and feel of the Menu Item when
focused.
Note: For BlackBerry (7 and below) and J2ME, this property is applicable only if the property Show Tab
Style Form Menu is set to true.
Note: For Desktop Web platform, use MenuContainer widgets to get menu related features.
Syntax
JavaScript: menuFocusSkin
Lua: menufocusskin
Type
JavaScript: String
Lua: String
Read / Write
Yes - (Write only) [Applicable on BlackBerry, J2ME, and Window Phone (Mango) platforms]
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l BlackBerry
l Window Phone (Mango)
4.1.7 menuItems
menuItems represents the list of items to be displayed in the device menu control. Unlike application menu
items, which are available across all the forms, these items are only available for a specific form.
Note: For Desktop Web platform, use MenuContainer widgets to get menu related features.
Syntax
JavaScript: menuItems
Lua: menuitems
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
Available on all platforms except iOS, SPA, Desktop Web, Windows Kiosk, and Windows Tablet
4.1.8 menuNormalSkin
This is a skin property and it determines the look and feel of a menu items when not in focus.
Note: For Desktop Web platform, use MenuContainer widgets to get menu related features.
Syntax
JavaScript: menuNormalSkin
Lua: menunormalskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
Available on all platforms except Windows Tablet, Windows Kiosk, and Desktop Web
4.1.9 needAppMenu
Specifies if the application menu items should be displayed as a part of the menu controls on the form.
Syntax
JavaScript: needAppMenu
Lua: needappmenu
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.1.10 skin
Note: Server side Mobile Web (basic ) and SPA (BB NTH) devices does not support Vertical gradient and
Vertical split skins. Transparent skin is not supported on SPA (Windows) platform.
Note: Server side Mobile Web (BB xhtml) does not support Image skin.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
paddingInPixel:false, padding:[5,5,5,5]};
var frmPSP ={};
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.1.11 title
Syntax
JavaScript: title
Lua: title
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.1.12 type
Specifies the type of Form. The following are the available types of Form:
l FORM_TYPE_NATIVE (default)
l FORM_TYPE_STATIC
l FORM_TYPE_DYNAMIC
Note: Windows Phone (Mango) and Desktop Web platforms support only FORM_TYPE_NATIVE option.
Syntax
JavaScript: type
Lua: type
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
//Creating a form.
Yes
Platform Availability
l displayOrientation
l gridCell
l layoutMeta
l layoutType
l padding
l paddingInPixel
4.2.1 displayOrientation
To know more about iPad Orientations and FAQ's, see iPad_Orientations in Kony Studio User Guide.
Note: For iOS, in general, and BlackBerry, the orientation mode is respected only if the device is in that
orientation already. For example, if a form orientation is set as landscape, it will display the form in
landscape mode only if the device is already in the landscape mode. Generally the user is asked to rotate
the device in the landscape mode before displaying a form which is marked as landscape.
Note: For Windows Phone 8 and Windows 8.1, irrespective of the orientation, if the image has to be appear
as it was capture, set the displayOrientation as FORM_DISPLAY_ORIENTATION_BOTH. If you set
displayOrientation as FORM_DISPLAY_ORIENTATION_PORTRAIT and the image is captured in
landscape mode, then the captured image is tilted by 90 degrees when the device is rotated.
Syntax
JavaScript: displayOrientation
Lua: displayorientation
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Windows Kiosk, Desktop Web, and SPA (all
channels)
4.2.2 gridCell
Note: This property is applicable only when a widget is placed inside a container widget with Grid Layout
applied.
Represents the grid cell details in the sequence colSpan, rowSpan, rowNo, colNo. Description of the details
are as follows:
l colSpan: Specifies the number of columns that a grid should span. Default value is 1.
l rowSpan: Specifies the number of rows that a grid should span. Default value is 1.
l rowNo: Specifies the row number in where the widget is placed in a grid layout.
l colNo: Specifies the column number in where the widget is placed in a grid layout.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. The default option is XYLayout. To set GridLayout, right-click on the form and select Apply
GridLayout.
Syntax
JavaScript: gridCell
Lua: gridCell
Type
JavaScript: JSObject
Lua:table
Read / Write
JavaScript Example
"cols": 8,
"colmeta": ["15", "15", "15", "15", "15", "15", "5", "5"],
"rows": 4
}, gridcell: {"colSpan":1, "rowSpan":1, "rowNo":1, "colNo":1}};
var frmPSP ={};
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l Windows Tablet
l Desktop Web
4.2.3 layoutMeta
A custom JSObject with the key, value pairs that developer can use to provide the meta info about the grid
layout. The following are the mandatory keys required to be part of the Meta.
Note: The data for layoutmeta data is set when you set grid layout view properties for rows and columns.
This property can be set using Kony Studio Grid Layout view. To set the view, go to Window > Show View >
Others and select GridLayout View from Kony Studio folder.
The sum total of percentage (%) widths of each of the columns in the grid layout should add up to 100%.
Syntax
JavaScript: layoutMeta
Lua: layoutmeta
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l Windows Tablet
l Desktop Web
4.2.4 layoutType
Defines the type of the layout of widget. Following are the available options:
l CONTAINER_LAYOUT_BOX: This is the default options on both Windows Tablet and Desktop Web
platforms.
l CONTAINER_LAYOUT_GRID: In grid layout the form is split it to rows and columns.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. From the IDE, the default option is XYLayout. To set GridLayout, right-click on the form and select
Apply GridLayout.
Syntax
JavaScript: layoutType
Lua: layouttype
Type
Lua:String - [Mandatory]
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l Windows Tablet
l Desktop Web
4.2.5 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied. The Array accepts the
values in the sequence [left, top, right, bottom].
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform. Padding is not supported by Windows Mobile browser for Box and Image Gallery.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.2.6 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l BlackBerry 10
l actionBarIcon
l animateHeaderFooter
l bounces
l captureGPS
l contextPath
l configureExtendTop
l configureExtendBottom
l configureBarStyle
l defaultIndicatorColor
l enablePeekGesture
l extendTop
l extendBottom
l statusBarStyle
l footerOverlap
l formTransperencyDuringPostShow
l headerOverlap
l inputAccessoryViewType
l inTransitionConfig
l layout
l maxAppMenuButtons
l menuPosition
l needsIndicatorDuringPostShow
l noCache
l outTransitionConfig
l retainScrollPosition
l scrollDirection
l secureData
l showBottomActionBar
l showActionBar
l showActionBarIcon
l showMiniAppMenu
l submitSecure
l titleBar
l titleBarConfig
l titleBarSkin
l viewConfig
l windowSoftInputMode
4.3.1 actionBarIcon
Specifies the image for action bar icon. It is displayed on the left side of the action bar.
Note: This property is displayed in the widget properties list only when you select SDK versions 3.0 and
above in the Application Properties > Native > Android > SDK Versions section.
Note: The application icon is displayed, when the image for action bar icon is not selected but the
showActionBarIcon is set to true.
Syntax
JavaScript: actionBarIcon
Type
JavaScript: String
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.2 animateHeaderFooter
Specifies if the headers and footers of the Form must slide up and down respectively away from the view
when the Form is in transition.
Note: The headers and footers will animate only if the headers and footers of the transitioning Forms are
different and have the property set to true.
If you want to allow animation of headers and footers, set the value to true.
Syntax
JavaScript: animateHeaderFooter
Lua: animateheaderfooter
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.3 bounces
Specifies whether the scroll view bounces past the edge of the content and back again.
Default:true
Syntax
JavaScript: bounces
Type
JavaScript: Boolean
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.4 captureGPS
Specifies if the Form must display a popup seeking permission from the user to access the location details.
Note: For this property to work, you must have selected Requires GPS functionality in the Project
Properties of the Application (For more information, see the Configuring Project Properties section of the
Kony Studio User Guide) to enable the application to use the GPS functionality.
Default: false (the checkbox is not selected and the popup does not appear when you navigate to the Form)
If you want the popup to appear when you navigate to the specified Form, set the value to true (select the
checkbox).
The following image illustrates the popup to access the location details:
Syntax
JavaScript: captureGPS
Lua: capturegps
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.5 contextPath
Specifies the context path to be displayed in the address field of the browser. For more information about
specifying a context path, refer the Kony Studio Users Guide.
Default: none
Note: This field is only populated when you specify a Context ID and a corresponding Context Path in the
Site Minder tab under Mobile web in the Project properties window.
Syntax
JavaScript: contextPath
Lua: contextpath
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.6 configureExtendTop
Default:false
Syntax
Read / Write
No
Yes
Platform Availability
l iPhone
l iPad
4.3.7 configureExtendBottom
Default:false
Syntax
Read / Write
No
Yes
Platform Availability
l iPhone
l iPad
4.3.8 configureBarStyle
Default:false
Syntax
JavaScript: configureBarStyle
Type
JavaScript: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.9 defaultIndicatorColor
This property enables you to set color to the progress indicator when it is show on the form. It overrides the
application level setting set using setApplicationbehavior() for this form.
Syntax
JavaScript: defaultIndicatorColor
Type
JavaScript: String
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
No
Platform Availability
l Android
l Android Tablet
4.3.10 enablePeekGesture
Default:true
Syntax
JavaScript: enablePeekGesture
Type
JavaScript: Boolean
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
form.enablePeekGesture = true;
No
Platform Availability
4.3.11 extendTop
Specifies the form content to scroll under the App Menu. This property is supported in iOS7 and above only.
This property is also applicable on the Application Level properties under Application Properties > Native
> iPhone/iPad > Platform Settings. The property set at form level takes precedence over Application level.
Default:false
Note: This property is applicable on form level headers and footers, app level headers and footers, title bar,
and app menu.
Syntax
JavaScript: extendTop
Type
JavaScript: Boolean
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.12 extendBottom
This property enables you to configure extendBottom property. This property is supported in iOS7 and above
only. This property is also applicable on the Application Level properties under Application Properties > Native
> iPhone/iPad > Platform Settings. The property set at form level takes precedence over Application level.
Default:false
Note: This property is applicable on form level headers and footers, app level headers and footers, title bar,
and app menu.
Syntax
JavaScript: extendBottom
Type
JavaScript: String
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.13 statusBarStyle
JavaScript: statusBarStyle
Type
JavaScript: String
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.14 footerOverlap
Specifies if the footer must overlap the form. For example, every time you scroll the form, the footer is fixed
and the footer overlap the form as specified in the Footer Overlap field. If this field is selected, the form scrolls
behind the footer background and a part of the footer background is transparent.
Default: false
Syntax
JavaScript: footerOverlap
Lua: footeroverlap
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
4.3.15 formTransparencyDuringPostShow
Normally, when a form is loading, the user interface is blocked. You can use this property to specify the
percentage of transparency.
Default: 100
Syntax
JavaScript: formTransparencyDuringPostShow
Lua: formtransparencyduringpostshow
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.16 headerOverlap
Specifies if the header must overlap the form. For example, every time you scroll the form, the header is fixed
and the header overlap the form as specified in the header overlap field. If this field is selected, the form
scrolls behind the header background and a part of the header background is transparent.
Default: false
Syntax
JavaScript: headerOverlap
Lua: headeroverlap
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
4.3.17 inputAccessoryViewType
When building iPhone applications that support or provide text input, it's often necessary to create some extra
buttons (or other controls) beyond the ones provided by the default keyboard interface. Kony Platform by
default, adds the Previous, Next and Done buttons to the applicable input controls. These buttons allow
specific operations needed by your application, such as moving to the next or previous text field, make the
keyboard disappear. The area above the keyboard is known as Input Accessory View.
This property, allows you to specify the type of accessory view that will be shown for all the input controls on
this form.
Note: The inputAccessoryViewType defined in the form level takes precedence over the
inputAccessoryViewType defined in application level settings.
Note: For iOS, by default header with "Prev" and "Next" buttons will be prepended to the keypad. This
header can be turned off at two levels Application Level and Form Level.
1. Go to Applications view.
2. Right-click on the application and select Properties.
3. Navigate to Native App tab, under Platform Settings change the value to none.
Default: FORM_INPUTACCESSORYVIEW_DEFAULT
l FORM_INPUTACCESSORYVIEW_NONE: Use this option if you do not want to specify the toolbar.
This option should be used carefully, as setting this option for widgets like calendar leaves the user
with no option to select and drop-down a wheel calendar.
l FORM_INPUTACCESSORYVIEW_DEFAULT: Specifies that the toolbar that is defined in the
Application level settings. To set the Application level settings, right-click on the project and navigate
to Properties> Native App>iPhone/iPad.
Syntax
JavaScript: inputAccessoryViewType
Lua: inputaccessoryviewtype
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.18 inTransitionConfig
Specifies the configuration to be used when the user arrives on this form. It accepts hash values.
Note: On iOS platform, In Transition is the transition that gets applied as the form enters the navigation
stack. Every form.show either results in push into navigation stack ( enter the navigation stack) or if the form
is already in stack, results popping up all the forms including the current form from the navigation stack. This
is done to be in sync with the iOS native semantics of form (UIView Controller) transitions.
transitionDuration: Specifies the duration after which the transition is applied on the Form. The default value
is 0.3 seconds.
transitionDirection: Specifies the direction from which the Form is displayed. The available options are:
1. none - Use this option if you do not want to specify a transition direction.
2. fromRight - Specifies that the Form must appear from the right.
3. fromLeft - Specifies that the Form must appear from the left.
4. fromBottom - Specifies that the Form must appear from the bottom.
5. fromTop - Specifies that the Form must appear from the top.
transitionEffect: Specifies the effect from which the form is displayed. The available options are:
1. none - Use this option if you do not want to specify a transition direction.
2. transitionFade - Specifies that the form must fade when it is transitioned to a hidden or an invisible
state.
3. transitionMoveIn - Specifies that the form must slide over the existing content in the direction as
specified in the transitionDirection.
4. transitionPush - Specifies that the form must push the existing content in the direction as specified in
the transitionDirection and take its place.
5. transitionFlip - Specifies that the form must be rotated along the Y-axis as the content is being
displayed. It supports transition directions fromRight and fromLeft only.
6. transitionReveal - Specifies that the form must be revealed gradually in the direction as specified in the
transitionDirection.
7. transitionCurl - Specifies that the form must be curled or folded (look and feel is similar to turning of a
page in a book) as the content is being displayed. It supports transition directions fromTop and
fromBottom only.
8. transitionTwoSplitHorizontalIn - Specifies the form which is split horizontally into two parts rejoins
when the transition takes place.
9. transitionTwoSplitVerticalIn - Specifies the form which is split vertically into two parts rejoins when the
transition takes place.
10. transitionFourSplitIn - Specifies the form which is split in four parts rejoins when the transition takes
place.
11. transitionFourSplitRotateIn - Specifies the form which is split in four parts rejoins by rotating the parts
when the transition takes place.
12. transitionTwoSplitHorizontalOut - Specifies the form which is split horizontally into two parts and move
away when the transition takes place.
13. transitionTwoSplitVerticalOut - Specifies the form which is split vertically into two parts and move
away when the transition takes place.
14. transitionFourSplitRotateOut - Specifies the form which is split in four parts move away by rotating the
parts when the transition takes place.
15. transitionSwitchLeft - Specifies that the form must go out of the view in 3D circular space along the Y-
axis towards left as the content is being displayed.
16. transitionSwitchRight - Specifies that the form must go out of the view in 3D circular space along the
Y-axis towards right as the content is being displayed.
17. transitionCloth - Specifies the present form must go out of screen animating as if a cloth is removed.
18. transitionFlipRight - Specifies that the form must be rotated along the Y-axis as the content is being
displayed giving an illusion of a page is turned towards right in a book.
19. transitionFlipLeft - Specifies that the form must be rotated along the Y-axis as the content is being
displayed giving an illusion of a page is turned towards left in a book.
20. transitionDoor - Specifies that the form must be revealed giving an illusion of a opening a door.
21. transitionRotateExchange - Specifies that the form must be rotated along the X-axis as the content is
being displayed.
1. default/none - The constant value is 0. The default device effect is applied or none of the effect is
applied.
2. bottom-top - The constant value is 1. It specifies that the form must slide-in from the bottom and
proceed towards the top.
3. from left - The constant value is 2. It specifies that the form must slide-in from the left with a fade
effect.
4. from right - The constant value is 3. It specifies that the form must slide-in from the right with a fade
effect.
5. to right - The constant value is 4. It specifies that the form must slide-out to the right with a fade effect.
6. to left - The constant value is 5. It specifies that the form must slide-out to the left with a fade effect.
7. from center - The constant value is 6. It specifies that the form must grow from the center with a fade
effect.
8. topright-bottom - The constant value is 7. It specifies that the form must slide-in from the top-right
corner and proceed towards the bottom.
9. bottomleft-top - The constant value is 8. It specifies that the form must slide-in from the bottom-left
corner and proceed towards the top.
10. bottom-top style1 - The constant value is 9. It specifies that the form must shrink from the bottom
towards the top.
11. top down - The constant value is 10. It specifies that the form must slide-in from the top and proceed
towards the bottom.
frm.inTransitionConfig= { formAnimation: 1 };
transitionMode: Specifies the direction from which the From is displayed. The available options are:
1. Default (none) - The default device effect is applied or none of the effect is applied.
2. Sequential- The transition of the Form going out of the view completes first and then the transition of
the Form coming into the view takes place.
3. Parallel- The transition of the Form going out of the view and the transition of the Form coming into the
view takes place simultaneously.
inTransition: Specifies the effect from which the From is displayed. The available options are:
1. Default (none) - Specifies that the Form must slide horizontally into the view.
2. Rotate3DSingle - Specifies that the Form must be rotated along the center Y-Axis when coming into
the view.
3. Rotate3DDual - Specifies that the Form must be shown making a circle around the screen from the
background before coming into the view.
4. Slide - Specifies that the Form must slide horizontally into the view.
5. Pop - Specifies that the Form must emerge from center-bottom of the screen and gradually occupy the
complete screen.
6. Squeeze - Specifies that the Form must be expanded horizontally from an initial width of zero.
transitionSpeed: Specifies the speed at which the From is transitioned. The value must be specified in
seconds.
On Symbian Platform, Default Transition can be set to true or false. When set to true, the default transition is
applied.
On SPA and Desktop Web Platforms, Transition has the below options to set:
1. None- Use this option if you do not want to specify a transition direction.
2. Top Center - Specifies that the form must appear from the top center.
3. Bottom Center - Specifies that the form must appear from the bottom center.
4. Right Center - Specifies that the form must appear from the right center.
5. Left Center - Specifies that the form must appear from the left center.
Syntax
JavaScript: inTransitionConfig
Lua: intransitionconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
Available on all platforms except BlackBerry, Server side Mobile Web, and Windows Tablet.
4.3.19 layout
Default: Vertical
JavaScript: layout
Lua: layout
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.20 maxAppMenuButtons
Default: 4
Syntax
JavaScript: maxAppMenuButtons
Type
JavaScript: Number
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l Windows Phone
l Windows Tablet
l Windows Kiosk
4.3.21 menuPosition
Specifies if the application menu is shown or hidden in the application. In some platforms, form menu items
appear along with app menu items. This property allows developer to configure weather to append at the end
of application menu list or inserted at beginning of the application menus.
Default : FORM_MENU_POSITION_AFTER_APPMENU
l FORM_MENU_POSITION_BEFORE_APPMENU
l FORM_MENU_POSITION_AFTER_APPMENU
Syntax
JavaScript: menuPosition
Lua: menuposition
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.22 needsIndicatorDuringPostShow
Specifies if there must be an indication to the user that the form content is being loaded.
You can use this property typically for forms that require network calls during post show.
Default: true
Syntax
JavaScript: needsIndicatorDuringPostShow
Lua: needsindicatorduringpostshow
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
4.3.23 noCache
A web cache is a mechanism for the temporary storage (caching) of web documents, such as HTML pages
and images, to reduce bandwidth usage, server load, and perceived lag. This property indicates that if the
form is enabled for caching on the device browser.
Default: true
If set to false, appropriate Cache control headers are included in the HTTP response.
If set to true, cache control headers are not included in the HTTP response.
Syntax
JavaScript: noCache
Lua: nocache
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.24 outTransitionConfig
Specifies the type of transition effect to be applied when the Form is going out of view. It accepts hash values.
Note: On iOS platform, Out Transition is the transition that gets applied as the form leaves the navigation
stack. Every form.show either results in push into navigation stack ( enter the navigation stack) or if the form
is already in stack, results popping up all the forms including the current form from the navigation stack. This
is done to be in sync with the iOS native semantics of form (UIView Controller) transitions.
transitionDuration: Specifies the duration after which the transition is applied on the Form. The default value
is 0.3 seconds.
transitionDirection: Specifies the direction from which the Form must disappear in a view. You can choose
one of the following options:
1. none - Use this option if you do not want to specify a transition direction.
2. fromRight - Specifies that the Form must disappear from the right.
3. fromLeft - Specifies that the Form must disappear from the left.
4. fromBottom - Specifies that the Form must disappear from the bottom.
5. fromTop - Specifies that the Form must disappear from the top.
transitionEffect: Specifies the type of transition effect to be applied when the Form disappears in the view.
You can choose one of the following transition effects:
1. none - Use this option if you do not want to specify a transition direction.
2. transitionFade - Specifies that the form must fade when it is transitioned to a hidden or an invisible
state.
3. transitionMoveIn - Specifies that the form must slide over the existing content in the direction as
specified in the transitionDirection.
4. transitionPush - Specifies that the form must push the existing content in the direction as specified in
the transitionDirection and take its place.
5. transitionFlip - Specifies that the form must be rotated along the Y-axis as the content is being
displayed. It supports transition directions fromRight and fromLeft only.
6. transitionReveal - Specifies that the form must be revealed gradually in the direction as specified in the
transitionDirection.
7. transitionCurl - Specifies that the form must be curled or folded (look and feel is similar to turning of a
page in a book) as the content is being displayed. It supports transition directions fromTop and
fromBottom only.
8. transitionTwoSplitHorizontalIn - Specifies the form which is split horizontally into two parts rejoins
when the transition takes place.
9. transitionTwoSplitVerticalIn - Specifies the form which is split vertically into two parts rejoins when the
transition takes place.
10. transitionFourSplitIn - Specifies the form which is split in four parts rejoins when the transition takes
place.
11. transitionFourSplitRotateIn - Specifies the form which is split in four parts rejoins by rotating the parts
when the transition takes place.
12. transitionTwoSplitHorizontalOut - Specifies the form which is split horizontally into two parts and move
away when the transition takes place.
13. transitionTwoSplitVerticalOut - Specifies the form which is split vertically into two parts and move
away when the transition takes place.
14. transitionFourSplitRotateOut - Specifies the form which is split in four parts move away by rotating the
parts when the transition takes place.
15. transitionSwitchLeft - Specifies that the form must go out of the view in 3D circular space along the Y-
axis towards left as the content is being displayed.
16. transitionSwitchRight - Specifies that the form must go out of the view in 3D circular space along the
Y-axis towards right as the content is being displayed.
17. transitionCloth - Specifies the present form must go out of screen animating as if a cloth is removed.
18. transitionFlipRight - Specifies that the form must be rotated along the Y-axis as the content is being
displayed giving an illusion of a page is turned towards right in a book.
19. transitionFlipLeft - Specifies that the form must be rotated along the Y-axis as the content is being
displayed giving an illusion of a page is turned towards left in a book.
20. transitionDoor - Specifies that the form must be revealed giving an illusion of a opening a door.
21. transitionRotateExchange - Specifies that the form must be rotated along the X-axis as the content is
being displayed.
1. default/none - The constant value is 0. The default device effect is applied or none of the effect is
applied.
2. bottom-top - The constant value is 1. It specifies that the form must slide-out from the bottom and
proceed towards the top.
3. from left - The constant value is 2. It specifies that the form must slide-out from the left with a fade
effect.
4. from right - The constant value is 3. It specifies that the form must slide-out from the right with a fade
effect.
5. to right- The constant value is 4. It specifies that the form must slide-in to the right with a fade effect.
6. to left- The constant value is 5. It specifies that the form must slide-in to the left with a fade effect.
7. from center- The constant value is 6. It specifies that the form must grow from the center with a fade
effect.
8. topright-bottom - The constant value is 7. It specifies that the form must slide-in from the top-right
corner and proceed towards the bottom.
9. bottomleft-top - The constant value is 8. It specifies that the form must slide-in from the bottom-left
corner and proceed towards the top.
10. bottom-top style1 - The constant value is 9. It specifies that the form must shrink from the bottom
towards the top.
11. top down - The constant value is 10. It specifies that the form must slide-in from the top and proceed
towards the bottom.
frm.outTransitionConfig= { formAnimation: 10 };
transitionMode: Specifies the direction from which the From is displayed. The available options are:
1. Default (none)- The default device effect is applied or none of the effect is applied.
2. Sequential- The transition of the Form going out of the view completes first and then the transition of
the Form coming into the view takes place.
3. Parallel- The transition of the Form going out of the view and the transition of the Form coming into the
view takes place simultaneously.
outTransition: Specifies the effect from which the From is displayed. The available options are:
1. Default (none)- Specifies that the Form must slide horizontally into the view.
2. Rotate3DSingle - Specifies that the Form must be rotated along the center Y-Axis when coming into
the view.
3. Rotate3DDual - Specifies that the Form must be shown making a circle around the screen from the
background before coming into the view.
4. Slide - Specifies that the Form must slide horizontally into the view.
5. Pop - Specifies that the Form must emerge from center-bottom of the screen and gradually occupy the
complete screen.
6. Squeeze - Specifies that the Form must be expanded horizontally from an initial width of zero.
transitionSpeed: Specifies the speed at which the From is transitioned. The value must be specified in
seconds.
On Symbian Platform, Default Transition can be set to true or false. When set to true, the default transition is
applied.
On SPA and Desktop Web Platforms, Transition has the below options to set:
1. None- Use this option if you do not want to specify a transition direction.
2. Top Center - Specifies that the form must disappear from the top center.
3. Bottom Center - Specifies that the form must disappear from the bottom center.
4. Right Center - Specifies that the form must disappear from the right center.
5. Left Center - Specifies that the form must appear from the left center.
Syntax
JavaScript: outTransitionConfig
Lua: outtransitionconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
Available on all platforms except BlackBerry, Server side Mobile Web, and Windows Tablet.
4.3.25 retainScrollPosition
Specifies if the Form must remember the scroll position when the user revisits the Form.
If set to true, the scroll position of the Form is retained at the same location when the Form was last visited.
Syntax
JavaScript: retainScrollPosition
Lua: retainscrollposition
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
Available on all platforms except on Server side Mobile Web and Windows Phone platforms.
4.3.26 scrollDirection
Default : SCROLL_VERTICAL
JavaScript: scrollDirection
Type
JavaScript: Number
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
No
Platform Availability
l iPhone
l iPad
4.3.27 secureData
Specifies if the browser must retain and use the information that you have filled in a form (for example,
username and password) and use it during the POST request made when you refresh the browser or use the
back button on the browser.
Default: the option is not selected (the browser will retain data and use it during POST request)
If you do not want the browser to use the information during the POST request made when you refresh the
browser or use the back button on the browser, select the checkbox.
Syntax
JavaScript: secureData
Lua: securedata
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.28 showBottomActionBar
Default:true
Syntax
JavaScript: showBottomActionBar
Type
JavaScript: Boolean
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
form.showBottomActionBar = true;
No
Platform Availability
4.3.29 showActionBar
Note: This property is displayed in the widget properties list only when you select SDK versions 3.0 and
above in the Application Properties > Native > Android > SDK Versions section.
Default: true
Syntax
JavaScript: showActionBar
Type
JavaScript: Boolean
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.30 showActionBarIcon
Note: This property is displayed in the widget properties list only when you select SDK versions 3.0 and
above in the Application Properties > Native > Android > SDK Versions section.
Default: true
Syntax
JavaScript: showActionBarIcon
Type
JavaScript: Boolean
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.31 showMiniAppMenu
Default: false
The below image illustrates the default mode of an application menu of the form:
Mini
If you set the value to mini the application menu is minimized in the application.
The below image illustrates the Mini mode of an application menu of the form:
Syntax
JavaScript: showMiniAppMenu
Lua: showminiappmenu
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.32 submitSecure
Specifies if the information must be sent using secure connection (https) or insecure connection (http).
This property is useful in scenarios where you want the information sent to be secure. For example, credit
card user credentials, transactions etc.
Default: false (the checkbox is not selected and the information sent is not secure)
To send information securely, set the value to true (select the checkbox).
Note: If you have marked a form to be submitted through a secure protocol, then the popup that is displayed
on the form is also submitted through secured protocol.
Syntax
JavaScript: submitSecure
Lua: submitsecure
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.33 titleBar
Default: true
Default: true for android and windows Tablet and false for iPad.
l Show Form Titlebar : Specifies if the form title must be visible or invisible.
l Show Back button : Specifies if the back button must be displayed in the Form.
You can set the skins for the above two options using the respective drop down box.
We recommend the below image size for form title bar on iOS platform:
iPhone/iPod (3rd and iPhone 5th iPad (1st, 2nd, and 3rd
4th Generations Generation Generations)
Portrait Mode (Non-Retina) 320x44 px NA 768x44 px
Portrait Mode (Retina) 640x88 px 640x88 px 1024x44 px
Landscape Mode (Non-Retina) 480x32 px NA 1536x88 px
Landscape Mode (Retina) 960x64 px 1136x64 px 2048x88 px
Note: If the title bar image is not of the above recommended size, then the image is scaled to that of the
above sizes for respective devices and it leads to low quality or blur image for title bar.
Note: For retina devices, it is must to provide retina images with @2x suffix.
Syntax
JavaScript: titleBar
Lua: titlebar
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
Yes
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPad
l iPhone
l Android
l BlackBerry
l BlackBerry 10
l Windows Tablet
4.3.34 titleBarConfig
1. Click the Ellipsis ( ) button of the titleBar property to open the Title Bar screen.
2. Select the checkbox against the platform and click in the Value box.
3. Click the Ellipsis ( ) button to open the titleBarConfig screen for the respective platform.
l renderTitleText
l titleBarRightSideView
l closureRightSideView
l titleBarLeftSideView
l closureLeftSideView
l imageRightSideView
l imageLeftSideView
Following are the available options for Windows Tablet:
l Show Form Titlebar : Specifies if the form title must be visible or invisible.
l Show Back button : Specifies if the back button must be displayed in the Form.
You can set the skins for the above two options using the respective drop down box.
Syntax
JavaScript: titleBarConfig
Lua: titlebarconfig
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l iPad
l Android
l Windows Tablet
4.3.35 titleBarSkin
Default: None
Syntax
JavaScript: titleBarSkin
Lua: titlebarskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l iPhone
l Android
l BlackBerry
4.3.36 viewConfig
Note: For more information on applying the Grid layout, refer Kony Studio User Guide.
l Normal view
l Grid view - Windows 8 or 8.1
Following are the available properties:
n view: Specifies the type of view to be rendered. This option is available in both Normal grid and Grid
view. Following are the available options :
n gridSizeMode: Specifies the behavior of the grid with respect to size, rows, and columns. This option
is available in both Normal grid and Grid view. The available options are:
l fixed grid - Use this option to fix the number of rows and columns. For example, columns
= 4, rows = 2.
1234
5678
l Vertically expand - Use this option to fix the number of columns and rows can grow
indefinitely. For example, columns = 3, rows = infinite.
123
456
78
l Horizontally expand - Use this option to fix the number of rows are fixed and columns
can grow indefinitely. For example, rows = 3, columns = infinite.
147
258
36
n referenceWidth: Specifies the width of the cell. This option is supported in Grid view only.
Type: Number
n referenceHeight: Specifies the height of the cell. This option is supported in Grid view only.
Type: Number
n onClick: If an onClick event is defined on a widget, the event callback is invoked by the platform when
the user performs a click action in each cell. This option is supported in Grid view only.
n enableItemClick: This property enables the click behavior on each cell in grid view.This option is
supported in Grid view only.
Type: Boolean
n selectionMode: This property enables you to select the items in grid view. This option is supported in
Grid view only.
l 0 - None
l 1 - Single
l 2 - Multiple
Note: When you set righttap event using setGestureRecognizer to a container widget, the
selection mode will be considered from righttap gesture arguments, the values you entered are
ignored.
Type: Number
Default Value: 0
n onSelect: An event callback is invoked by the platform when you right tap using mouse or selects with
touch. This option is supported in Grid view only.
Note: This event is invoked only when you set selectionModeView!=0 (None). If you set
righttap event using setGestureRecognizer to a container widget, righttap gesture callback is
set to onSelect automatically.
n orientation: Specifies the orientation of the grid. This option is supported in Grid view only.
l 0 - Horizontal
l 1 - Vertical
Type: Number
Default Value: When the value is not provided, it the rowCount is more than 0
and gridSizeMode is set to constants.GRID_SIZE_MODE_VERTICAL, the
orientation is set to "vertical" else it is set to "Horizontal".
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript:JSObject
Lua: table
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.3.37 windowSoftInputMode
This property defines how the main Form interacts with the window containing the on-screen soft keyboard. It
determines the adjustments made to the Form whether it is resized smaller to make room for the soft
keyboard or whether its contents pan to make the current focus visible when part of the Form is covered by
the soft keyboard.
l FORM_ADJUST_RESIZE: Specifies the form is resized and when you click or start typing within the
widget which requires an input, the form scrolls up and the widget which requires an input is not
overlapped by the keypad or footer.
l FORM_ADJUST_PAN: Specifies the widget which requires an input is placed at the bottom of the
popup is overlapped by the keypad. The main Form is not resized to make room for the soft keyboard.
Rather, the contents of the Form are automatically panned so that the current focus is never obscured
by the keyboard and users can always see what they are typing. This is generally less desirable than
resizing, because the user may need to close the soft keyboard to get at and interact with obscured
parts of the Form.
The below image illustrates the above two options:
Default: FORM_ADJUST_RESIZE
Syntax
JavaScript: windowSoftInputMode
Lua: windowsoftinputmode
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
//Creating a form.
Yes
Platform Availability
l Android/Android Tablet
l BlackBerry 10
Note: In Server side Mobile Web platform, only the last event form.show or an alert will be displayed. For
example, If there are 3 alert statements and an event form.show in the end, then form is displayed. Alert will
not be displayed. Similarly you call a form.show and in subsequent statements or in form pre/post events
you call alert then that alert will be displayed but not the form.
l addWidgets
l init
l onActionBarBack
l onHide
l onOrientationChange
l onDeviceBack
l onDeviceMenu
l onDestroy
l preShow
l postShow
l onLoadJS
l unLoadJS
4.4.1 addWidgets
An event callback invoked by the platform when the form is accessed for first time after its construction. This
function gets executed only once on in lifetime of the form. If a destroyed form is accessed, the form is re-
initialized and this callback is once again invoked. Forms can be destroyed using destroy method.
Signature
JavaScript: addWidgets
Lua: addwidgets
Read / Write
JavaScript Example
//The below function is the callback function for addWidgets event of the
form.
function addWidgetsCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.2 init
This event gets called only once in form life cycle that is when the form is ready with its widget hierarchy. This
will get called after addwidgets method allowing user for any one-time initializations.
When form is destroyed and reused again, init gets called as a part of form lifecycle.
Signature
JavaScript: init
Lua: init
Read / Write
JavaScript Example
//The below function is the callback function for init event of the form
function initCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.3 onActionBarBack
An event callback that is invoked by the platform when the back button is pressed on an action bar. The back
button exists on the left side of the action bar with UP caret symbol. It is enabled only when onActionBarBack
callback is registered on form and showActionBarIcon is set to true.
Note: This event is displayed in the widget properties list only when you select SDK versions 3.0 and above
in the Application Properties > Native > Android > SDK Versions section.
Signature
JavaScript: onActionBarBack
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.4 onHide
Specifies an Event which is triggered when a form goes completely out of view.
JavaScript: onHide
Lua: onhide
Read / Write
JavaScript Example
//The below function is the callback function for onHide event of the form.
function onHideCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.5 onOrientationChange
Specifies an Event which is triggered when there is a change in orientation of the form from portrait to
landscape or vice versa.
Note: Blackberry devices will raise these event only if the displayOrientation mode of the form is set to
FORM_ DISPLAY_ORIENTATION_BOTH.
For more information about defining an action sequence for this event, see Event Editor in the Kony Studio
User Guide.
Signature
JavaScript: onOrientationChange
Lua: onorientationchange
Read / Write
JavaScript Example
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
Available on all platforms except Server side Mobile Web, Windows Kiosk, and Desktop Web
4.4.6 onDeviceBack
Specifies an event which is triggered when the user uses the back button on the device.
For more information see Event Editor in the Kony Studio User Guide.
Signature
JavaScript: onDeviceBack
Lua: ondeviceback
Read / Write
JavaScript Example
//The below function is the callback function for onDeviceBack event of the
form.
function onDevBckCal(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
l Android/Android Tablet
l BlackBerry
l BlackBerry 10
l Desktop Web
l SPA (iPhone/Android/BlackBerry/Windows NTH)
4.4.7 onDeviceMenu
Specifies an event which is triggered when the user uses the back button on the device.
For more information see Event Editor in the Kony Studio User Guide.
Signature
JavaScript: onDeviceMenu
Lua: ondevicemenu
Read / Write
JavaScript Example
//The below function is the callback function for onDeviceMenu event of the
form.
function onDevMenCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
l Android/Android Tablet
l BlackBerry 10
4.4.8 onDestroy
For more information see Event Editor in the Kony Studio User Guide.
Signature
JavaScript: onDestroy
Lua: ondestroy
Read / Write
JavaScript Example
//The below function is the callback function for onDestroy event of the f
orm.
function onDestroycalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.9 preShow
preShow is executed every time a form is to be displayed. This event is called even on device back or while
navigating back to the form through title bar navigation items.
In case of Server side Mobile Web, preShow and postShow will not get executed when navigate using the
browser "back".
Signature
JavaScript: preShow
Lua: preshow
Read / Write
JavaScript Example
//The below function is the callback function for preShow event of the for
m.
function preShowCalBck(form)
{
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.10 postShow
postShow is invoked after a form is displayed. Gets called even on device back or while navigating back to
the form through title bar navigation items.
In case of Server side Mobile Web, preShow and postShow will not get executed when navigate using the
browser "back". In preShow and postShow of the startup form, Alerts should be avoided. If any alerts are
present in the events of the form, the last alert gets executed and form will never render.
Note: If there are any network calls in postshow, you cannot perform any operation on the form and a busy
indication is displayed until the postshow execution is complete.
Signature
JavaScript: postShow
Lua: postshow
Read / Write
JavaScript Example
//The below function is the callback function for postShow event of the fo
rm.
function postShowCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Platform Availability
4.4.11 onLoadJS
Specifies the name of function to be executed when a form is loaded. The function must exist in the javascript
folder. For more information on defining the onLoadJS event, refer to Kony Studio User Guide.
Signature
JavaScript: onLoadJS
Lua: onloadjs
Read / Write
JavaScript Example
//The below function is the callback function for onLoadJS event of the fo
rm.
function onLoadJSCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
4.4.12 unLoadJS
Specifies the name of function to be executed when a form is unloaded. The function must exist in a javascript
file. For more information on defining the unLoadJS event, refer to Kony Studio User Guide.
Signature
JavaScript: unLoadJS
Lua: unloadjs
Read / Write
JavaScript Example
//The below function is the callback function for unLoadJS event of the fo
rm.
function unLoadJSCalBck(form)
{
//Write your logic here.
}
//Creating a form.
var frm =new kony.ui.Form2(frmBasic, frmLayout, frmPSP);
Yes
Platform Availability
l add
l addAt
l show
l destroy
l remove
l removeAt
l replaceAt
l widgets
l setTitleBarLeftSideButtonSkin
l setTitleBarRightSideButtonSkin
l setTitleBarSkin
l showTitleBar
l hideTitleBar
l scrollToWidget
l scrollToBeginning
l scrollToEnd
4.5.1 add
This method is used to add widgets to the form. When the widgets are added to the current visible form, then
the changes will reflect immediately. Adding a widget to the Form or Box hierarchy, which is already a part of
the other widget hierarchy, will lead to undefined behaviors. You have to explicitly remove the widget from one
hierarchy before adding it to another Form or Box.
Signature
JavaScript: add(widgetArray)
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
Platform Availability
4.5.2 addAt
This method is used to add widgets to the Form container at the specified index. Widget is prepended if index
<0 and appended at the end of the container if the index > size+1. Size is the number of widgets already
present in the container. If a new widget is added or removed will reflect immediately from the form hierarchy
model perspective, however the changes are displayed when the Form appears. When the widgets are added
to the current visible form, then the changes will reflect immediately. Adding a widget to the Form or Box
hierarchy, which is already a part of the other widget hierarchy, will lead to undefined behaviors. You have to
explicitly remove the widget from one hierarchy before adding it to another Form or Box.
Signature
Note: The parameter animationConfig is supported only on iOS ( version 5.0 and above) and Android
(version 3.0 and above) platforms.
Input Parameters
widgetref - Mandatory
Reference of the name of the widget.
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
"animEnded":endCallBackFunc
}
}
Platform Availability
4.5.3 show
Signature
JavaScript: show()
Input Parameters
formname - Mandatory
Reference of the name of the Form.
Return Values
None
Exceptions
None
JavaScript Example
containerWeight:100};
var pspConf = {titleBar: true, titleBarSkin: "skntitlebar"};
Platform Availability
4.5.4 destroy
This method is used to destroy any unwanted forms at any point in time, and allows increasing the application
life by reducing the memory usage.
Signature
JavaScript: destroy()
Input Parameters
formname- Mandatory
Reference of the name of the Form.
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
4.5.5 remove
This method removes a widget from the form container. If a widget is removed from a form, will reflect
immediately from the Form hierarchy model perspective; however the changes are displayed when the Form
appears. When the widgets are removed from the current visible Form, then the changes will reflect
immediately.
Signature
JavaScript: remove(widgetref)
Input Parameters
widgetref - Mandatory
Reference of the name of the widget.
Return Values
Exceptions
WidgetError
JavaScript Example
Platform Availability
4.5.6 removeAt
This method removes a widget at the given index from the Form container. If a widget is removed from the
form, will reflect immediately from the Form hierarchy model perspective; however the changes are displayed
when the Form appears. When the widgets are removed from the current visible Form, then the changes will
reflect immediately.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
Note: The parameter animationConfig is supported only on iOS ( version 5.0 and above) and Android
(version 3.0 and above) platforms.
Input Parameters
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
Platform Availability
4.5.7 replaceAt
This method replaces a widget with another widget in a form. If a widget is replaced from the form, will reflect
immediately from the Form hierarchy model perspective; however the changes are displayed when the Form
appears.
Note: Post this operation widget that was replaced will get garbage collected unless you hold explicitly a
reference to the replaced widget.
Signature
Input Parameters
widgetref - Mandatory
Reference of the name of the widget.
l If the index < 0, then first widget in the container gets replaced.
l If the index > size -1, then the last widget in the container widget gets replaced. The term
size refers to the number of widgets present in the container widget.
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
//Method to replaceAt.
myForm.replaceAt(buttonForOK,2,withAnimConfig2);
Platform Availability
l iOS
l Android
4.5.8 widgets
This method returns an array of the widget references which are direct children of Form.
Signature
JavaScript: widgets()
Lua: form.widgets(formid)
Input Parameters
Return Values
This method returns Read only array of widget references. Modifying the array and changing the position
of widgets in this array doesn't reflect in the Form hierarchy, however you can get handle to the widgets
through this array and modify the widgets through widget level methods as exposed by individual
widgets.
Exceptions
WidgetError
JavaScript Example
RIGHT, containerWeight:100};
var buttonForOk = new kony.ui.Button(basicConfBut, layoutConfBut, {});
Platform Availability
4.5.9 setTitleBarLeftSideButtonSkin
This method enables you to set the properties for a left-side button of a titlebar.
Signature
JavaScript: setTitleBarLeftSideButtonSkin(text,skin,callBack)
Lua: form.settitlebarleftsidebutton(formid,text,skin,callBack)
Input Parameters
Return Values
None
Exceptions
None
Platform Availability
4.5.10 setTitleBarRightSideButtonSkin
This method enables you to set the properties for a right-side button of a titlebar.
Signature
JavaScript: setTitleBarRightSideButtonSkin(text,skin,callBack)
Lua: form.settitlebarrightsidebutton(formid,text,skin,callBack)
Input Parameters
Return Values
None
Exceptions
None
Platform Availability
4.5.11 setTitleBarSkin
This method enables you to set the skin for a titlebar of a form.
Signature
JavaScript: setTitleBarSkin()
Lua: form.settitlebarskin(formid)
Input Parameters
Return Values
None
Exceptions
None
Platform Availability
4.5.12 showTitleBar
This method gives you the control to show a titlebar within a form.
Signature
JavaScript: showTitleBar()
Lua: form.showtitlebar(formid)
Input Parameters
Return Values
None
Exceptions
None
Platform Availability
4.5.13 hideTitleBar
This method gives you the control to hide a titlebar within a form.
Signature
JavaScript: hideTitleBar()
Lua: form.hidetitlebar(formid)
Input Parameters
Return Values
None
Exceptions
None
Platform Availability
4.5.14 scrollToWidget
This method gives you the control to scroll the form up to the position of selected widget.
Note: In iOS platform, this method brings the widget to viewable area on the form.
Signature
JavaScript: scrollToWidget(widgetref)
Input Parameters
widgetref - Mandatory
Reference of the name of the widget.
Return Values
None
Exceptions
WidgetError
JavaScript Example
Platform Availability
4.5.15 scrollToBeginning
This method gives you the control to scroll to the beginning of the form.
Signature
JavaScript: scrollToBeginning()
Lua: form.scrolltobeginning(formid)
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
Platform Availability
4.5.16 scrollToEnd
This method gives you the control to scroll to the end of the form.
Signature
JavaScript: scrollToEnd()
Lua: form.scrolltoend(formid)
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
Platform Availability
l dockableAppMenu
l dockableHeader
l dockableFooter
l enableback
l Ignore Escape
l masterdataload
l menuRenderer
l transactionaldataload
l undockappheader
l undockappfooter
Alternative Property to be
Deprecated Properties
used
dockableAppMenu By default appmenu should dock
dockableHeader headers
dockableFooter footers
enableback na
ignoreescape na
masterdataload init
menuRenderer na
transactionaldataload init
undockappheader
undockappfooter
Enables you to dock or place the Appmenu at the bottom of the screen. As you scroll the content of the form,
the Appmenu remains docked at the bottom of the screen.
Default: False
Type
String
Read / Write
No
Yes
Platform Availability
Enables you to dock or place the Header at the top of the form. As you scroll the content of the form, the
header stays docked at the top of the screen.
Note: This property is enabled only if you create a header template and specify the template in the Header
field.
Default: False
Type
String
Read / Write
No
Yes
Platform Availability
l BlackBerry
l J2ME
Enables you to dock or place the footer at the bottom of the form. As you scroll the content of the form, the
footer stays docked at the bottom of the screen.
Note: This property is enabled only if you create a footer template and specify the template in the Footer
field. If you specify a Dockable Appmenu, the footer is docked above the Appmenu on the screen.
Default: False
Type
String
Read / Write
No
Yes
Platform Availability
l BlackBerry
l J2ME
Default: the option is selected (The back button is enabled on the device)
If you do not want to enable the back button (for example, in a transaction processing form), clear the
checkbox.
Type
Boolean
Read / Write
No
Yes
Platform Availability
Specifies if the escape key event on the form must be ignored. This is helpful in scenarios when navigation to
the previous form is not advisable (for example, navigation from Account Summary form to a Login form).
Default: The option is not selected (escape key event is not ignored)
Type
Boolean
Read / Write
No
Yes
Platform Availability
4.6.6 masterdataload
masterdataload is the first function or closure that gets executed in a form life cycle.
Note: This function gets executed only once in a form life cycle and hence any form initializations are
recommended to be placed in the masterdataload.
When this event is raised, the widget tree is created and Load_master_data event is raised.
Platform Availability
Specifies if the application menu code must be included in the code generated for the platform.
Default: true (the checkbox is selected) (The application menu code is included in the code generated for the
platform)
If you do not want to include the application menu code in the code generated for the platform, set the value to
false (clear the checkbox).
Type
Boolean
Read / Write
No
Yes
Platform Availability
4.6.8 transactionaldataload()
transactionaldataload is the second function or closure that gets executed in a form life cycle.
Note: This function gets executed only once in a form life cycle. However, the function can be invoked by
using appreset().
Platform Availability
Available on all platforms except Mobile Web (basic) and Win Mobile6x.
4.6.9 undockappheader
Enables you to undock or remove the Header from the top of the form.
Default: False
Type
Boolean
Read / Write
No
Yes
Platform Availability
l BlackBerry
l J2ME
4.6.10 undockappfooter
Enables you to undock or remove the footer from the bottom of the form.
Default: False
Type
Boolean
Read / Write
No
Yes
Platform Availability
l BlackBerry
l J2ME
5. HBox
An (HBox) is used to layout widgets in a single horizontal orientation. It can contain any number of widgets.
However, due to form size limitations, it is advisable not to place many widgets in a HBox.
An HBox provides you with an option to set basic properties, layout properties for all platforms and properties
for specific platforms. You can also call/set Events and Methods on platforms as mentioned in the respective
sections.
For information regarding the behavior exhibited by the HBox, see Box Behavior.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight blockedUISkin
id gridCell borderCollapse
info layoutMeta contextMenu
isVisible layoutType hoverSkin
orientation layoutAlignment viewConfig
position margin
skin marginInPixel
padding
paddingInPixel
percent
vExpand
widgetAlignment
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
function boxOnClickEventTest(box)
{
l focusSkin
l id
l info
l isVisible
l orientation
l position
l skin
5.1.1 focusSkin
This is a skin property and it determines the look and feel when there is focus on a widget.
For more information on how to create and work with skins, see the Working with Applications section of the
Kony Studio User Guide.
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and SPA (Windows Tablet only)
5.1.2 id
id is a unique identifier of a Box consisting of alpha numeric characters. Every Box widget should have a
unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
5.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
5.1.4 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the default Visibility is set to true. If you want to change the value to false, you can do so by using
the Segment Methods.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and Win Mobile6x.
5.1.5 orientation
Specifies the orientation of the HBox. The widgets placed in a HBox are aligned horizontally.
Default: BOX_LAYOUT_HORIZONTAL
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: orientation
Lua: orientation
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
5.1.6 position
Specifies the position of the box as header or footer of the form. When you set this property the box is docked
along with header or footer.
Note: This property is applicable for immediate child widgets placed on a Form.
Default: BOX_POSITION_AS_NORMAL
true. This property is treated as normal 1 when a box is not placed in a segment. This option is not
supported on Windows platforms.
l BOX_POSITION_AS_SCREENLEVEL_SEG_FOOTER: This option is useful to fix the position of the
box to the bottom of the form when a box is placed inside a SegmentedUI with screenLevelWidget set
to true. This property is treated as normal2 when a box is not placed in a segment. This option is not
supported on Windows platforms.
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: position
Lua: position
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
5.1.7 skin
Specifies the look and feel of the widget when not in focus.
Note: In BlackBerry platform, HBox background image (in the skin) does not get expanded. Image is
displayed as per the original size. Its a limitation in BlackBerry.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l gridCell
l layoutMeta
l layoutType
l layoutAlignment
l margin
l marginInPixel
l padding
l paddingInPixel
l percent
l vExpand
l widgetAlignment
5.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
For example, a Form has Label1, Button1, and Button2 and the container weight could be 30 each for Label1
and Button1 and 40 for Button2, so that the sum of the container weight is 100.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
//Defining the properties for a box with containerWeight:50 (box will occu
py half of its parent widget).
var basicConfBox = {id : "boxContainerWeightTest", isVisible:true, orienta
tion:constants.BOX_LAYOUT_HORIZONTAL, skin:"gradroundbox"};
var layoutConfBox = {containerWeight:50,margin:[0,5,0,5]};
No
Platform Availability
5.2.2 gridCell
Note: This property is applicable only when a widget is placed inside a container widget with Grid Layout
applied.
Represents the grid cell details in the sequence colSpan, rowSpan, rowNo, colNo. Description of the details
are as follows:
l colSpan: Specifies the number of columns that a grid should span. Default value is 1.
l rowSpan: Specifies the number of rows that a grid should span. Default value is 1.
l rowNo: Specifies the row number in where the widget is placed in a grid layout.
l colNo: Specifies the column number in where the widget is placed in a grid layout.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. The default option is XYLayout. To set GridLayout, right-click on the form and select Apply
GridLayout.
Syntax
JavaScript: gridCell
Lua: gridCell
Type
JavaScript: JSObject
Lua:table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Phone
l Desktop Web
5.2.3 layoutMeta
A custom JSObject with the key, value pairs that developer can use to provide the meta info about the grid
layout. The following are the mandatory keys required to be part of the Meta.
Note: The data for layoutmeta data is set when you set grid layout view properties for rows and columns.
This property can be set using Kony Studio Grid Layout view. To set the view, go to Window > Show View >
Others and select GridLayout View from Kony Studio folder.
The sum total of percentage (%) widths of each of the columns in the grid layout should add up to 100%.
Syntax
JavaScript: layoutMeta
Lua: layoutmeta
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
5.2.4 layoutType
Defines the type of the layout of container widget. Following are the available options:
l CONTAINER_LAYOUT_BOX: This is the default options on both Windows Tablet and Desktop Web
platforms.
l CONTAINER_LAYOUT_GRID: In grid layout the form is split it to rows and columns.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. From the IDE, the default option is XYLayout. To set GridLayout, right-click on the form and select
Apply GridLayout.
Syntax
JavaScript: layoutType
Lua: layouttype
Type
Lua:String - [Mandatory]
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
5.2.5 layoutAlignment
This property is applicable if the percent property is set to false. Specifies the direction in which the widgets
are laid out.
Default: BOX_LAYOUT_ALIGN_FROM_LEFT
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: layoutAlignment
Lua: layoutalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
5.2.6 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
5.2.7 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
5.2.8 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied. The Array accepts the
values in the sequence [left, top, right, bottom].
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Limitations
5.2.9 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
5.2.10 percent
Specifies if the child widgets weight factor must be considered during layout. When the widgets do not have
enough space to accommodate inside non-percentage HBox, then the behavior of these widgets inside an
HBox is undefined.
Note: On Server side Mobile Web, SPA, and Desktop Web platforms, when you place multiple VBoxes
inside a non percentage HBox, VBoxes are adjusted automatically.
Note: On BlackBerry 10 platform, when percent property set to false, text on the widgets may fade or width
of the widgets may expand or reduce.
Note: For SPA or Desktop web, if percent value is set to false (percent=false), and if Hbox has Vbox in it,
rendering may not be consistent with richclients. If Hbox has any Vbox inside it, avoid using false as a value
for percent and instead, use true (percent=true).
Default: true
Syntax
JavaScript: percent
Lua: percent
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
5.2.11 vExpand
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Desktop Web and Server side Mobile Web platforms.
5.2.12 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT - (BlackBerry 10 supports this option)
Syntax
JavaScript: widgetAlignment
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l blockedUISkin
l borderCollapse
l contextMenu
l hoverSkin
l viewConfig
5.3.1 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//The below two functions will explain how to use blockedUISkin property f
or Box widget.
var basicConf = {id : "lblblockedUISkin", text:"Click this Box to see bloc
kedUI skin while calling the service", isVisible:true};
var layoutConf = {contentAlignment :constants.CONTENT_ALIGN_CENTER,
containerWeight:100, widgetAlignment:constants.WIDGET_ALIGN_CENTER,hExpand:
true,vExpand:true};
//onClick event is triggered when user clicks on the box ,In this case we
are calling the service inside the callback to observe the blockedUI skin.
var basicConfBox = {id : "boxblockedUISkin", isVisible:true, orientation:c
onstants.BOX_LAYOUT_HORIZONTAL,onClick:boxblockedUISkinTCSPAPlayClick};
var layoutConfBox = {contentAlignment : constants.CONTENT_ALIGN_TOP_CENTER,
containerWeight:100, vExpand:true};
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
5.3.2 borderCollapse
Specifies if the space between the Box and its child widgets is considered.
Default: false
If set to true, the default space between the parent and the child widget reduces.
If set to false, the default space between the parent and the child widget retained.
Syntax
JavaScript: borderCollapse
Lua: bordercollapse
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Defining the box with borderCollapse:true .(If you set the Border-Collap
se value to true, the default space between the parent and the child widget
reduces else not.)
var basicConfBox = {id : "boxBorderCollapse", isVisible:true, orientation:
constants.BOX_LAYOUT_HORIZONTAL};
var layoutConfBox = {contentAlignment : constants.CONTENT_ALIGN_TOP_CENTER,
containerWeight:100, vExpand:true};
var PSPConfBox = {borderCollapse:true}
Yes
Platform Availability
5.3.3 contextMenu
Shows the list of actions (appropriate to the widget in focus) as menu items.
Note: Due to BlackBerry platform limitation, to display a context menu for an Box, you must define an
onclick event for the Box.
l You can invoke the context menu either by clicking on the widget (applicable only on BlackBerry
versions 6.x and above) or by a long press on the screen (or trackpad).
l You can choose to add icons to indicate the menu items in the context menu (applicable only on
BlackBerry versions 6.x and above).
l BlackBerry layouts menu items in a 3 item grid view. The menu items Switch Application, Help, Close,
and Full Menu are added automatically based on the number of menu items added in the context menu.
For example, If you add a context menu with 2 items, it will display Full Menu item along with the items
added. If you add a context menu with 3 items, it will display Full Menu, Help, Switch Application items
along with the items added.
l If the focus is on a widget that has a context menu; and if you click the "menu key", the Full Menu
appears along with the context menu items.
l On Blackberry Non-Touch Devices, only Full Menu item is displayed irrespective of number of items
added in the context menu.
Note: The context menu items in the Full Menu will disappear if the focus is shifted from the widget which
has the context menu.
The following images illustrate the context menu on various BlackBerry devices:
The below description and procedure is applicable to Desktop Web platform only.
The context specific menu will be displayed with the array of menu items (appropriate to the widget in focus)
on right-click mouse.
Default:None
a. Go to Applications View.
b. Expand the application for which you want to create a menu template.
c. Navigate to templates and expand menus, right-click desktop and select New Menu Template.
The Create a New Menu window appears.
d. Enter a Name for the template and click Finish.
e. A new form is created. Drag-drop an HBox and then a VBox within an HBox. You can add other
widgets within these widgets.
a. Go to Applications View.
b. Expand the application for which you want to create a contextmenu template.
c. Navigate to templates and expand contextmenus, right-click desktop and select New
ContextMenu Template. The Create a New ContextMenu window appears.
d. Enter a Name for the template and click Finish. A new form is created
e. Drag-drop a menucontainer. You can drag-drop a menucontainer widget only.
f. (optional) Select menuItemTemplate from the drop down.
g. Define data using the data property.
3. Go to your project and then to desired form and drag-drop a hbox and navigate to Desktop Web
properties in Widget Properties window.
4. Select the contextmenu template from the dropdown.
Syntax
JavaScript: contextMenu
Lua: contextmenu
Type
Lua: Table
Read / Write
JavaScript Example
function callbackMenuItem1()
{
alert("Clicked on First menu item");
}
function callbackMenuItem2()
{
alert("Clicked on Second menu item");
}
function callbackMenuItem3()
{
alert("Clicked on Third menu item");
}
function callbackMenuItem4()
{
alert("Clicked on Fourth menu item");
}
function initializeaddtoabc() {
menucontainer12068 = new kony.ui.MenuContainer({
"id": "menucontainer12068", "isVisible": true,
"data": [
{template: hbox12068, "label12068": {"text": "India"},
children: [{template: hbox12068, "label12068": {"text": "Mu
mbai"},
"image212068": {}, children: [] }]
}, {template: hbox12068, "label12068": {"text": "Srilanka" },
"image212068": {}
}],
"widgetDataMap": {"label12068": "label12068","image212068": "image
212068"},
"menuItemTemplate": hbox12068}, {"widgetAlignment": constants.WIDG
ET_ALIGN_CENTER,
"containerWeight": "50", "margin": [0, 0, 0, 0],
"padding": [0, 0, 0, 0], "marginInPixel": false,
"paddingInPixel": false
}, {
"viewType": constants.MENU_CONTAINER_VIEW_TYPE_CONTEXTVIEW
});
};
No. But for Desktop Web platform you can access it through IDE.
Platform Availability
l Android/Android Tablet
l BlackBerry
l Windows Phone
l Desktop Web
5.3.4 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
5.3.5 viewConfig
Note: For more information on applying the Grid layout, refer Kony Studio User Guide.
l Normal view
l Grid view - Windows 8 or 8.1
Following are the available properties:
n view: Specifies the type of view to be rendered. This option is available in both Normal grid and Grid
view. Following are the available options :
n gridSizeMode: Specifies the behavior of the grid with respect to size, rows, and columns. This option
is available in both Normal grid and Grid view. The available options are:
l fixed grid - Use this option to fix the number of rows and columns. For example, columns
= 4, rows = 2.
1234
5678
l Vertically expand - Use this option to fix the number of columns and rows can grow
indefinitely. For example, columns = 3, rows = infinite.
123
456
78
l Horizontally expand - Use this option to fix the number of rows are fixed and columns
can grow indefinitely. For example, rows = 3, columns = infinite.
147
258
36
n referenceWidth: Specifies the width of the cell. This option is supported in Grid view only.
Type: Number
n referenceHeight: Specifies the height of the cell. This option is supported in Grid view only.
Type: Number
n onClick: If an onClick event is defined on a widget, the event callback is invoked by the platform when
the user performs a click action in each cell. This option is supported in Grid view only.
n enableItemClick: This property enables the click behavior on each cell in grid view.This option is
supported in Grid view only.
Type: Boolean
n selectionMode: This property enables you to select the items in grid view. This option is supported in
Grid view only.
l 0 - None
l 1 - Single
l 2 - Multiple
Note: When you set righttap event using setGestureRecognizer to a container widget, the
selection mode will be considered from righttap gesture arguments, the values you entered are
ignored.
Type: Number
Default Value: 0
n onSelect: An event callback is invoked by the platform when you right tap using mouse or selects with
touch. This option is supported in Grid view only.
Note: This event is invoked only when you set selectionModeView!=0 (None). If you set
n orientation: Specifies the orientation of the grid. This option is supported in Grid view only.
l 0 - Horizontal
l 1 - Vertical
Type: Number
Default Value: When the value is not provided, it the rowCount is more than 0
and gridSizeMode is set to constants.GRID_SIZE_MODE_VERTICAL, the
orientation is set to "vertical" else it is set to "Horizontal".
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript:JSObject
Lua: table
Read / Write
Yes
JavaScript Example
Yes
Platform Availability
l onClick
l onHover
l onRightClick
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
5.4.1 onClick
An event callback is invoked by the platform when the user performs a click action on the widget.
Note: If both onClick and a single tab gesture has been defined for a box then the behavior is undefined.
Syntax
JavaScript: onClick
Lua: onclick
The onClick event callback accepts additional parameters when a HBox is placed in a segment row or section
template.
Signature
Input Parameters
Read / Write
JavaScript Example
Platform Availability
5.4.2 onHover
Note: When the event callback is invoked, corresponding widget state is not updated as
selected/unselected.
Important Considerations
widget.onHover = null;
o When mouse moves into parent widget, then MOUSE_ENTER event gets fired on the parent
widget.
o When mouse moves inside the parent widget, then MOUSE_MOVE event is fired continuously
till mouse moves inside the parent widget.
o When mouse moves into the child widget area, then MOUSE_ENTER event gets fired on the
child widget.
o When mouse moves inside the child widget area, then MOUSE_MOVE event is fired on child
widget and also on the parent widget.
o When mouse moves out of the child widget area, then MOUSE_LEAVE event gets fired on
child widget and MOUSE_MOVE event gets fired on the parent widget.
o When mouse moves out of the parent widget, then MOUSE_LEAVE event gets fired on the
parent widget.
Signature
Input Parameters
Specifies the index of the section where the current focused row belongs. It is
applicable only if parent is SegmentedUI.
Specifies the index of the current focused row relative to its section. It is
applicable only if parent is SegmentedUI or DataGrid.
Specifies the index of the cell in DataGrid where the mouse exists. It is applicable
only if parent is DataGrid.
Specifies the selection state when the widget is placed inside a segmentedUI and
its selectionBehavior property is set as SEGUI_MULTI_BEHAVIOR or SEGUI_
SINGLE_SELECT_BEHAVIOR to indicate the current focused rows checked or
unchecked state.
Specifies the horizontal coordinate of the onHover event relative to the whole
document.
Specifies the vertical coordinate of the onHover event relative to the whole
document.
Specifies the horizontal coordinate of the onHover event relative to the screen
width.
Specifies the vertical coordinate of the onHover event relative to the screen
height.
JavaScript Example
}
else if (context.eventType == constants.ONHOVER_MOUSE_LEAVE)
{
widget.skin = "blue";
}
}
function addHoverEvent()
{
console.log("registering hover events");
form1.button1.onHover = onHoverEventCallback;
}
function removeHoverEvent()
{
console.log("removing hover events");
form1.button1.onHover = null;
}
Platform Availability
5.4.3 onRightClick
An event callback is invoked by the platform when the user performs a right click action on the widget.
Note: This event is enabled only when you select a template for contextMenu property.
Syntax
JavaScript: onRightClick
Read / Write
JavaScript Example
Platform Availability
5.4.4 preOnclickJS
This event allows the developer to execute custom javascript function before the onClick callback of the box
is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
vExpand:true};
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
5.4.5 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the widget
is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
Platform Availability
l add
l addAt
l remove
l removeAt
l replaceAt
l widgets
5.5.1 add
This method is used to add widgets to the box container. When the widgets are added to the current visible
form, then the changes will reflect immediately. Adding a widget to the Box hierarchy, which is already a part
of the other widget hierarchy, will lead to undefined behaviors. You have to explicitly remove the widget from
one hierarchy before adding it to another Box.
Signature
JavaScript: add ()
Lua:box.add (boxid )
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
//Adding label ,button widgets to the box Here label and button widgets sh
ould be created already and accessible as well.
boxAddMethodTest.add(lbl,btn);
Platform Availability
5.5.2 addAt
This method is used to add widgets to the Box container at the specified index. Widget is prepended if index
<0 and appended at the end of the container if the index > size+1. Size is the number of widgets already
present in the container. If a new widget is added or removed will reflect immediately from the Box hierarchy
model perspective, however the changes are displayed when the Form appears. When the widgets are added
to the current visible form, then the changes will reflect immediately. Adding a widget to the Form or Box
hierarchy, which is already a part of the other widget hierarchy, will lead to undefined behaviors. You have to
explicitly remove the widget from one hierarchy before adding it to another Form or Box.
Signature
Note: The parameter animationConfig is supported only on iOS (version 5.0 and above) and Android
(version 3.0 and above) platforms.
Input Parameters
widgetref - Mandatory
Reference of the widget to be added
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
None
Exceptions
WidgetError
JavaScript Example
"animDuration":1.5,
"animDelay":0.4,
"animCurve":constants.ANIMATION_CURVE_LINEAR,
"animCallBacks":{
"animStarted":startCallBackFunc,
"animEnded":endCallBackFunc
}
}
//Adding label to the box at 15th index Position.Here label should be crea
ted already and accessible as well.
boxAddAtMethodTest.addAt(lbl,15, withAnimConfig);
Platform Availability
5.5.3 remove
This method removes a widget from the Box container. If a new widget is removed will reflect immediately
from the Box hierarchy model perspective, however the changes are displayed when the Box appears. When
the widgets are added to the current visible Box, then the changes will reflect immediately.
Signature
Input Parameters
widgetref - Mandatory
Reference of the widget to be removed.
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label widget from the box .Here label should be created already
and added inside the box.
boxRemoveMethodTest.remove(lbl);
Platform Availability
5.5.4 removeAt
This method removes a widget at the given index from the Box container. If a new widget is removed will
reflect immediately from the Box hierarchy model perspective, however the changes are displayed when the
Box appears. When the widgets are added to the current visible Box, then the changes will reflect
immediately.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
Note: The parameter animationConfig is supported only on iOS ( version 5.0 and above) and Android
(version 3.0 and above) platforms.
Input Parameters
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label from the box at 15th index Position. Here label should be
created and added at 15th index position of the box.
boxRemoveAtMethodTest.removeAt(15, withAnimConfig1);
Platform Availability
5.5.5 replaceAt
This method replaces a widget with another widget in the HBox. If a widget is replaced from the HBox, will
reflect immediately from the HBox hierarchy model perspective; however the changes are displayed when the
HBox appears.
Note: Post this operation widget that was replaced will get garbage collected unless you hold explicitly a
reference to the replaced widget.
Signature
Input Parameters
widgetref - Mandatory
Reference of the name of the widget.
l If the index < 0, then first widget in the container gets replaced.
l If the index > size -1, then the last widget in the container widget gets replaced. The term
size refers to the number of widgets present in the container widget.
animationConfig[JSObject] - Optional
Specifies the animation configuration object. Following are the parameters of the JSObject:
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
//Replacing label from the box at 15th index Position. Here label should be
created and added at 15th index position of the box.
boxRemoveAtMethodTest.removeAt(lbl,15,withAnimConfig2);
Platform Availability
l iOS
l Android
5.5.6 widgets
This method returns an array of the widget references which are direct children of Box.
Signature
JavaScript: widgets ()
Lua:box.widgets ()
Input Parameters
None
Return Values
This method returns Read only array of widget references. Modifying the array and changing the position
of widgets in this array doesn't reflect in the Box hierarchy, however you can get handle to the widgets
through this array and modify the widgets through widget level methods as exposed by individual
widgets.
Exceptions
WidgetError
JavaScript Example
//Collecting all the widgets of the box into array and displaying the refe
rences.
wigArr = boxWidgetsMethodTest.widgets();
alert("Widgets are::"+wigArr);
Platform Availability
Note: Context Menu templates are supported only on Desktop Web platform.
In Desktop Web, when you right click a Menu Container or a Box the context specific menu will be displayed
with the array of menu items. A Context Menu Template is essentially a template having a Menu Container in
which the developer customizes the overall look and feel of the context menu.
Context Menu Templates are used to display how the data is presented to the end user when a context menu
pops up.
When you want the same template to be displayed across all the Context Menus in the application, you have
a provision to add a Context Menu Template using Kony Studio.
1. Go to Applications View.
2. Expand the application for which you want to create the Context Menu Template.
3. Navigate to templates > contextmenus, right-click desktop and select New ContextMenu Template.
The Create a New Menu dialog appears.
You can create separate templates for each context menu using the above process. In Desktop Web, when
you right click a Menu Container or a Box the context specific menu will be displayed with the array of menu
items.
1. Go to Applications view.
2. Expand the application for which you want to use Context Menu.
3. Navigate to forms > desktop, right-click desktop and select New Form. The Create a New Form
window appears.
4. Enter a name for the Form and click Finish. A new form is created.
5. Drag-drop a Box or a Menu container on the form and set data using the contextMenu property under
Desktop Web.
6. VBox
A (VBox) is used to layout widgets in a single vertical orientation. It can contain any number of widgets.
However, due to form size limitations, it is advisable not to place many widgets in a VBox.
A VBox provides you with an option to set basic properties, layout properties for all platforms and properties
for specific platforms. You can also call/set Events and Methods on platforms as mentioned in the respective
sections.
For information regarding the behavior exhibited by the VBox, see VBox Behavior.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight blockedUISkin
id gridCell borderCollapse
info layoutMeta contextMenu
isVisible layoutType hoverSkin
orientation layoutAlignment viewConfig
skin margin
marginInPixel
padding
paddingInPixel
widgetAlignment
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
function boxOnClickEventTest(box)
{
alert("OnClick event is invoked successfully");
}
l focusSkin
l id
l info
l isVisible
l orientation
l skin
6.1.1 focusSkin
This is a skin property and it determines the look and feel when there is focus on a widget.
For more information on how to create and work with skins, see the Working with Applications section of the
Kony Studio User Guide.
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and SPA (Windows Tablet only)
6.1.2 id
id is a unique identifier of a Box consisting of alpha numeric characters. Every Box widget should have a
unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
6.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
6.1.4 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the default Visibility is set to true. If you want to change the value to false, you can do so by using
the Segment Methods.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Platform Availability
Available on all platforms except Server side Mobile Web (basic) platform.
6.1.5 orientation
Specifies the orientation of the VBox. The widgets placed in a VBox are aligned vertically.
Default: BOX_LAYOUT_VERTICAL
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: orientation
Lua: orientation
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
6.1.6 skin
Specifies the look and feel of the widget when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l gridCell
l layoutMeta
l layoutType
l layoutAlignment
l margin
l marginInPixel
l padding
l paddingInPixel
l widgetAlignment
6.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
For example, a Form has Label1, Button1, and Button2 and the container weight could be 30 each for Label1
and Button1 and 40 for Button2, so that the sum of the container weight is 100.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
//Defining the properties for a box with containerWeight:50 (box will occu
py half of its parent widget).
var basicConfBox = {id : "boxContainerWeightTest", isVisible:true, orienta
tion:constants.BOX_LAYOUT_VERTICAL, skin:"gradroundbox"};
var layoutConfBox = {containerWeight:50,margin:[0,5,0,5]};
No
Platform Availability
6.2.2 gridCell
Note: This property is applicable only when a widget is placed inside a container widget with Grid Layout
applied.
Represents the grid cell details in the sequence colSpan, rowSpan, rowNo, colNo. Description of the details
are as follows:
l colSpan: Specifies the number of columns that a grid should span. Default value is 1.
l rowSpan: Specifies the number of rows that a grid should span. Default value is 1.
l rowNo: Specifies the row number in where the widget is placed in a grid layout.
l colNo: Specifies the column number in where the widget is placed in a grid layout.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. The default option is XYLayout. To set GridLayout, right-click on the form and select Apply
GridLayout.
Syntax
JavaScript: gridCell
Lua: gridCell
Type
JavaScript: JSObject
Lua:table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
6.2.3 layoutMeta
A custom JSObject with the key, value pairs that developer can use to provide the meta info about the grid
layout. The following are the mandatory keys required to be part of the Meta.
Note: The data for layoutmeta data is set when you set grid layout view properties for rows and columns.
This property can be set using Kony Studio Grid Layout view. To set the view, go to Window > Show View >
Others and select GridLayout View from Kony Studio folder.
The sum total of percentage (%) widths of each of the columns in the grid layout should add up to 100%.
Syntax
JavaScript: layoutMeta
Lua: layoutmeta
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
6.2.4 layoutType
Defines the type of the layout of container widget. Following are the available options:
l CONTAINER_LAYOUT_BOX: This is the default options on both Windows Tablet and Desktop Web
platforms.
l CONTAINER_LAYOUT_GRID: In grid layout the form is split it to rows and columns.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. From the IDE, the default option is XYLayout. To set GridLayout, right-click on the form and select
Apply GridLayout.
Syntax
JavaScript: layoutType
Lua: layouttype
Type
Lua:String - [Mandatory]
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
6.2.5 layoutAlignment
This property is applicable if the percent property is set to false. Specifies the direction in which the widgets
are laid out.
Default: BOX_LAYOUT_ALIGN_FROM_LEFT
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: layoutAlignment
Lua: layoutalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
6.2.6 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
6.2.7 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
6.2.8 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied. The Array accepts the
values in the sequence [left, top, right, bottom].
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Limitations
6.2.9 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
6.2.10 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l blockedUISkin
l borderCollapse
l contextMenu
l hoverSkin
l viewConfig
6.3.1 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//The below two functions will explain how to use blockedUISkin property f
or Box widget.
var basicConf = {id : "lblblockedUISkin", text:"Click this Box to see bloc
kedUI skin while calling the service", isVisible:true};
var layoutConf = {contentAlignment :constants.CONTENT_ALIGN_CENTER,
containerWeight:100, widgetAlignment:constants.WIDGET_ALIGN_CENTER};
//onClick event is triggered when user clicks on the box ,In this case we
are calling the service inside the callback to observe the blockedUI skin.
var basicConfBox = {id : "boxblockedUISkin", isVisible:true, orientation:c
onstants.BOX_LAYOUT_VERTICAL,onClick:boxblockedUISkinTCSPAPlayClick};
var layoutConfBox = {contentAlignment : constants.CONTENT_ALIGN_TOP_CENTER,
containerWeight:100};
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
6.3.2 borderCollapse
Specifies if the space between the Box and its child widgets is considered.
Default: false
If set to true, the default space between the parent and the child widget reduces.
If set to false, the default space between the parent and the child widget retained.
Syntax
JavaScript: borderCollapse
Lua: bordercollapse
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating the box with borderCollapse:true .(If you set the Border-Collap
se value to true, the default space between the parent and the child widget
reduces else not.)
var basicConfBox = {id : "boxBorderCollapse", isVisible:true, orientation:
constants.BOX_LAYOUT_VERTICAL};
var layoutConfBox = {contentAlignment : constants.CONTENT_ALIGN_TOP_CENTER,
containerWeight:100};
var PSPConfBox = {borderCollapse:true}
Yes
Platform Availability
6.3.3 contextMenu
Shows the list of actions (appropriate to the widget in focus) as menu items.
Note: Due to BlackBerry platform limitation, to display a context menu for an Box, you must define an
onclick event for the Box.
l You can invoke the context menu either by clicking on the widget (applicable only on BlackBerry
versions 6.x and above) or by a long press on the screen (or trackpad).
l You can choose to add icons to indicate the menu items in the context menu (applicable only on
BlackBerry versions 6.x and above).
l BlackBerry layouts menu items in a 3 item grid view. The menu items Switch Application, Help, Close,
and Full Menu are added automatically based on the number of menu items added in the context menu.
For example, If you add a context menu with 2 items, it will display Full Menu item along with the items
added. If you add a context menu with 3 items, it will display Full Menu, Help, and Switch Application
items along with the items added.
l If the focus is on a widget that has a context menu; and if you click the "menu key", the Full Menu
appears along with the context menu items.
l On Blackberry Non-Touch Devices, only Full Menu item is displayed irrespective of number of items
added in the context menu.
Note: The context menu items in the Full Menu will disappear if the focus is shifted from the widget which
has the context menu.
The following images illustrate the context menu on various BlackBerry devices:
The below description and procedure is applicable to Desktop Web platform only.
The context specific menu will be displayed with the array of menu items (appropriate to the widget in focus)
on right-click mouse.
Default: None
a. Go to Applications View.
b. Expand the application for which you want to create a menu template.
c. Navigate to templates and expand menus, right-click desktop and select New Menu Template.
The Create a New Menu window appears.
d. Enter a Name for the template and click Finish.
e. A new form is created. Drag-drop an HBox and then a VBox within an HBox. You can add other
widgets within these widgets.
a. Go to Applications View.
b. Expand the application for which you want to create a contextmenu template.
c. Navigate to templates and expand contextmenus, right-click desktop and select New
ContextMenu Template. The Create a New ContextMenu window appears.
d. Enter a Name for the template and click Finish. A new form is created.
e. Drag-drop a menucontainer. You can drag-drop a menucontainer widget only.
f. (optional) Select menuItemTemplate from the drop down.
g. Define data using the data property.
3. Go to your project and then to desired form and drag-drop a hbox and navigate to Desktop Web
properties in Widget Properties window.
4. Select the contextmenu template from the dropdown.
Syntax
JavaScript: contextMenu
Lua: contextmenu
Type
Lua: Table
Read / Write
JavaScript Example
function callbackMenuItem1()
{
alert("Clicked on First menu item");
}
function callbackMenuItem2()
{
alert("Clicked on Second menu item");
}
function callbackMenuItem3()
{
alert("Clicked on Third menu item");
}
function callbackMenuItem4()
{
alert("Clicked on Fourth menu item");
}
function initializeaddtoabc() {
menucontainer12068 = new kony.ui.MenuContainer({
"id": "menucontainer12068", "isVisible": true,
"data": [
{template: hbox12068, "label12068": {"text": "India"},
children: [{template: hbox12068, "label12068": {"text": "Mu
mbai"},
"image212068": {}, children: [] }]
}, {template: hbox12068, "label12068": {"text": "Srilanka" },
"image212068": {}
}],
"widgetDataMap": {"label12068": "label12068","image212068": "image
212068"},
"menuItemTemplate": hbox12068}, {"widgetAlignment": constants.WIDG
ET_ALIGN_CENTER,
"containerWeight": "50", "margin": [0, 0, 0, 0],
"padding": [0, 0, 0, 0], "marginInPixel": false,
"paddingInPixel": false
}, {
"viewType": constants.MENU_CONTAINER_VIEW_TYPE_CONTEXTVIEW
});
};
No. But for Desktop Web platform you can access it through IDE.
Platform Availability
l Android/Android Tablet
l BlackBerry
l Windows Tablet
l Desktop Web
6.3.4 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
6.3.5 viewConfig
Note: For more information on applying the Grid layout, refer Kony Studio User Guide.
l Normal view
l Grid view - Windows 8 or 8.1
Following are the available properties:
n view: Specifies the type of view to be rendered. This option is available in both Normal grid and Grid
view. Following are the available options :
n gridSizeMode: Specifies the behavior of the grid with respect to size, rows, and columns. This option
is available in both Normal grid and Grid view. The available options are:
l fixed grid - Use this option to fix the number of rows and columns. For example, columns
= 4, rows = 2.
1234
5678
l Vertically expand - Use this option to fix the number of columns and rows can grow
indefinitely. For example, columns = 3, rows = infinite.
123
456
78
l Horizontally expand - Use this option to fix the number of rows are fixed and columns
can grow indefinitely. For example, rows = 3, columns = infinite.
147
258
36
n referenceWidth: Specifies the width of the cell. This option is supported in Grid view only.
Type: Number
n referenceHeight: Specifies the height of the cell. This option is supported in Grid view only.
Type: Number
n onClick: If an onClick event is defined on a widget, the event callback is invoked by the platform when
the user performs a click action in each cell. This option is supported in Grid view only.
n enableItemClick: This property enables the click behavior on each cell in grid view.This option is
supported in Grid view only.
Type: Boolean
n selectionMode: This property enables you to select the items in grid view. This option is supported in
Grid view only.
l 0 - None
l 1 - Single
l 2 - Multiple
Note: When you set righttap event using setGestureRecognizer to a container widget, the
selection mode will be considered from righttap gesture arguments, the values you entered are
ignored.
Type: Number
Default Value: 0
n onSelect: An event callback is invoked by the platform when you right tap using mouse or selects with
touch. This option is supported in Grid view only.
Note: This event is invoked only when you set selectionModeView!=0 (None). If you set
righttap event using setGestureRecognizer to a container widget, righttap gesture callback is
set to onSelect automatically.
n orientation: Specifies the orientation of the grid. This option is supported in Grid view only.
l 0 - Horizontal
l 1 - Vertical
Type: Number
Default Value: When the value is not provided, it the rowCount is more than 0
and gridSizeMode is set to constants.GRID_SIZE_MODE_VERTICAL, the
orientation is set to "vertical" else it is set to "Horizontal".
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript:Object
Lua: table
Read / Write
No
Yes
Platform Availability
l onClick
l onHover
l onRightClick
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
6.4.1 onClick
An event callback is invoked by the platform when the user performs a click action on the widget.
Note: If both onClick and a single tab gesture has been defined for a box then the behavior is undefined.
Syntax
JavaScript: onClick
Lua: onclick
The onClick event callback accepts additional parameters when a VBox is placed in a segment row or section
template.
Signature
Input Parameters
Read / Write
JavaScript Example
Platform Availability
6.4.2 onHover
Note: When the event callback is invoked, corresponding widget state is not updated as
selected/unselected.
Important Considerations
widget.onHover = null;
o When mouse moves into parent widget, then MOUSE_ENTER event gets fired on the parent
widget.
o When mouse moves inside the parent widget, then MOUSE_MOVE event is fired continuously
till mouse moves inside the parent widget.
o When mouse moves into the child widget area, then MOUSE_ENTER event gets fired on the
child widget.
o When mouse moves inside the child widget area, then MOUSE_MOVE event is fired on child
widget and also on the parent widget.
o When mouse moves out of the child widget area, then MOUSE_LEAVE event gets fired on
child widget and MOUSE_MOVE event gets fired on the parent widget.
o When mouse moves out of the parent widget, then MOUSE_LEAVE event gets fired on the
parent widget.
Signature
Input Parameters
Specifies the index of the section where the current focused row belongs. It is
applicable only if parent is segmentedUI.
Specifies the index of the current focused row relative to its section. It is
applicable only if parent is SegmentedUI or DataGrid.
Specifies the index of the cell in DataGrid where the mouse exists. It is applicable
only if parent is DataGrid.
Specifies the selection state when the widget is placed inside a segmentedUI and
its selectionBehavior property is set as SEGUI_MULTI_BEHAVIOR or SEGUI_
SINGLE_SELECT_BEHAVIOR to indicate the current focused rows checked or
unchecked state.
Specifies the horizontal coordinate of the onHover event relative to the whole
document.
Specifies the vertical coordinate of the onHover event relative to the whole
document.
Specifies the horizontal coordinate of the onHover event relative to the screen
width.
Specifies the vertical coordinate of the onHover event relative to the screen
height.
JavaScript Example
}
else if (context.eventType == constants.ONHOVER_MOUSE_LEAVE)
{
widget.skin = "blue";
}
}
function addHoverEvent()
{
console.log("registering hover events");
form1.button1.onHover = onHoverEventCallback;
}
function removeHoverEvent()
{
console.log("removing hover events");
form1.button1.onHover = null;
}
Platform Availability
6.4.3 onRightClick
An event callback is invoked by the platform when the user performs a right click action on the widget.
Note: This event is enabled only when you select a template for contextMenu property.
Syntax
JavaScript: onRightClick
Read / Write
JavaScript Example
Platform Availability
6.4.4 preOnclickJS
This event allows the developer to execute custom JavaScript function before the onClick callback of the box
is invoked. This is applicable only for Mobile Web channel. The function must exist in a JavaScript file under
project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
vExpand:true};
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
6.4.5 postOnclickJS
This event allows the developer to execute custom JavaScript function after the onClick callback of the
widget is invoked. This is applicable only for Mobile Web channel. The function must exist in a JavaScript file
under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
containerWeight:100, widgetAlignment:constants.WIDGET_ALIGN_CENTER};
Platform Availability
l add
l addAt
l remove
l removeAt
l replaceAt
l widgets
6.5.1 add
This method is used to add widgets to the box container. When the widgets are added to the current visible
form, then the changes will reflect immediately. Adding a widget to the Box hierarchy, which is already a part
of the other widget hierarchy, will lead to undefined behaviors. You have to explicitly remove the widget from
one hierarchy before adding it to another Box.
Signature
JavaScript: add()
Lua:box.add(boxid )
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
//Adding label ,button widgets to the box Here label and button widgets sh
ould be created already and accessible as well.
boxAddMethodTest.add(lbl,btn);
Platform Availability
6.5.2 addAt
This method is used to add widgets to the Box container at the specified index. Widget is prepended if index
<0 and appended at the end of the container if the index > size+1. Size is the number of widgets already
present in the container. If a new widget is added or removed will reflect immediately from the Box hierarchy
model perspective, however the changes are displayed when the Form appears. When the widgets are added
to the current visible form, then the changes will reflect immediately. Adding a widget to the Form or Box
hierarchy, which is already a part of the other widget hierarchy, will lead to undefined behaviors. You have to
explicitly remove the widget from one hierarchy before adding it to another Form or Box.
Signature
Note: The parameter animationConfig is supported only on iOS (version 5.0 and above) and Android
(version 3.0 and above) platforms.
Input Parameters
widgetref - Mandatory
Reference of the widget to be added
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
None
Exceptions
WidgetError
JavaScript Example
"animDuration":1.5,
"animDelay":0.4,
"animCurve":constants.ANIMATION_CURVE_LINEAR,
"animCallBacks":{
"animStarted":startCallBackFunc,
"animEnded":endCallBackFunc
}
}
//Adding label to the box at 15th index Position.Here label should be crea
ted already and accessible as well.
boxAddAtMethodTest.addAt(15, withAnimConfig);
Platform Availability
6.5.3 remove
This method removes a widget from the Box container. If a new widget is removed will reflect immediately
from the Box hierarchy model perspective, however the changes are displayed when the Box appears. When
the widgets are added to the current visible Box, then the changes will reflect immediately.
Signature
JavaScript: remove(widgetref)
Lua:box.remove(boxid, widgetref)
Input Parameters
widgetref - Mandatory
Reference of the widget to be removed.
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label widget from the box .Here label should be created already
and added inside the box.
boxRemoveMethodTest.remove(lbl);
Platform Availability
6.5.4 removeAt
This method removes a widget at the given index from the Box container. If a new widget is removed will
reflect immediately from the Box hierarchy model perspective, however the changes are displayed when the
Box appears. When the widgets are added to the current visible Box, then the changes will reflect
immediately.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
Note: The parameter animationConfig is supported only on iOS (version 5.0 and above) and Android
(version 3.0 and above) platforms. It is supported in Kony Studio version 5.6 and above only.
Lua:box.removeat( boxid, index)
Input Parameters
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label from the box at 15th index Position. Here label should be
created and added at 15th index position of the box.
boxRemoveAtMethodTest.removeAt(15,withAnimConfig1);
Platform Availability
6.5.5 replaceAt
This method replaces a widget with another widget in a VBox. If a widget is replaced from the VBox, will
reflect immediately from the VBox hierarchy model perspective; however the changes are displayed when the
VBox appears.
Note: Post this operation widget that was replaced will get garbage collected unless you hold explicitly a
reference to the replaced widget.
Signature
Input Parameters
widgetref - Mandatory
Reference of the name of the widget.
l If the index < 0, then first widget in the container gets replaced.
l If the index > size -1, then the last widget in the container widget gets replaced. The term
size refers to the number of widgets present in the container widget.
animationConfig[JSObject] - Optional
Specifies the animation configuration object. Following are the parameters of the JSObject:
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
Return Values
Exceptions
WidgetError
JavaScript Example
//Replacing label from the box at 15th index Position. Here label should be
created and added at 15th index position of the box.
boxRemoveAtMethodTest.removeAt(newWidget,15,withAnimConfig2);
Platform Availability
l iOS
l Android
6.5.6 widgets
This method returns an array of the widget references which are direct children of Box.
Signature
JavaScript: widgets()
Lua:box.widgets(boxid)
Input Parameters
Return Values
This method returns Read only array of widget references. Modifying the array and changing the position
of widgets in this array doesn't reflect in the Box hierarchy, however you can get handle to the widgets
through this array and modify the widgets through widget level methods as exposed by individual
widgets.
Exceptions
WidgetError
JavaScript Example
//Collecting all the widgets of the box into array and displaying the refe
rences.
wigArr = boxWidgetsMethodTest.widgets();
alert("Widgets are::"+wigArr);
Platform Availability
Note: Context Menu templates are supported only on Desktop Web platform.
In Desktop Web, when you right click a Menu Container or a Box the context specific menu will be displayed
with the array of menu items. A Context Menu Template is essentially a template having a Menu Container in
which the developer customizes the overall look and feel of the context menu.
Context Menu Templates are used to display how the data is presented to the end user when a context menu
pops up.
When you want the same template to be displayed across all the Context Menus in the application, you have
a provision to add a Context Menu Template using Kony Studio.
1. Go to Applications View.
2. Expand the application for which you want to create the Context Menu Template.
3. Navigate to templates > contextmenus, right-click desktop and select New ContextMenu Template.
The Create a New Menu dialog appears.
You can create separate templates for each context menu using the above process. In Desktop Web, when
you right click a Menu Container or a Box the context specific menu will be displayed with the array of menu
items.
1. Go to Applications view.
2. Expand the application for which you want to use Context Menu.
3. Navigate to forms > desktop, right-click desktop and select New Form. The Create a New Form
window appears.
4. Enter a name for the Form and click Finish. A new form is created.
5. Drag-drop a Box or a Menu container on the form and set data using the contextMenu property under
Desktop Web.
7. ScrollBox
A ScrollBox is a scrollable container which allows you to scroll the content within horizontally and vertically.
A ScrollBox can contain any widget except a Tab pane. It can contain any number of widgets within it.
ScrollBox provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, an Event, and Methods.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
1. From the IDE, drag and drop the ScrollBox widget onto a form or any other container widget.
2. ScrollBox widget enables horizontal scrolling by default. You can stack all the widgets horizontally
when the orientation is set as horizontal. To stack widget vertically within the ScrollBox, set the
orientation as vertical.
3. Drag and drop the required number of other widgets into the Scroll Box widget.
4. Set the scrollDirection as horizontal, vertical, both, or, none. Using the Scroll option, you can define the
scrolling direction of the ScrollBox.
Customizing Appearance
You can customize the appearance of the ScrollBox by using the following properties:
Important Considerations:
l For a good user experience, you must place the ScrollBox using a percentage layout. In a non-
percentage layout the width of the ScrollBox varies across platforms.
l If you set the scrollDirection as SCROLLBOX_SCROLL_VERTICAL or SCROLLBOX_SCROLL_
BOTH, specifying a containerHeight is mandatory.
l When a widget is placed inside a horizontal parent widget. For example: Box, Segment, it will take
40% of the parent widget or the available free space of the widget.
l For BlackBerry platforms, to navigate the contents within a ScrollBox, arrows are used instead of
scrollbars.
l Only Horizontal Scrolling is applicable for BlackBerry.
l enablesScrollByPage
l id
l info
l isVisible
l orientation
l position
l pullToRefreshI18NKey
l pullToRefreshSkin
l pushToRefreshI18NKey
l pushToRefreshSkin
l releaseToPullRefreshI18NKey
l releaseToPushRefreshI18NKey
l scrollDirection
l showScrollbars
l skin
7.1.1 enableScrollByPage
Enables the scrolling of the content in increments of the width of the scrollbox on swipe gesture.
Default: false
Syntax
JavaScript: enableScrollByPage
Lua: enablescrollbypage
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
7.1.2 id
id is a unique identifier of a ScrollBox consisting of alpha numeric characters. Every ScrollBox should have a
unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
7.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
7.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.1.5 orientation
Specifies how you can stack the widgets within the ScrollBox. You can set the orientation of the ScrollBox as
horizontal or vertical.
Note: ScrollBox with a vertical orientation cannot be placed directly on a form. It has to be placed inside an
HBox and only then you can place a ScrollBox with vertical orientation.
Default: BOX_LAYOUT_HORIZONTAL
l BOX_LAYOUT_HORIZONTAL: Enables you to stack the content within the scrollbox horizontally.
l BOX_LAYOUT_VERTICAL: Enables you to stack the content within the scrollbox vertically.
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: orientation
Lua: orientation
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.1.6 position
Default: BOX_POSITION_AS_NORMAL.
l BOX_POSITION_AS_HEADER: Specifies the position of the ScrollBox is fixed at the top of the Form.
l BOX_POSITION_AS_FOOTER: Specifies the position of the ScrollBox is fixed at the bottom of the
Form.
l BOX_POSITION_AS_NORMAL: Retains the original position of the ScrollBox.
l BOX_POSITION_AS_SCREENLEVEL_SEG_HEADER: This option is useful if the box is placed on
a form with a Segment on it. You must set the screenLevelWidget property of the particular segment to
true. The scrollbox attaches itself to the Segment as a header and scrolls along with the segment. If
the screelLevelWidget property of the particular segment is not set, then this value is ignored and the
box is treated as normal. This option is not supported on all Windows platforms.
l BOX_POSITION_AS_SCREENLEVEL_SEG_FOOTER: This option is useful if the box is placed on a
form with a Segment on it. You must set the screenLevelWidget property of the particular segment to
true. The scrollbox attaches itself to the Segment as footer and scrolls along with the segment. If the
screelLevelWidget property of the particular segment is not set, then this value is ignored and the box
is treated as normal. This option is not supported on all Windows platforms.
This property is respected only for immediate child box (with horizontal orientation) of Form container.
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: position
Lua: position
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and Desktop Web platforms.
7.1.7 pullToRefreshI18NKey
Specifies the i18N key for "pull to refresh" title. The platforms get the value from the existing application locale
specific i18N resource bundle. If the key is not found in the resource bundle, then platforms use the default
(english locale) title text.
Syntax
JavaScript: pullToRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
7.1.8 pullToRefreshSkin
l font_weight
l font_style
l font_size
l font_color
l font_name
l background_color
l bg_type
l background_style
Note: The "release to refresh" title picks the skin of "pull to refresh" or "release to refresh" respectively.
Syntax
JavaScript: pullToRefreshSkin
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
7.1.9 pushToRefreshI18NKey
Specifies the i18N key for "push to refresh" title. The platforms get the value from the existing application
locale specific i18N resource bundle. If the key is not found in the resource bundle, then platforms use the
default (english locale) title text.
Syntax
JavaScript: pushToRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
7.1.10 pushToRefreshSkin
l font_weight
l font_style
l font_size
l font_color
l font_name
l background_color
l bg_type
l background_style
Note: The "release to refresh" title picks the skin of "pull to refresh" or "release to refresh" respectively.
Syntax
JavaScript: pushToRefreshSkin
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
7.1.11 releaseToPullRefreshI18NKey
Specifies the i18N key for "release to refresh" title that appears for pull to refresh. The platforms get the value
from the existing application locale specific i18N resource bundle. If the key is not found in the resource
bundle, then platforms use the default (english locale) title text.
Syntax
JavaScript: releaseToPullRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
7.1.12 releaseToPushRefreshI18NKey
Specifies the i18N key for "release to refresh" title that appears for push for refresh. The platforms get the
value from the existing application locale specific i18N resource bundle. If the key is not found in the resource
bundle, then platforms use the default (english locale) title text.
Syntax
JavaScript: releaseToPushRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
7.1.13 scrollDirection
Specifies how you can scroll the content within the ScrollBox.
Default: SCROLLBOX_SCROLL_HORIZONTAL
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: scrollDirection
Lua: scrolldirection
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.1.14 showScrollbars
Specifies the visibility of the ScrollBars. If you set the scrollDirection to other than none and setting
showScrollbars property to true, enables you to view the scrollbars.
Default: true
Note: On iPhone platform scrollbars are visible while scrolling and become invisible once you stop scrolling.
Syntax
JavaScript: showScrollbars
Lua: showscrollbars
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, BlackBerry 10, and Windows Kiosk
platforms.
7.1.15 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
l containerHeight
l containerHeightReference
l containerWeight
l layoutAlignment
l margin
l marginInPixel
l padding
l paddingInPixel
l percent
7.2.1 containerHeight
Specifies the available height of the container in terms of percentage. The percentage is with reference to the
value of containerHeightReference property.
For example, On a Form you have a ScrollBox with 5 labels and 5 buttons in it and a CloseButton below the
ScrollBox. If the containerHeight is set as 100 (percentage) and containerHeightReference is set as
SCROLLBOX_HEIGHT_BY_FORM_REFERENCE, then the ScrollBox occupies the height of the Form
excluding the height occupied by the CloseButton.
Default: If not configured, the value may vary depending on the platforms.
Syntax
JavaScript: containerHeight
Lua: containerheight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform availability
Available on all platforms except on all Server side Mobile Web platforms.
7.2.2 containerHeightReference
This property is enabled when you set the containerHeight. The widget height percentage is calculated based
on the following options.
Default: CONTAINER_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Lua: containerheightreference
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.2.3 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.2.4 layoutAlignment
This property is enabled when you set the percent property as false. Specifies the direction in which the
widgets are laid out.
Default: BOX_LAYOUT_ALIGN_FROM_LEFT
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: layoutAlignment
Lua: layoutalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.2.5 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.2.6 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
//Creating a ScrollBox.
var scrollBox = new kony.ui.ScrollBox(scrollBasic, scrollLayout, scrollPS
P);
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
7.2.7 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.2.8 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
7.2.9 percent
Specifies if the child widgets weight factor must be considered during layout.
Default: true
Syntax
JavaScript: percent
Lua: percent
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
l bounces
l contextMenu
l scrollArrowConfig
l showFadingEdges
l viewConfig
7.3.1 bounces
Specifies whether the scroll view bounces past the edge of the content and back again.
Default:true
Syntax
JavaScript: bounces
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
7.3.2 contextMenu
Shows the list of actions (appropriate to the widget in focus) as menu items.
l You can invoke the context menu either by clicking on the widget (applicable only on BlackBerry
versions 6.x and above) or by a long press on the screen (or trackpad).
l You can choose to add icons to indicate the menu items in the context menu (applicable only on
BlackBerry versions 6.x and above).
l BlackBerry layouts menu items in a 3 item grid view. The menu items Switch Application, Help, Close,
and Full Menu are added automatically based on the number of menu items added in the context menu.
For example, If you add a context menu with 2 items, it will display Full Menu item along with the items
added. If you add a context menu with 3 items, it will display Full Menu, Help, Switch Application items
along with the items added.
l If the focus is on a widget that has a context menu; and if you click the "menu key", the Full Menu
appears along with the context menu items.
l On Blackberry Non-Touch Devices, only Full Menu item is displayed irrespective of number of items
added in the context menu.
Note: The context menu items in the Full Menu will disappear if the focus is shifted from the widget which
has the context menu.
The following images illustrates the context menu on various BlackBerry devices:
BlackBerry Non-Touch
BlackBerry 6.x BlackBerry Touch Device
Device
Syntax
JavaScript: contextMenu
Lua: contextmenu
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
onclick:callbackMenuItem3};
var appMenu4 = {id:"appmenuitemid4", text:"Close", image:"tc.png", onclick:
callbackMenuItem4};
function callbackMenuItem1()
{
alert("Clicked on First menu item");
}
function callbackMenuItem2()
{
alert("Clicked on Second menu item");
}
function callbackMenuItem3()
{
alert("Clicked on Third menu item");
}
function callbackMenuItem4()
{
alert("Clicked on Fourth menu item");
}
No
Platform Availability
l BlackBerry
l Android/Android Tablet
l Windows Tablet
7.3.3 scrollArrowConfig
Specifies the images to indicate the scroll arrows of the ScrollBox in four directions. Use the below options to
set the appropriate value:
JavaScript: scrollArrowConfig
Lua: scrollarrowconfig
Type
JavaScript: Array
Lua: Table
Read / Write
No
JavaScript Example
Yes
Platform Availability
7.3.4 showFadingEdges
Specifies whether the horizontal and vertical edges of the ScrollBox should appear as faded when it is scrolled
horizontally or vertically.
Default:true
If set to false, the scroll view horizontal and vertical edges are not faded when scrolled.
If set to true, the scroll view horizontal and vertical edges will appear as faded when scrolled.
Syntax
JavaScript: showFadingEdges
Type
JavaScript: Boolean
Read / Write
JavaScript Example
No
Platform Availability
7.3.5 viewConfig
Note: For more information on applying the Grid layout please refer Kony Studio User Guide.
l Normal view
l Grid view
The type of view will be determined by the Reference Width and Reference Height of the view config property,
if reference height and width are greater than 0, then view set is grid view.
For example, if you set an onClick to a box, the onClick event will be executed whenever you click each cell.
Set righttap event using setGestureRecognizer to a box and you can see right click behavior on each cell of
grid view.
Default application displays 0,you can give any number greater than 0 to get grid view type of a widget.
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript:Object
Lua: table
Read / Write
No
JavaScript Example
Yes
Platform Availability
l scrollingEvents
7.4.1 scrollingEvents
Specifies the scrolling events which gets called when scrolling reaches beginning of the widget, end of the
widget, when the user tries to pull or push the scrolling beyond the vertical boundaries of the widget.
onReachingBegining: Gets called when scrolling reaches the beginning of the ScrollBox
widget.
Signature
onReachingEnd: Gets called when scrolling reaches the end of the ScrollBox widget.
Signature
Signature
Signature
Input Parameters
scrollDirection - Mandatory
Specifies the direction in which the scroll box must scroll. Following are the available options:
Note: To set the value through code, prefix the option with constants. such as
constants.<option> .
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//The below is the callback function for onReachingEnd event which comes u
nder scrollingEvents.
function onReachingEndFunCallBack(scrollBox, scrollDirection)
{
alert("onReachingEnd event triggered");
}
//The below is the callback function for onPull event which comes under sc
rollingEvents.
function onPullCallBack(scrollBox, scrollDirection)
{
alert("onPull event triggered");
}
//The below is the callback function for onPush event which comes under sc
rollingEvents.
function onPushCallBack(scrollBox, scrollDirection)
{
alert("onPush event triggered");
}
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, BlackBerry 10, and Desktop Web
platforms.
l add
l addAt
l remove
l removeAt
l scrollToBeginning
l scrollToEnd
l scrollToWidget
l widgets
7.5.1 add
This method is used to add widgets to the ScrollBox. When the widgets are added to the current visible
ScrollBox , then the changes will reflect immediately. Adding a widget to the ScrollBox hierarchy, which is
already a part of the other widget hierarchy, will lead to undefined behaviors. You have to explicitly remove the
widget from one hierarchy before adding it to another Box.
Signature
JavaScript: add(widgets)
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
//Adding label and button widgets to the scrollBox. Here label and button
widgets should be created already and made accessible.
scrollBox.add(lbl,btn);
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.5.2 addAt
This method is used to add widgets to the ScrollBox container at the specified index. Widget is prepended if
index <0 and appended at the end of the container if the index > size+1. Size is the number of widgets already
present in the container. If a new widget is added or removed will reflect immediately from the form hierarchy
model perspective, however the changes are displayed when the ScrollBox appears. When the widgets are
added to the current visible ScrollBox, then the changes will reflect immediately. Adding a widget to the
ScrollBox hierarchy, which is already a part of the other widget hierarchy, will lead to undefined behaviors.
You have to explicitly remove the widget from one hierarchy before adding it to another ScrollBox.
Signature
Input Parameters
Return Values
Exceptions
Widget Error
JavaScript Example
//Adding label to the scrollBox at 15th index Position. Here label should
be created already and made accessible.
scrollBox.addAt(lbl,15);
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.5.3 remove
This method removes a widget from the ScrollBox container. If a new widget is removed will reflect
immediately from the ScrollBox hierarchy model perspective, however the changes are displayed when the
ScrollBox appears. When the widgets are added to the current visible ScrollBox, then the changes will reflect
immediately.
Signature
JavaScript: remove(widgetref)
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label widget from the scrollBox .Here label should be created a
lready and added inside the scrollBox.
scrollBox.remove(lbl)
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.5.4 removeAt
This method removes a widget at the given index from the ScrollBox container. If a new widget is removed will
reflect immediately from the ScrollBox hierarchy model perspective, however the changes are displayed when
the ScrollBox appears. When the widgets are added to the current visible ScrollBox, then the changes will
reflect immediately.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
JavaScript: removeAt(index)
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label from the scrollBox at 15th index Position. Here the label
should be created and added at 15th index position of the scrollBox.
scrollBox.removeAt(15);
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
7.5.5 scrollToBeginning
This method gives you the control to scroll to the beginning of the ScrollBox.
Signature
JavaScript: scrollToBeginning()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android
l SPA(iPhone/Android)
l Windows Tablet
l BlackBerry10
7.5.6 scrollToEnd
This method gives you the control to scroll to the end of the ScrollBox.
Signature
JavaScript: scrollToEnd()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android
l SPA(iPhone/Android)
l Windows Tablet
l BlackBerry10
7.5.7 scrollToWidget
This method gives you the control to scroll the ScrollBox up to the position of selected widget.
Note: On Windows Phone platform, scrollToWidget will not work when scrollDirection is set to
SCROLLBOX_SCROLL_NONE.
Signature
JavaScript: scrollToWidget()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android
l Windows Tablet
l Windows Phone
l BlackBerry10
7.5.8 widgets
This method returns an array of the widget references which are direct children of ScrollBox.
Signature
JavaScript: widgets()
Lua: box.widgets(boxref)
Input Parameters
Return Values
This method returns Read only array of widget references. Modifying the array and changing the position
of widgets in this array doesn't reflect in the ScrollBox hierarchy. However, you can get handle to the
widgets through this array and modify the widgets through widget level methods as exposed by individual
widgets.
Exceptions
None
JavaScript Example
//Collecting all the widgets of the scrollBox into array and displaying the
references.
wigArr = scrollBox.widgets();
alert("Widgets are::"+wigArr);
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
8. TabPane
TabPane widget is a container widget that allows you to organize multiple tabs within it. Each Tab will in turn
hold a collection of widgets within the same area of the Form. You can only view one Tab a time, and every
Tab in the TabPane widget consists of a certain type of information and is displayed when the user selects the
corresponding Tab.
TabPane widget provides you an option to set Basic Properties, Layout Properties, Platform Specific
Properties, and Events. Deprecated properties are provided with their alternative properties in the Deprecated
section.
Events Methods
onTabClick addTab
preOnclickJS addTab
postOnclickJS addTabAt
removeTabAt
removeTabByld
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
1. From the IDE, drag and drop the TabPane widget onto a form (occupies 100% of the screen width).
2. TabPane widget consists of only one Tab by default. Drag and drop the required number of Tab widgets
into the TabPane widget.
3. Specify the Tab that must be displayed as the default open Tab by using the activeTabs property.
4. Specify the appearance of the TabPane (tab view, page view, etc.) using the viewType property.
Customizing Appearance
You can customize the appearance of the TabPane widget by using the following properties:
For Desktop Web platform, tab widget accepts a Header Box that enables the developer to design the tab
header based on requirements. The Header Box is valid and applicable when the tab is in default and
collapsible view modes. A separate copy of the Header Box should be added to each of the tabs to which it is
assigned. The widgets inside the Header Box can be accessed in the same manner as the widgets inside the
tab widget. Kony Studio provides the ability to define Header Boxes for the tab widget by allowing the
developer to place any one or combination of the following widgets:
l Label
l Image
l Link
l Button
l HBox
l VBox
l RichText
Events defined on individual widgets within the header template are respected and the focus skins as defined
by these widgets are applied. When clicked on any other area which does not have its own event, the tab's
onTabClick event is fired. The signature of every event raised by the widgets in the header will have the
following parameters tabID, tabPaneID, currentWidget.
Important Considerations
TabPane allows you to build the container with multiple tabs and each tab holding a different structure and
content. The TabPane widget provides you with an option to set Basic Properties, Layout Properties, Platform
Specific Properties, Events, and Methods. Deprecated properties are provided with their alternative properties
in the Deprecated section.
l activeFocusSkin
l activeSkin
l activeTabs
l id
l inactiveSkin
l info
l isVisible
l retainPositionInTab
l screenLevelWidget
l viewConfig
l viewType
8.1.1 activeFocusSkin
This is a skin property. This property specifies the skin that is to be applied when a TabPane is active and
focused.
Syntax
JavaScript: activeFocusSkin
Lua: activefocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.2 activeSkin
Syntax
JavaScript: activeSkin
Lua: activeskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.3 activeTabs
Indicates the selected Tabs indices. Index starts from 0. Specifies the Tab that must be displayed as the
default open Tab.
If you want to set another Tab as Active Tab, select that Tab in the drop-down list. Multiple indices in
activeTabs is only appropriate for collapsible view currently. For all the remaining views,activeTabs always
respects only one selected item i.e first element in the array.
Syntax
JavaScript: activeTabs
Lua: activetabs
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.4 id
id is a unique identifier of a TabPane consisting of alpha numeric characters. Every TabPane should have a
unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.5 inactiveSkin
Syntax
JavaScript: inactiveSkin
Lua: inactiveskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.6 info
A custom JS Object with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But
you can always read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
8.1.7 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
8.1.8 retainPositionInTab
Indicates whether each individual tab should retain its scroll position when the TabPanes are switched over.
Default:false
Syntax
JavaScript: retainPositionInTab
Lua: retainpositionintab
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.9 screenLevelWidget
Specifies whether the widget should occupy the whole container or not.
Note: You cannot place more than one TabPane as a screen level widget inside a form. Also, if you choose
to make a TabPane a Screen Level Widget, we recommend that you place only one TabPane in the form and
do not place any other widgets in the form.
Note: Do not set the screen level widget property to true for more than one widget in the form. If you have
multiple widgets with this property set as true, there may be issues with how information is displayed along
with some scrolling issues.
Default: false
If set to false, the widget does not occupy the whole container.
Syntax
JavaScript: screenLevelWidget
Lua: screenlevelwidget
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Desktop Web, BlackBerry, and BlackBerry 10 platforms
8.1.10 viewConfig
Below are the view configuration properties in Desktop Web and mobile channel platforms when the viewType
is set as
expandedImage: String value indicates the name of the image when the tab is
expanded.
collapsedImage: String value indicates the name of the image when the tab is
collapsed.
imagePosition: Specifies the position of the image on the tab. Following are the
available options:
l TABPANE_COLLAPSIBLE_IMAGE_POSITION_LEFT
l TABPANE_COLLAPSIBLE_IMAGE_POSITION_RIGHT
l TABPANE_COLLAPSIBLE_TABNAME_ALIGNMENT_LEFT
l TABPANE_COLLAPSIBLE_TABNAME_ALIGNMENT_RIGHT
toggleTabs: Boolean value indicates whether the content of a tab will still be
displayed if you click on some other tab.
needPageIndicator - Boolean value indicates whether the page indicator required or not.
l TAB_HEADER_POSITION_TOP
l TAB_HEADER_POSITION_BOTTOM
l TAB_HEADER_POSITION_LEFT
l TAB_HEADER_POSITION_RIGHT
Type: Number
Default: 50%
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
8.1.11 viewType
Default: TABPANE_VIEW_TYPE_TABVIEW
l TABPANE_VIEW_TYPE_TABVIEW
l TABPANE_VIEW_TYPE_COLLAPSIBLEVIEW
l TABPANE_VIEW_TYPE_PAGEVIEW (supported on iOS, Android, and Desktop Web only)
l TABPANE_VIEW_TYPE_PANORAMAVIEW (supported on Windows Phone only)
Note: Sections are supported only when the viewType is set as TABPANE_VIEW_TYPE_TABVIEW.
Note: TABPANE_VIEW_TYPE_PAGEVIEW is always screen level irrespective of weather the value for
screenLevelWidget property is set to true or false.
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l containerHeight
l containerHeightReference
l containerWeight
l gridCell
l layoutMeta
l layoutType
l margin
l marginInPixel
l padding
l paddingInPixel
8.2.1 containerHeight
Specifies the available height of the container in terms of percentage. The percentage is with reference to the
value of containerHeightReference property.
Note: When screenLevelWidget property is set to false, the TabPane widget occupies the child
widget/content height. When screenLevelWidget property is set to true, the below table is applicable:
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform availability
Available on all platforms except on all Server side Mobile Web and Windows Kiosk platforms.
8.2.2 containerHeightReference
This property is enabled when you set the containerHeight. The widget height percentage is calculated based
on the below options when the viewType is set as TABPANE_VIEW_TYPE_PAGEVIEW or TABPANE_
VIEW_TYPE_PAGEVIEW or TABPANE_VIEW_TYPE_COLLAPSIBLEVIEW.
Default: constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and Windows Kiosk platforms.
8.2.3 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
Yes
Platform Availability
8.2.4 gridCell
Note: This property is applicable only when a widget is placed inside a container widget with Grid Layout
applied.
Represents the grid cell details in the sequence colSpan, rowSpan, rowNo, colNo. Description of the details
are as follows:
l colSpan: Specifies the number of columns that a grid should span. Default value is 1.
l rowSpan: Specifies the number of rows that a grid should span. Default value is 1.
l rowNo: Specifies the row number in where the widget is placed in a grid layout.
l colNo: Specifies the column number in where the widget is placed in a grid layout.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. The default option is XYLayout. To set GridLayout, right-click on the form and select Apply
GridLayout.
Syntax
JavaScript: gridCell
Lua: gridCell
Type
JavaScript: JSObject
Lua:table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
8.2.5 layoutMeta
A custom JSObject with the key, value pairs that developer can use to provide the meta info about the grid
layout. The following are the mandatory keys required to be part of the Meta.
Note: The data for layoutmeta data is set when you set grid layout view properties for rows and columns.
This property can be set using Kony Studio Grid Layout view. To set the view, go to Window > Show View >
Others and select GridLayout View from Kony Studio folder.
The sum total of percentage (%) widths of each of the columns in the grid layout should add up to 100%.
Syntax
JavaScript: layoutMeta
Lua: layoutmeta
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
8.2.6 layoutType
Defines the type of the layout of container widget. Following are the available options:
l CONTAINER_LAYOUT_BOX: This is the default options on both Windows Tablet and Desktop Web
platforms.
l CONTAINER_LAYOUT_GRID: In grid layout the form is split it to rows and columns.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. From the IDE, the default option is XYLayout. To set GridLayout, right-click on the form and select
Apply GridLayout.
Syntax
JavaScript: layoutType
Lua: layouttype
Type
Lua:String - [Mandatory]
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
8.2.7 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element. Array format [left, top, right, bottom] ex: [10,10,10,10].
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10 platforms
8.2.8 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
8.2.9 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10 platforms
8.2.10 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l pageSkin
l progressIndicatorColor
l showProgressIndicator
l tabHeaderTemplate
l tabHeaderHeight
8.3.1 pageSkin
Specifies the skin for page indicator. This property is applicable only when viewType is set as TABPANE_
VIEW_TYPE_PAGEVIEW and images are selected for pageOnDotImage and pageOffDotImage.
Default: Skin Defaults ( blue color strip is applied for the page indicator)
Syntax
JavaScript: pageSkin
Type
JavaScript: String
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
8.3.2 progressIndicatorColor
Default: PROGRESS_INDICATOR_COLOR_WHITE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: progressIndicatorColor
Lua: progressindicatorcolor
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
8.3.3 showProgressIndicator
Default: true
Syntax
JavaScript: showProgressIndicator
Lua: showprogressindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
8.3.4 tabHeaderTemplate
Accepts reference to a box widget which represents a UI template for a custom tab header. The box template
is allowed to have only Label, Link, Richtext, Button and Image widgets.
Syntax
JavaScript: tabHeaderTemplate
Lua: tabHeaderTemplate
Type
JavaScript: kony.ui.Box
Lua: UserData
Read / Write
Yes
Platform Availability
8.3.5 tabHeaderHeight
Default: 64
Note: This property is applicable only when the viewType is set as TABPANE_VIEW_TYPE_TABVIEW.
Syntax
JavaScript:tabHeaderHeight
Lua:tabHeaderHeight
Type
JavaScript: Number
Lua: Number
Read / Write
Yes
JavaScript Example
Yes
Availability on platforms
l onTabClick
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
8.4.1 onTabClick
Event callback invoked when the tab is clicked. This event is triggered when you expand or collapse any Tab.
Syntax
Input Parameters
Read / Write
JavaScript Example
Yes
Platform Availability
8.4.2 preOnclickJS
This event allows the developer to execute custom JavaScript function before the onTabClick callback of the
TabPane is invoked. This is applicable only for Mobile Web channel. The function must exist in a JavaScript
file under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
8.4.3 postOnclickJS
This event allows the developer to execute custom JavaScript function after the onTabClick callback of the
TabPane is invoked. This is applicable only for Mobile Web channel.The function must exist in a JavaScript
file under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
l addTab
l addTab ( applicable only on Desktop Web platform)
l addTabAt
l removeTabAt
l removeTabByld
8.5.1 addTab
Signature
Input Parameters
masterDataLoad
Deprecated. Works only for backward compatibility.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
8.5.2 addTab
This method is applicable only on Desktop Web platform. It is an overloaded method used to add a tab to the
TabPane widget. This method accepts headerbox template that is to be displayed as part of tab both in default
and collapsible mode.
For example, form1.tabpane1.tab1.header.widget1 is one of the widgets inside the tab header template.
Signature
Input Parameters
headerBox[widgetref]- Mandatory
Handle to the widget instance.
Return Values
None
Error Codes
None
Platform Availability
8.5.3 addTabAt
This method is used to add a tab at the specified index to the TabPane. The new tab is placed before the
specified index.
If the row Index mentioned is greater than "N", then row is added at the end of the tabpane ui and if it is less
than zero, it will be added at the beginning of the TabPane.
Signature
Input Parameters
tabId
Specifies the id of the tab.
tabName
Specifies the name of the tab.
tabImage
Specifies the image of the tab.
box
Specifies the reference of the box.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
8.5.4 removeTabAt
This method is used to remove a tab based on the index on the TabPane.
Signature
JavaScript: removeTabAt(index)
Input Parameters
An active tab (currently selected tab) can be removed. If an active Tab is removed, then the first
index in activeTabs property will be selected/focused. If active Tabs has only one element, or view
doesn't have more than one active tab, then if the active tab is closed, the 0th position will be
selected by default.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
8.5.5 removeTabByld
This method is used to remove a tab based on the tabid on the TabPane.
Signature
JavaScript: removeTabByld(tabld)
Input Parameters
An active tab (currently selected tab) can be removed. If an active Tab is removed, then the first
index in activeTabs property will be selected/focused. If active Tabs has only one element, or view
doesn't have more than one active tab, then if the active tab is closed, the 0th position will be
selected by default.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
Note: Tab header templates are supported only on Desktop Web platform.
Tab header template enables you to define a template for tab headers with specified widgets. You can use the
template on individual tab headers of a Tab pane. This is primarily useful for developers to achieve common
look and feel of the tab headers of a Tab Pane widget.
l To have uniform look and feel of the tab headers with the specified widgets.
l To display different tab headers for different Tab panes.
l To perform an action on a tab header.
When you want information to be displayed or customized in a tab header of a Tab pane in the application, you
have a provision to add a tab headers template using Kony Studio. For more information about tab headers
templates refer Kony Studio User Guide.
1. Go to Applications View.
2. Expand the application for which you want to create the TabHeader template.
3. Navigate to templates > tabheaders, right-click desktop and select New TabHeader Template. The
Create a New TabHeader window appears.
Note: Only HBox and VBox are supported on the form. You can add other widgets
within these widgets.
iv. Drag and drop the required widgets onto the HBox/VBox. Set the properties of these
widgets. For more information, see Kony Widget User Guide.
v. A TabHeader template is created.
You can define only one template for each map using the above process.
1. Go to Applications view.
2. Expand the application for which you want to use section template.
3. Navigate to forms > desktop , right-click and select New Form. The Create a New Form window
appears.
4. Enter a name for the Form and click Finish. A new Form is created.
5. Drag-drop a TabPane and add Tabs to it as required. Click Save.
6. To set the template to a Tab, select the Tab and go to Properties window.
7. Select tabHeaderTemplate and Select/Search map Template window opens. Select the template,
which you want to set to the Tab.
8. Click OK.
9. Popup
Popup is a visual component that displays content on top of existing content, within the bounds of the
application window.
Generally a popup is displayed in the center of the screen on top of the Form from which you have invoked the
popup. It does not span the entire screen width.Popups allow you to partition UI design into smaller parts.
Popup provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
Events and Methods.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Platform Specific
Basic Properties Layout Properties
Properties
footers containerHeight bounces
headers containerHeightReference captureGPS
id containerWeight contextPath
info gridCell configureExtendTop
isModal layoutMeta draggable
skin layoutType extendTop
title padding footerOverlap
transparencyBehindThePopup paddingInPixel headerOverlap
inputAccessoryViewType
inTransitionConfig
layout
minimizeOnLostFocus
noCache
outTransitionConfig
popupStyle
resizable
secureData
showMiniAppMenu
submitSecure
titleBarConfig
viewConfig
windowSoftInputMode
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
Note: Before you place a widget in a Popup that exceeds the Popup width, ensure that you set the Popup
width manually using the containerWeight property for a Popup. IDE representation for continerWeight is
Size (Width). For example if you select the viewType property as CALENDAR_VIEW_TYPE_ GRID_
ONSCREEN for a Calender placed within a Popup, ensure you set the Popup width to a minimum of 90%
otherwise the Calendar does not appear completely within the popup.
Note: Display orientation (LANDSCAPE, PORTRAIT) of the popup always follows the orientation of the
current form and also the on orientation change event gets called only on the current form and there is no
orientation change event at the popup level.
For information about how you can add a Popup to an Application, see the Section Adding Popups to an
Application in the Kony Studio User Guide.
Behavior
After a Popup is created , you can initialize the Popup using one of the following:
l show
l Accessing one of the popup widgets
The behavior of Popups on Mobile Web Advanced, BJS, and Basic is as follows:
Advanced
l In all Advanced versions of Mobile Web, the Popups appear on the screen where the popup has been
invoked using show.
l By default, all Popups are in full screen mode. The Popups are not positioned based on the widget
context.
l Fixed headers and footers are not supported in BB NTH devices. The header / footer (for a popup) are
always docked to the top / bottom of the browser and should not be used unless otherwise the popup
has large content.
BJS and Basic
l footers
l headers
l id
l info
l isModal
l skin
l title
l transparencyBehindThePopup
9.1.1 footers
A footer is a section of the Popup that is docked at the bottom of the Popup (does not scroll along with the
content of the Popup). It accepts an array of kony.ui.Box object references with horizontal orientation that are
added as footer docked at the bottom of the Popup. These footers can be reused across forms.
Syntax
JavaScript: footers
Lua: footers
Type
JavaScript: Array(kony.ui.Box)
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
9.1.2 headers
A header is a section of the Popup that is docked at the top of the Popup (does not scroll along with the
content of the Popup). It accepts an array of kony.ui.Box object references with horizontal orientation that are
added as header docked at the top of the Popup. These headers can be reused across Popups.
Syntax
JavaScript: headers
Lua: headers
Type
JavaScript: Array(kony.ui.Box)
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
9.1.3 id
id is a unique identifier of Popup consisting of alpha numeric characters. Every Popup should have a unique id
within an application.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.1.4 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
9.1.5 isModal
In user interface design, a modal window, which is a child window that requires users to interact with it before
they can return to operating the parent application, thus preventing the workflow on the application main
window.
This property indicates whether the popup is to be shown as modal window or a non-modal window.
Default: false
Syntax
JavaScript: isModal
Lua: ismodal
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
9.1.6 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
9.1.7 title
Specifies a general or descriptive text that will be shown as the title for the Popup.
Note: For Desktop Web platform, the title is displayed on the browser window.
Syntax
JavaScript: title
Lua: title
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
9.1.8 transparencyBehindThePopup
Indicates the transparency to be used behind the popup, default is 100% transparent. This can be used to
have dim effect behind the popup when a popup is shown.
Syntax
JavaScript: transparencyBehindThePopup
Lua: transparencybehindthepopup
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l containerHeight
l containerHeightReference
l containerWeight
l gridCell
l layoutMeta
l layoutType
l padding
l paddingInPixel
9.2.1 containerHeight
Specifies the available height of the container in terms of percentage. The percentage is with reference to the
value of containerHeightReference property.
Default: If not configured, the value may vary depending on the platforms.
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform availability
Available on all platforms except on all Server side Mobile Web and Desktop Web
9.2.2 containerHeightReference
This property is enabled when you set the containerHeight. The widget height percentage is calculated based
on the following options:
Default: CONTAINER_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option>.
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and Desktop Web
9.2.3 containerWeight
Specifies percentage of width to be occupied by the Popup with respect to its parent form width.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
Yes
Platform Availability
9.2.4 gridCell
Note: This property is applicable only when a widget is placed inside a container widget with Grid Layout
applied.
Represents the grid cell details in the sequence colSpan, rowSpan, rowNo, colNo. Description of the details
are as follows:
l colSpan: Specifies the number of columns that a grid should span. Default value is 1.
l rowSpan: Specifies the number of rows that a grid should span. Default value is 1.
l rowNo: Specifies the row number in where the widget is placed in a grid layout.
l colNo: Specifies the column number in where the widget is placed in a grid layout.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. The default option is XYLayout. To set GridLayout, right-click on the form and select Apply
GridLayout.
Syntax
JavaScript: gridCell
Lua: gridCell
Type
JavaScript: JSObject
Lua:table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
9.2.5 layoutMeta
A custom JSObject with the key, value pairs that developer can use to provide the meta info about the grid
layout. The following are the mandatory keys required to be part of the Meta.
Note: The data for layoutmeta data is set when you set grid layout view properties for rows and columns.
This property can be set using Kony Studio Grid Layout view. To set the view, go to Window > Show View >
Others and select GridLayout View from Kony Studio folder.
The sum total of percentage (%) widths of each of the columns in the grid layout should add up to 100%.
Syntax
JavaScript: layoutMeta
Lua: layoutmeta
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
"rows": 4
},gridCell: {"colSpan":1, "rowSpan":1, "rowNo":1, "colNo":1} };
var popPSP ={};
Yes
Platform Availability
l Windows Tablet
l Desktop Web
9.2.6 layoutType
Defines the type of the layout of container widget. Following are the available options:
l CONTAINER_LAYOUT_BOX: This is the default options on both Windows Tablet and Desktop Web
platforms.
l CONTAINER_LAYOUT_GRID: In grid layout the form is split it to rows and columns.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. From the IDE, the default option is XYLayout. To set GridLayout, right-click on the form and select
Apply GridLayout.
Syntax
JavaScript: layoutType
Lua: layouttype
Type
Lua:String - [Mandatory]
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
9.2.7 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply padding for a ComboBox, Form and ListBox widgets on
Mobile Web platform. Padding is not supported by Windows Mobile browser for Box and Image Gallery.
Note: If no skin is applied to a Button, then padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
9.2.8 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l bounces
l captureGPS
l contextPath
l configureExtendTop
l draggable
l extendTop
l footerOverlap
l headerOverlap
l inputAccessoryViewType
l inTransitionConfig
l layout
l minimizeOnLostFocus
l noCache
l outTransitionConfig
l popupStyle
l resizable
l secureData
l showMiniAppMenu
l submitSecure
l titleBarConfig
l viewConfig
l windowSoftInputMode
9.3.1 bounces
Specifies whether the scroll view bounces past the edge of the content and back again.
Default:true
Syntax
JavaScript: bounces
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
9.3.2 captureGPS
Specifies if the Popup must display a dialog seeking permission from the user to access the location details.
Note: For this property to work, you must have selected Requires GPS functionality in the Project
Properties of the Application (For more information, see the Configuring Project Properties section of the
Kony Studio User Guide) to enable the application to use the GPS functionality.
Default: false
If set to true, the dialog appears when you navigate to the specified Popup.
If set to false, the dialog does not appear when you navigate to the specified Popup.
The following image illustrates the popup to access the location details:
Syntax
JavaScript: captureGPS
Lua: captureGPS
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.3 contextPath
Specifies the context path to be displayed in the address field of the browser. For more information about
specifying a context path, refer the Kony Studio Users Guide.
Default: empty
Note: This field is only populated when you specify a Context ID and a corresponding Context Path in the
Site Minder tab under Mobile web in the Project properties window.
Syntax
JavaScript: contextPath
Lua: contextpath
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.4 configureExtendTop
Default:false
Syntax
Read / Write
No
Yes
Platform Availability
l iPhone
l iPad
9.3.5 draggable
Specifies the weather the popup can be dragged across the browser screen.
Default: false
Syntax
JavaScript: draggable
Type
JavaScript:Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.6 extendTop
Specifies the popup content to scroll under the App Menu. This property is supported in iOS7 and above only.
This property is also applicable on the Application Level properties under Application Properties > Native
> iPhone/iPad > Platform Settings. The property set at popup level takes precedence over Application level.
Default:false
Note: This property is applicable on popup level headers and footers, app level headers and footers, title bar,
and app menu.
Syntax
JavaScript: extendTop
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
9.3.7 footerOverlap
Specifies if the footer must overlaps the Popup. For example, every time you scroll the Popup, the footer is
fixed and the footer overlaps the Popup as specified in the Footer Overlap field. If this field is selected, the
Popup scrolls behind the footer background and a part of the footer background is transparent.
Default: false
Syntax
JavaScript: footerOverlap
Lua: footeroverlap
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
9.3.8 headerOverlap
Specifies if the header must overlaps the Popup. For example, every time you scroll the Popup, the header is
fixed and the header overlaps the Popup as specified in the header overlap field. If this field is selected, the
Popup scrolls behind the header background and a part of the header background is transparent.
Default: false
Syntax
JavaScript: headerOverlap
Lua: headeroverlap
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
9.3.9 inputAccessoryViewType
When building iPhone applications that support or provide text input, it's often necessary to create some extra
buttons (or other controls) beyond the ones provided by the default keyboard interface. Kony Platform by
default, adds the Previous, Next and Done buttons to the applicable input controls. These buttons allow
specific operations needed by your application, such as moving to the next or previous text field, make the
keyboard disappear. The area above the keyboard is known as Input Accessory View.
This property, allows you to specify the type of accessory view that will be shown for all the input controls on
this Popup.
Note: The Input Accessory View Type defined in the form level takes precedence over the Input Accessory
View Type defined in application level settings.
Default: FORM_INPUTACCESSORYVIEW_DEFAULT
l FORM_INPUTACCESSORYVIEW_NONE: Use this option if you do not want to specify the toolbar.
This option should be used carefully, as setting this option for widgets like calendar leaves the user
with no option to select and drop-down a wheel calendar.
l FORM_INPUTACCESSORYVIEW_DEFAULT: Specifies that the toolbar that is defined in the
Application level settings. To set the Application level settings, right-click on the project and navigate
to Properties> Native App>iPhone/iPad.
l FORM_INPUTACCESSORYVIEW_NEXTPREV: Specifies the navigation options as Next,
Previous, and Done for a popup. The below image illustrates the nextprevtoolbar set for a Textbox. The
highlighted toolbar is achieved by setting the Keyboard Type as Default for a Textbox and Input
Accessory View Type as nextprevtoolbar to the popup.
Note: This option (none) should be used carefully, as setting this option for widgets like calendar leaves the
user with no option to select and drop-down a wheel calendar.
Syntax
JavaScript: inputAccessoryViewType
Lua: inputaccessoryviewtype
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
9.3.10 inTransitionConfig
Specifies the configuration to be used when the user arrives on this form. It accepts hash values.
transitionDuration: Specifies the duration after which the transition is applied on the popup. The default
value is 0.3 seconds.
transitionDirection: Specifies the direction from which the popup is displayed. The available options are:
1. none - Use this option if you do not want to specify a transition direction.
2. fromRight - Specifies that the popup must appear from the right.
3. fromLeft - Specifies that the popup must appear from the left.
4. fromBottom - Specifies that the popup must appear from the bottom.
5. fromTop - Specifies that the popup must appear from the top.
transitionEffect: Specifies the effect from which the popup is displayed. The available options are:
1. none - Use this option if you do not want to specify a transition direction.
2. transitionMoveIn - Specifies that the popup must slide over the existing content in the direction as
specified in the transitionDirection.
3. transitionPush - Specifies that the popup must push the existing content in the direction as specified in
the transitionDirection and take its place.
4. transitionReveal - Specifies that the popup must be revealed gradually in the direction as specified in
the transitionDirection.
1. default/none - The constant value is 0. The default device effect is applied or none of the effect is
applied.
2. bottom-top - The constant value is 1. Specifies that the popup must slide-in from the bottom and
proceed towards the top.
3. from left - The constant value is 2. Specifies that the popup must slide-in from the left with a fade
effect.
4. from right- The constant value is 3. Specifies that the popup must slide-in from the right with a fade
effect.
5. to right- The constant value is 4. Specifies that the popup must slide-out to the right with a fade effect.
6. to left- The constant value is 5. Specifies that the popup must slide-out to the left with a fade effect.
7. from center- The constant value is 6. Specifies that the popup must grow from the center with a fade
effect.
8. topright-bottom - The constant value is 7. Specifies that the popup must slide-in from the top-right
corner and proceed towards the bottom.
9. bottomleft-top - The constant value is 8. Specifies that the popup must slide-in from the bottom-left
corner and proceed towards the top.
10. bottom-top style1 - The constant value is 9. Specifies that the popup must shrink from the bottom
towards the top.
11. top down - The constant value is 10. Specifies that the popup must slide-in from the top and proceed
towards the bottom.
popup1.inTransitionConfig= { popupAnimation: 1 };
transitionMode: Specifies the direction from which the form is displayed. The available options are:
1. Default(none)- The default device effect is applied or none of the effect is applied.
2. Sequential- The transition of the popup going out of the view completes first and then the transition of
the popup coming into the view takes place.
3. Parallel- The transition of the popup going out of the view and the transition of the popup coming into
the view takes place simultaneously.
inTransition: Specifies the effect from which the popup is displayed. The available options are:
1. Default(none)- Specifies that the popup must slide horizontally into the view.
2. Rotate3DSingle - Specifies that the popup must be rotated along the center Y-Axis when coming into
the view.
3. Rotate3DDual - Specifies that the popup must be shown making a circle around the screen from the
background before coming into the view.
4. Slide - Specifies that the popup must slide horizontally into the view.
5. Pop - Specifies that the popup must emerge from center-bottom of the screen and gradually occupy the
complete screen.
6. Squeeze - Specifies that the popup must be expanded horizontally from an initial width of zero.
transitionSpeed: Specifies the speed at which the Popup is transitioned. The value must be specified in
seconds.
On Symbian Platform, Default Transition can be set to true or false. When set to true, the default transition is
applied.
1. None- Use this option if you do not want to specify a transition direction.
2. Top Center - Specifies that the popup must appear from the top center.
3. Bottom Center - Specifies that the popup must appear from the bottom center.
4. Right Center - Specifies that the popup must appear from the right center.
5. Left Center - Specifies that the popup must appear from the left center.
Syntax
JavaScript: inTransitionConfig
Lua: intransitionconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web platforms, Windows Kiosk, and Windows
Tablet
9.3.11 layout
Default : Vertical
JavaScript: layout
Lua: layout
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.12 minimizeOnLostFocus
Indicates the popup window should minimize when the focus moves out of the popup. This property is
applicable only for non-modal popup.
Default: false
Syntax
JavaScript: minimizeOnLostFocus
Type
JavaScript: Boolean
Read / Write
No
JavaScript Example
//Creating a POPUP.
var frm =new kony.ui.Popup(popBasic, popLayout, popPSP);
Yes
Platform Availability
9.3.13 noCache
A web cache is a mechanism for the temporary storage (caching) of web documents, such as HTML pages
and images, to reduce bandwidth usage, server load, and perceived lag. This property indicates that if the
form is enabled for caching on the device browser.
Default: true
If set to false, appropriate Cache control headers are included in the HTTP response.
If set to true, cache control headers are not included in the HTTP response.
Syntax
JavaScript: noCache
Lua: nocache
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.14 outTransitionConfig
Specifies the type of transition effect to be applied when the popup is going out of view. It accepts hash
values.
transitionDuration: Specifies the duration after which the transition is applied on the popup. The default
value is 0.3 seconds.
transitionDirection: Specifies the direction from which the popup must disappear in a view. You can choose
one of the following options:
1. none - Use this option if you do not want to specify a transition direction.
2. fromRight - Specifies that the popup must disappear from the right.
3. fromLeft - Specifies that the popup must disappear from the left.
4. fromBottom - Specifies that the popup must disappear from the bottom.
5. fromTop - Specifies that the popup must disappear from the top.
transitionEffect: Specifies the type of transition effect to be applied when the form disappears in the view.
You can choose one of the following transition effects:
1. none - Use this option if you do not want to specify a transition direction.
2. transitionFade - Specifies that the popup must fade when it is transitioned to a hidden or an invisible
state.
3. transitionMoveOut - Specifies that the popup must slide away in the direction as specified in the
transitionDirection.
4. transitionMoveIn - Specifies that the popup must slide over the existing content in the direction as
specified in the transitionDirection.
1. default/none - The constant value is 0. The default device effect is applied or none of the effect is
applied.
2. bottom-top - The constant value is 1. Specifies that the popup must slide-out from the bottom and
proceed towards the top.
3. from left- The constant value is 2. Specifies that the popup must slide-out from the left with a fade
effect.
4. from right - The constant value is 3. Specifies that the popup must slide-out from the right with a fade
effect.
5. to right - The constant value is 4. Specifies that the popup must slide-in to the right with a fade effect.
6. to left - The constant value is 5. Specifies that the popup must slide-in to the left with a fade effect.
7. from center - The constant value is 6. Specifies that the popup must grow from the center with a fade
effect.
8. topright-bottom - The constant value is 7. Specifies that the popup must slide-in from the top-right
corner and proceed towards the bottom.
9. bottomleft-top - The constant value is 8. Specifies that the popup must slide-in from the bottom-left
corner and proceed towards the top.
10. bottom-top style1 - The constant value is 9. Specifies that the popup must shrink from the bottom
towards the top.
11. top down - The constant value is 10. Specifies that the popup must slide-in from the top and proceed
towards the bottom.
popup1.outTransitionConfig= { popupAnimation: 10 };
transitionMode: Specifies the direction from which the popup is displayed. The available options are:
1. Default(none)- The default device effect is applied or none of the effect is applied.
2. Sequential- The transition of the popup going out of the view completes first and then the transition of
the form coming into the view takes place.
3. Parallel- The transition of the popup going out of the view and the transition of the form coming into the
view takes place simultaneously.
outTransition: Specifies the effect from which the popup is displayed. The available options are:
1. Default(none)- Specifies that the popup must slide horizontally into the view.
2. Rotate3DSingle - Specifies that the popup must be rotated along the center Y-Axis when coming into
the view.
3. Rotate3DDual - Specifies that the popup must be shown making a circle around the screen from the
background before coming into the view.
4. Slide - Specifies that the popup must slide horizontally into the view.
5. Pop - Specifies that the popup must emerge from center-bottom of the screen and gradually occupy the
complete screen.
6. Squeeze - Specifies that the popup must be expanded horizontally from an initial width of zero.
transitionSpeed: Specifies the speed at which the popup is transitioned. The value must be specified in
seconds.
On Symbian Platform, Default Transition can be set to true or false. When set to true, the default transition is
applied.
1. None- Use this option if you do not want to specify a transition direction.
2. Top Center - Specifies that the popup must disappear from the top center.
3. Bottom Center - Specifies that the popup must disappear from the bottom center.
4. Right Center - Specifies that the popup must disappear from the right center.
5. Left Center - Specifies that the popup must appear from the left center.
Syntax
JavaScript: outTransitionConfig
Lua: outtransitionconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web platforms, Windows Kiosk, and Windows
Tablet.
9.3.15 popupStyle
JavaScript: popupStyle
Lua: popupstyle
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.16 resizable
Specifies the weather the popup can be resized across the browser screen.
Default: false
Syntax
JavaScript: resizable
Type
JavaScript:Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.17 secureData
Specifies if the browser must retain and use the information that you have filled in a form (for example,
username and password) and use it during the POST request made when you refresh the browser or use the
back button on the browser.
Default: the option is not selected (the browser will retain data and use it during POST request)
If you do not want the browser to use the information during the POST request made when you refresh the
browser or use the back button on the browser, select the checkbox.
Syntax
JavaScript: secureData
Lua: securedata
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.18 showMiniAppMenu
Default: false
The below image illustrates the default mode of an application menu of the Popup:
Mini
If you set the value to mini the application menu is minimized in the application.
The below image illustrates the Mini mode of an application menu of the Popup:
Syntax
JavaScript: showMiniAppMenu
Lua: showminiappmenu
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.19 submitSecure
Specifies if the information must be sent using secure connection (https) or insecure connection (http).
This property is useful in scenarios where you want the information sent to be secure. For example, credit
card user credentials, transactions etc.
Default: false (the checkbox is not selected and the information sent is not secure)
To send information securely, set the value to true (select the checkbox).
Note: If you have marked all the Forms to be submitted through a secure protocol, then the popup must also
be secured.
Syntax
JavaScript: submitSecure
Lua: submitsecure
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.20 titleBarConfig
Specifies the configuration properties for title bar for Desktop Web platform.
minIcon: Represents the URL of the icon to be used for displaying the minimize option for the popup window.
The default icon is "-".
Type: String
maxIcon: Represents the URL of the icon to be used for displaying the maximize option for the popup
window. The default icon is "+".
Type: String
closeIcon: Represents the URL of the icon to be used to close the popup window. The default icon is "X".
Type: String
Type: String
template: Specifies the template for the browser window there the developer can arrange the images and the
titles.
Syntax
JavaScript: titleBarConfig
Type
JavaScript:JSObject
Read / Write
JavaScript Example
Yes
Platform Availability
9.3.21 viewConfig
Note: For more information on applying the Grid layout please refer Kony Studio User Guide.
l Normal view
l Grid view
The type of view will be determined by the Reference Width and Reference Height of the view config property,
if reference height and width are greater than 0, then view set is grid view.
For example, if you set an onClick to a box, the onClick event will be executed whenever you click each cell.
Set righttap event using setGestureRecognizer to a box and you can see right click behavior on each cell of
grid view.
Default application displays 0,you can give any number greater than 0 to get grid view type of a widget.
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript:JSObject
Lua: Table
Read / Write
No
JavaScript Example
Yes
Platform Availability
9.3.22 windowSoftInputMode
This property defines how the main Popup interacts with the window containing the on-screen soft keyboard.
It determines the adjustments made to the Popup whether it is resized smaller to make room for the soft
keyboard or whether its contents pan to make the current focus visible when part of the Popup is covered by
the soft keyboard.
Default: POPUP_ADJUST_RESIZE
l POPUP_ADJUST_RESIZE: Specifies the popup is resized and when you click or start typing within
the widget which requires an input, the popup scrolls up and the widget which requires an input is not
overlapped by the keypad or footer.
l POPUP_ADJUST_PAN: Specifies the widget which requires an input is placed at the bottom of the
popup is overlapped by the keypad. The main Popup is not resized to make room for the soft keyboard.
Rather, the contents of the Popup are automatically panned so that the current focus is never obscured
by the keyboard and users can always see what they are typing. This is generally less desirable than
resizing, because the user may need to close the soft keyboard to get at and interact with obscured
parts of the Popup.
Syntax
JavaScript: windowSoftInputMode
Lua: windowsoftinputmode
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l addWidgets
l init
l onHide
l onDeviceBack
l onLoadJS
l unLoadJS
9.4.1 addWidgets
An event callback invoked by the platform when show method of popup is called for first time after its
construction. This is called only once in a lifetime of the popup between creation and destruction. This method
is also called when destroyed popup is shown again. Popups can be destroyed using destroy method.
Signature
JavaScript: addWidgets(popupref)
Lua: addwidgets(popupref)
Read / Write
JavaScript Example
Platform Availability
9.4.2 init
This event gets called only once in popup life cycle that is when the popup is ready with its widget hierarchy.
This will get called after addwidgets method allowing user for any one-time initializations.
When popup is destroyed and reused again, init gets called as a part of popup lifecycle.
Signature
JavaScript: init(popupref)
Lua: init(popupref)
Read / Write
JavaScript Example
Platform Availability
9.4.3 onHide
JavaScript: onHide(popupref)
Lua: onhide(popupref)
Read / Write
JavaScript Example
function onHideCallBck(popup)
{
//Write your logic here
}
Platform Availability
9.4.4 onDeviceBack
Specifies an event which is triggered when the user uses the back button on the device.
For more information see Event Editor in the Kony Studio User Guide.
Signature
JavaScript: onDeviceBack(popupref)
Lua: ondeviceback(popupref)
Read / Write
JavaScript Example
Platform Availability
l Android/Android Tablet
l BlackBerry
9.4.5 onLoadJS
Specifies the name of function to be executed when a popup is loaded. The function must exist in a
JavaScript file under project>module>js folder.
Syntax
JavaScript: onLoadJS
Lua: onloadjs
Read / Write
JavaScript Example
alert("popUp onLoadJS::"+popUp.onLoadJS);
Yes
Platform Availability
9.4.6 unLoadJS
Specifies the name of function to be executed when a popup is unloaded. The function must exist in a
JavaScript file under project>module>js folder.
Syntax
JavaScript: unLoadJS
Lua: unloadjs
Read / Write
JavaScript Example
Yes
Platform Availability
l add
l addAt
l destroy
l dismiss
l navigateTo
l remove
l removeAt
l scrollToBeginning
l scrollToEnd
l scrollToWidget
l setContext
l setTitleBarLeftSideButtonSkin
l setTitleBarRightSideButtonSkin
l setTitleBarSkin
l showTitleBar
l hideTitleBar
l show
l widgets
9.5.1 add
This method is used to add widgets to the Popup. When the widgets are added to the current visible Popup,
then the changes will reflect immediately. Adding a widget to the Popup or Box hierarchy, which is already a
part of the other widget hierarchy, will lead to undefined behaviors. You have to explicitly remove the widget
from one hierarchy before adding it to another Popup or Box.
Signature
JavaScript: add(widgets)
Input Parameters
widgets - Mandatory
Comma separated list of widgets.
Return Values
None
Exceptions
WidgetError
JavaScript Example
//Adding a label and a button widgets to the popUp. Here label and button
widgets should be created already and made accessible.
popUp.add(lbl,btn);
Platform Availability
9.5.2 addAt
This method is used to add widgets to the Popup container at the specified index. Widget is prepended if index
<0 and appended at the end of the container if the index > size+1. Size is the number of widgets already
present in the container. If a new widget is added or removed will reflect immediately from the Popup hierarchy
model perspective, however the changes are displayed when the Popup appears. When the widgets are
added to the current visible Popup, then the changes will reflect immediately. Adding a widget to the Popup or
Box hierarchy, which is already a part of the other widget hierarchy, will lead to undefined behaviors. You have
to explicitly remove the widget from one hierarchy before adding it to another Popup or Box.
Signature
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
//Adding label to the popUp at 15th index Position. Label should be created
already and made accessible .
popUp.addAt(lbl,15);
Platform Availability
9.5.3 destroy
This method is used to destroy any unwanted Popups at any point in time, and allows increasing the
application life by reducing the memory usage.
Signature
JavaScript: destroy()
Lua: popup.destroy(popupname)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.4 dismiss
This method is used to dismiss the popup on which this method is called.
Signature
JavaScript: dismiss()
Lua: popup.dismiss(popupname)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.5 navigateTo
This method is used to navigate from one popup to other popup. The popup on which this method is called
remains displayed while the content of the popup changes from current popup to given popup.
Note: This method is applicable only when the popupStyle is set as POPUP_TYPE_NATIVE_STYLE.
Signature
Input Parameters
config[UserData] - optional
For future releases. Not configurable as of now.
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.6 remove
This method removes a widget from the Popup container. If a new widget is removed will reflect immediately
from the Popup hierarchy model perspective, however the changes are displayed when the Popup appears.
When the widgets are added to the current visible Popup, then the changes will reflect immediately.
Signature
JavaScript: remove(widgetref)
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
//Removing label ,button widgets to the popUp. Here label and button
Platform Availability
9.5.7 removeAt
This method removes a widget at the given index from the Popup container. If a new widget is removed will
reflect immediately from the Popup hierarchy model perspective, however the changes are displayed when
the Popup appears. When the widgets are added to the current visible Popup, then the changes will reflect
immediately.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
JavaScript: removeAt(index)
Input Parameters
Return Values
Exceptions
WidgetError
JavaScript Example
Platform Availability
9.5.8 scrollToBeginning
This method gives you the control to scroll to the beginning of the Popup.
Signature
JavaScript: scrollToBeginning()
Lua: popup.scrolltobeginning(popupname)
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
9.5.9 scrollToEnd
This method gives you the control to scroll to the end of the Popup.
Signature
JavaScript: scrollToEnd()
Lua: popup.scrolltoend(popupname)
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
9.5.10 scrollToWidget
This method gives you the control to scroll the widget in the Popup.
Signature
JavaScript: scrollToWidget()
Lua: popup.scrolltowidget(popupname)
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Example
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
9.5.11 setContext
Specifies the popup that must be displayed for the context and also helps you to position the popup on the
screen. The popup can be positioned relative to a widget on the screen and setcontext enables you to do that.
The context contains information regarding the widget for which the popup must be shown and also the
anchoring of the popup on the widget (left, right, center, top, or bottom).
Additionally for the iPhone platform, you can choose to specify the sizetoanchorwidth, a boolean property. If
you set the value to true, the popup width is made equal to the width of the anchor. If the value is false (default
value), the popup takes the width allocated in the popup properties.
Signature
JavaScript: setContext(context)
Input Parameters
Specifies if the width of the popup has to be the same as that of the widget relative to
which it has been anchored.
It is a set of flags that are used to anchor the popup with respect to the dimensions of
the widget. Possible values are ("top", "bottom", "right", "left"). Additionally
native popupover style (POPUP_TYPE_NATIVE_STYLE) on iPad supports "any".
When you set this property, the popup is anchored to the best possible position
around another widget.
Reference to an existing widget with respect to which the Popup has to be anchored
(Pass the Formid if the popup is to be positioned with respect to a Form. This Form is
assumed to be the form on which the popup will be overlaid).
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, and Server side Mobile Web platforms
9.5.12 setTitleBarLeftSideButtonSkin
This method enables you to set the properties for a left-side button of a titlebar.
Signature
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.13 setTitleBarRightSideButtonSkin
This method enables you to set the properties for a right-side button of a titlebar.
Signature
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.14 setTitleBarSkin
This method enables you to set the skin for a titlebar of a popup.
Signature
JavaScript: setTitleBarSkin(skin)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.15 showTitleBar
This method gives you the control to show a titlebar within a popup.
Signature
JavaScript: showTitleBar()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.16 hideTitleBar
This method gives you the control to hide a titlebar within a popup.
Signature
JavaScript: hideTitleBar()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
9.5.17 show
Signature
JavaScript: show()
Lua: popup.show(popupname)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
This method is available on iPhone/iPad, BlackBerry 10, and Windows Kiosk platforms.
9.5.18 widgets
Returns an array of the widget references which are direct children of the popup.
Signature
JavaScript: widgets()
Lua: popup.widgets(popupname)
Input Parameters
Return Values
This method returns Read only array of widget references. Modifying the array and changing the position
of widgets in this array doesn't reflect in the Form hierarchy, however you can get handle to the widgets
through this array and modify the widgets through widget level methods as exposed by individual
widgets.
Exceptions
WidgetError
JavaScript Example
//Collecting all the widgets of the PopUp into array and displaying the re
ferences.
wigArr = popUp.widgets();
alert("Widgets are::"+wigArr);
Platform Availability
l closureLeftSideView
l closureRightSideView
l defaulttransition
l dockableAppMenu
l formanimation
l formtransition
l imageLeftSideView
l imageRightSideView
l inTransitKey
l inTransitMode
l nift
l onOrientationChange
l orientationmode
l outTransitKey
l outTransitMode
l renderTitleText
l Reset_Focus_to_top_of_the_Form
l Skin_Around_Popup
l titleBar
l titleBarLeftSideView
l titleBarRightSideView
l transition
l transitionDirection
l transitionEffect
9.6.1 closureLeftSideView
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.2 closureRightSideView
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.3 dockableAppMenu
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.4 imageLeftSideView
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.5 imageRightSideView
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.6 nift
Type
Boolean
Read / Write
No
Yes
Platform Availability
l Black Berry
l Windows Phone
9.6.7 onOrientationChange
Specifies an Event which is triggered when there is a change in orientation of the Popup from portrait to
landscape or vice versa.
For more information see Event Editor in the Kony Studio User Guide.
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.8 orientationmode
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.9 renderTitleText
Type
Boolean
Read / Write
No
Yes
Platform Availability
Type
Boolean
Read / Write
No
Yes
Platform Availability
This is a skin property. This property specifies the skin that must be applied around a popup.
Type
Object
Read / Write
No
Yes
Platform Availability
l Black Berry
l J2ME
9.6.12 titleBar
Type
Boolean
Read / Write
No
Yes
Platform Availability
l iPhone/iPad
l Android
9.6.13 titleBarLeftSideView
Type
Boolean
Read / Write
No
Yes
Platform Availability
9.6.14 titleBarRightSideView
Type
Boolean
Read / Write
No
Yes
Platform Availability
l Button
l Calendar
l CheckBoxGroup
l ComboBox
l DataGrid
l Image
l Label
l Line
l Link
l ListBox
l MenuContainer
l MenuItem
l RadioButtonGroup
l RichText
l Slider
l TextArea
l TextBox
11. Button
A Button is a control that you can use to provide input to an application or trigger an event. For example,
navigating to a form, interacting with a dialog box, or confirming an action.
A button can display either a text with a background color, text with a background image, or just an image.
Button provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
and Events.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight blockedUISkin
id contentAlignment contextMenu
info displayText externalURL
isVisible hExpand glowEffect
rawBytes margin hoverSkin
skin marginInPixel pressedSkin
text padding showProgressIndicator
paddingInPixel submitURL
vExpand toolTip
widgetAlignment
Events Deprecated
onClick focusimage
preOnclickJS image
postOnclickJS normalimage
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
//The below function is the callback function for onClick event call.
function onClickCallBack()
{
//Write your logic here.
}
Platform Appearance
iPhone
Android
BlackBerry
Windows Phone
Platform Appearance
1. From the IDE, drag and drop the button widget onto a form (occupies the complete available width). Or,
based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the button in the horizontal direction, place an HBox on the Form
and drag and drop the button inside the HBox and resize accordingly (you can also
choose to place multiple buttons in the Box). Now apply hExpand property to expand the
button in horizontal direction.
b. If you want to resize the button in the vertical direction, place an HBox on the Form and
place a VBox inside the HBox; and drag-and-drop the button inside the VBox and resize
accordingly (you can also choose to place multiple buttons in the VBox). Now apply
vExpand property to expand the button in vertical direction.
2. Use the text property and specify the text to be displayed on the button.
3. Define an onClick event.
Customizing Appearance
You can customize the appearance of the button by using the following properties:
Important Considerations
l You can specify a background image for a Button. You can set the image from the Button skin for both
normal and focus skins.
l To avoid jumping effect or to avoid overlap of neighboring widgets, you must ensure that the image for
normal and focus skins are of the same size.
l focusSkin
l id
l info
l isVisible
l rawBytes
l skin
l text
l toolTip
11.1.1 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
11.1.2 id
id is a unique identifier of button consisting of alpha numeric characters. Every Button should have a unique id
within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
11.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
11.1.4 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the Visibility of the widget is controlled by the data property of the segment.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
11.1.5 rawBytes
Specifies the rawbytes representing an Image (usually the image captured from the camera) that can be used
as a background for the button. You cannot assign rawBytes directly to a button widget. The rawBytes has to
be assigned to an Image widget or Button widget that has image skin.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: rawBytes
Lua: rawbytes
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web and SPA
11.1.6 skin
Specifies the look and feel of the Button when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
11.1.7 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l contentAlignment
l displayText
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
11.2.1 containerWeight
Specifies the percentage of the parent width that should allocated to the widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
width except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
11.2.2 contentAlignment
Specifies the alignment of the text on the Button with respect to its boundaries. A default value CONTENT_
ALIGN_CENTER is assigned for all platforms. To choose another alignment, click the drop-down arrow and
select the desired alignment. However, to change the default value on a particular platform, select the button
next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_CENTER (the default value for all platforms is center; content is aligned at the
center of the button)
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the button.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the button.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the button.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the button.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the button.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the button.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the button.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
button.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the button.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
11.2.3 displayText
Default: true
Syntax
JavaScript: displayText
Lua: displaytext
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
11.2.4 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Mobile Web, Desktop Web, and SPA.
11.2.5 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
11.2.6 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
11.2.7 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10.
11.2.8 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
11.2.9 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
If set to false, the widget occupies the preferred height. The preferred height of a widget is the sum of its
contents height, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, BlackBerry 10, and Desktop Web platforms.
11.2.10 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT - (BlackBerry 10 supports this option)
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l blockedUISkin
l contextMenu
l externalURL
l glowEffect
l hoverSkin
l pressedSkin
l showProgressIndicator
l submitURL
l tooltip
11.3.1 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
var btnPSP={blockedUISkin:"blkUISkin"};
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
11.3.2 contextMenu
A context menu is a menu that appears upon clicking a button. A context menu typically offers a limited set of
choices that are applicable for that button. Usually these choices are actions, related to the button.
If you define a context menu for a button, the steps involved to invoke the context menu on a platform and the
appearance of the context menu varies.
In Desktop Web, on right-click mouse the context specific menu will be displayed with the array of menu
items.
l You can invoke the context menu either by clicking on the widget (applicable only on BlackBerry
versions 6.x and above) or by a long press on the screen (or trackpad).
l You can choose to add icons to indicate the menu items in the context menu (applicable only on
BlackBerry versions 6.x and above).
l BlackBerry layouts menu items in a 3 item grid view. The menu items Switch Application, Help, Close,
and Full Menu are added automatically based on the number of menu items added in the context menu.
For example, If you add a context menu with 2 items, it will display Full Menu item along with the items
added. If you add a context menu with 3 items, it will display Full Menu, Help, Switch Application items
along with the items added.
l If the focus is on a widget that has a context menu; and if you click the "menu key", the Full Menu
appears along with the context menu items.
l On Blackberry Non-Touch Devices, only Full Menu item is displayed irrespective of number of items
added in the context menu.
Note: The context menu items in the Full Menu will disappear if the focus is shifted from the widget which
has the context menu.
The following images illustrate the context menu on various BlackBerry devices:
l You can invoke the context menu by a long press on the widget.
l The menu items are displayed as text (no support for icons).
l There is no support for sub-menus in a context menu.
The following image illustrates the context menu on Android platform:
Syntax
JavaScript: contextMenu
Lua: contextmenu
Type
JavaScript: Array(kony.ui.MenuItem)
Lua: Table
Read / Write
JavaScript Example
Note: On Android platform, the image icon, separator, and submenu properties are not supported.
No
Platform Availability
l Android/Android Tablet
l BlackBerry
l Windows Tablet
11.3.3 externalURL
Specifies that the URL must be opened directly from the web site without having to contact the Kony Server.
For example, in a Banking Application, for Terms and Conditions section, you can provide an external URL
which will open the required section in a new window rather than opening the section in the same window.
Note: If you specify an External URL, the URL opens in a new window.
Syntax
JavaScript: externalURL
Lua: externalurl
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
11.3.4 glowEffect
Specifies if there must be glow effect when you touch the button.
Default: false
Note: The glow appears on the button only for a moment on touch and disappears.
The following image illustrates a button with and without the glow effect:
Syntax
JavaScript: glowEffect
Lua: gloweffect
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
11.3.5 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
11.3.6 pressedSkin
Syntax
JavaScript: pressedSkin
Lua: pressedskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
11.3.7 showProgressIndicator
Specifies if the progress indicator must be displayed when the button is clicked. This is typically set to true, if
it is known at design time that the button onClick event handling is going to trigger a long running call.
Default: true
Syntax
JavaScript: showProgressIndicator
Lua: showprogressindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Server side Mobile Web (basic)
11.3.8 submitURL
Specifies the URL to which the current Form data should be submitted, without contacting Kony Server. This
is typically required when the data collection is done using Kony Studio Form but is actually posted to a third-
party site.
Default: false
If set to false, then the URL is submitted contacting the Kony Server.
If set to true, then the URL is submitted without contacting the Kony Server.
For example, for an application that requires the user to provide confidential data, you can route the data
directly to the server of the website without contacting the Kony Server using the externalURL property. Doing
so, opens the resultant site in the same window rather than opening it in a new window.
Syntax
JavaScript: submitURL
Lua: submiturl
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
11.3.9 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
l onClick
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
11.4.1 onClick
An event callback is invoked by the platform when the user performs a click action on the button.
Signature
JavaScript: onClick
Lua: onclick
The onClick event callback accepts additional parameters when a button is placed in a segment row or
section template.
Signature
Input Parameters
Read / Write
JavaScript Example
//The below function is the callback function for onClick event call.
function onClickCallBack(button)
{
//Write your logic here.
}
Yes
Platform Availability
11.4.2 preOnclickJS
This event allows the developer to execute custom JavaScript function before the onClick callback of the
widget is invoked. This is applicable only for Mobile Web channel. The function must exist in a JavaScript file
under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
//The below function is the callback function for preOnclickJS event call.
function preOnclickJSCalBck(button)
{
//Write your logic here.
}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
11.4.3 postOnclickJS
This event allows the developer to execute custom JavaScript function after the onClick callback of the
widget is invoked. This is applicable only for Mobile Web channel. The function must exist in a JavaScript file
under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
//The below function is the callback function for postOnclickJS event call.
function postOnclickJSCalBck(button)
{
//Write your logic here.
}
Yes
Platform Availability
l focusimage
l image
l normalimage
11.5.1 focusimage
This is a skin property and it determines the look and feel of the button when there is focus.
You can also choose to specify a background focus image for the button.
Type
Object
Read / Write
Yes
Platform Availability
11.5.2 image
Type
Object
Read / Write
Yes
Platform Availability
11.5.3 normalimage
This is a skin property and it determines the look and feel of the button when the button is not focussed.
Type
Object
Read / Write
Yes
Platform Availability
12. Calendar
Calendar widget allows you to select a date from a graphical calendar. The calendar widget appears as a label
with a small calendar icon (icon does not appear on Mobile Web platforms) and displays the date or the date
format specified by you. You can interact with the calendar widget by clicking on it.
Note: When the native calendar view is used the individual dates cannot be set as enabled or disabled using
the setEnable API. Also the user cannot be restricted to dates only within the validStartDate and
validEndDate range.
When the calendar widget is clicked, a grid like calendar widget is displayed (The appearance is not the same
on all platforms. For exact appearance, see UI Behavior). The grid like calendar allows you to select a single
date and move back-and-forth between months and years.
Calendar provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
Events, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
calenderIcon containerWeight cellTemplate
dateComponents contentAlignment containerHeight
dateFormat hExpand containerHeightReference
day margin dateEditable
focusSkin marginInPixel data
formattedDate padding dayTextAlignmentInCell
hour paddingInPixel displayedMonth
id vExpand hideDaysHeader
info widgetAlignment hideMonthsHeader
isVisible hoverSkin
minutes mode
month noOfMonths
placeholder titleOnPopup
seconds toolTip
skin widgetDataMapForCell
validStartDate wheelBackgroundColor
validEndDate
viewConfig
viewType
year
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
Platform Appearance
Android
BlackBerry
iPhone
Windows Phone
UI Behavior
When you click a calendar widget, the UI behavior is not the same on all the platforms.
Platform UI Behavior
Android
BlackBerry
Platform UI Behavior
iPhone
Windows Phone
Platform UI Behavior
1. From the IDE, drag and drop the calendar widget onto a form (occupies the complete available width).
Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the calendar widget in the horizontal direction, place an HBox on the
Form and drag and drop the calendar widget inside the HBox and resize accordingly.
b. If you want to resize the calendar widget in the vertical direction, place an HBox on the
Form and place a VBox inside the HBox; and drag and drop the calendar widget inside
the VBox and resize accordingly.
2. (Optional) Use the dateComponents property to specify the default date that must appear in the Date
field.
3. Use the dateFormat property to specify the date format.
Customizing Appearance
You can customize the appearance of the calendar widget by using the following properties:
Important Considerations
The Calendar widget has the following important considerations for Mobile Web:
l calendarIcon
l dateComponents
l dateFormat
l day
l focusSkin
l formattedDate
l hour
l id
l info
l isVisible
l minutes
l month
l placeholder
l seconds
l skin
l validStartDate
l validEndDate
l viewConfig
l viewType
l year
12.1.1 calendarIcon
Replaces the system default calendar icon. It is applicable only when the viewType is set as CALENDAR_
VIEW_TYPE_GRID_POPUP.
Syntax
JavaScript: calendarIcon
Lua: calendaricon
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone, Windows Tablet, and BlackBerry 10.
12.1.2 dateComponents
Specifies the default date that must appear in the Date field. The value should be an array object with six
elements in [dd, mm, yyyy, hh, mm, ss] format.
If a platform or the particular calendar view doesn't support the user to set the hh, mm, ss then they always
are set 00:00:00 by default irrespective of what developer sets. Individual platforms need to cross check this
per view basis and add it to the final documentation.
1. Click the Ellipsis ( ) button against the Date property. The following popup appears:
2. Clear the Set date and time to 'NONE' option. The following popup appears:
3. Select the require date and time (optional and applicable only for iPhone). Click OK.
The selected date will appear in the calendar when rendered.
Syntax
JavaScript: dateComponents
Lua: datecomponents
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.3 dateFormat
The date format in which the selected date must appear on the display and when accessed programmatically
the "date" property.
l MM/dd/yyyy
l dd/MM/yyyy (default)
l MM/dd/yy
Note: Above are the date formats that will be shown in IDE, but developer can pass the format as any one of
the Unicode supported Date Formats.
For list of standard characters and formats, please see the following link.
http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
Syntax
JavaScript: dateFormat
Lua: dateformat
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.4 day
Syntax
JavaScript: day
Lua: day
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.5 focusSkin
This is a skin property and it determines the look and feel when there is focus on a widget.
For more information on how to create and work with skins, see the Working with Applications section of the
Kony Studio User Guide.
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Mobile Web, BlackBerry 10, and Windows Kiosk
12.1.6 formattedDate
Currently selected data as String the format that is set through "dateFormat" property.
Syntax
JavaScript: formattedDate
Lua: formatteddate
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.7 hour
Syntax
JavaScript: hour
Lua: hour
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone, BlackBerry 10, and Windows Kiosk platform.
12.1.8 id
Defines a string of alpha numeric characters that uniquely identifies a calendar widget within an application.
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.9 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
12.1.10 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Platform Availability
12.1.11 minutes
Syntax
JavaScript: minutes
Lua: minutes
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango), BlackBerry 10, and Windows Kiosk platform.
12.1.12 month
Syntax
JavaScript: month
Lua: month
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.13 placeholder
Specifies the temporary or substitute text that must be displayed until a date is selected.
For example, you can display the placeholder text on the calendar widget as "Enter your date of travel", until
the user clicks the calendar widget and selects a date.
Syntax
JavaScript: placeholder
Lua: placeholder
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango) ( IE9 version), Windows Kiosk, BlackBerry
10, and on Server side Mobile Web (WindowsNTH, Basic, and BJS)
12.1.14 seconds
Syntax
JavaScript: seconds
Lua: seconds
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
calPSPConf);
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango), BlackBerry 10, and Windows Kiosk
platforms.
12.1.15 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.16 validStartDate
Array representing the day, month and year portions of the date in the same order. The valid start date,
accepts Array of [dd, mm, yyyy, hh, mm, ss]
If a platform or the particular calendar view doesn't support the user to set the hh,mm,ss then they always are
set 00:00:00 by default irrespective of what developer sets. Individual platforms need to cross check this per
view basis and add it to the final documentation.
For backward compatibility atleast three elements [dd,mm,yyyy] are mandatory from all the six elements.
Syntax
JavaScript: validStartDate
Lua: validstartdate
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
calPSPConf);
Yes
Platform Availability
12.1.17 validEndDate
Array representing the day, month and year portions of the date in the same order. The valid end date, accepts
Array of [dd, mm, yyyy, hh,mm,ss]
If a platform or the particular calendar view doesn't support the user to set the hh,mm,ss then they always are
set 00:00:00 by default irrespective of what developer sets. Individual platforms need to cross check this per
view basis and add it to the final documentation.
For backward compatibility atleast three elements [dd,mm,yyyy] are mandatory from all the six elements.
Syntax
JavaScript: validEndDate
Lua: validenddate
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.18 viewConfig
The view configuration for different viewtypes. Each view will have a key representing the view name and the
value being the hash of key, value configurations.
Note: For iOS platform, the option "allowWeekendSelectable" is not applicable when the calendar view
type is set as wheelCalendar.
l CALENDAR_VIEW_TYPE_ GRID_ONSCREEN
l CALENDAR_VIEW_TYPE_ GRID_POPUP
The possible keys are defined below:
"leftNavigationImage" - The image to be set on the button that moves calendar to previous month
"rightNavigationImage" - The image to be set on the button that moves calendar to next month
"allowWeekendSelectable" - The Boolean flag to disable or enable the weekend days. If the value is false
i.e., disabled, then gridCellInactiveDaysSkin is applied.
"doneButtonSkin" - The skin to be applied on the Done button that appear on a calendar popup, which ever
platform done button is applicable. It is not supported on Windows Phone (Mango) platform.
"cancelButtonSkin" - The skin to be applied on a Cancel button that appear on a calendar popup, which ever
platform cancel button is applicable. It is not supported on Windows Phone (Mango) platform.
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.19 viewType
Note: On Android and BlackBerry platforms, when the viewType is set as CALENDAR_VIEW_TYPE_
DEFAULT, the user cannot be restricted to select the dates within the validStartDate and validEndDate.
The below table shows the list of view types and their availability in different platforms:
SPA
Android / Server side Server side /Desktop
Windows
viewType iOS BlackBe Mobile Web Mobile Web Web
Phone
rry (BJS) (Advanced) /Windows
Kiosk
CALENDAR_VIEW_TYPE_DEFAULT Yes Yes Yes* Yes* Yes* Yes *
CALENDAR_VIEW_TYPE_GRID_
ONSCREEN
Yes Yes Yes No No No
CALENDAR_VIEW_TYPE_GRID_POPUP Yes Yes* Yes No Yes Yes
SPA
Android / Server side Server side /Desktop
Windows
viewType iOS BlackBe Mobile Web Mobile Web Web
Phone
rry (BJS) (Advanced) /Windows
Kiosk
CALENDAR_VIEW_TYPE_WHEEL_
ONSCREEN
Yes No No No No No
CALENDAR_VIEW_TYPE_WHEEL_
POPUP Yes* No No No No No
CALENDAR_VIEW_TYPE_LISTBOXES_
ONSCREEN
No No No Yes Yes No
CALENDAR_VIEW_TYPE_LISTBOXES_
POPUP
No No No No No No
CALENDAR_VIEW_TYPE_METRO No No Yes No No No
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
12.1.20 year
Syntax
JavaScript: year
Lua: year
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
12.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
12.2.2 contentAlignment
Specifies the alignment of the text on the Calendar with respect to its boundaries. A default value CONTENT_
ALIGN_CENTER is assigned for all platforms. To choose another alignment, click the drop-down arrow and
select the desired alignment. However, to change the default value on a particular platform, select the button
next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_CENTER (the default value for all platforms is center; content is aligned at the
center of the Calendar)
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the Calendar.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the Calendar.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the Calendar.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the Calendar.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the Calendar.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the Calendar.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the Calendar.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
Calendar.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the Calendar.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (Blackberry BJS device) and BlackBerry 10
platforms.
12.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
calPSPConf);
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and SPA.
12.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
12.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
12.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform. Padding is not supported by Windows Mobile browser for Box and Image Gallery.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10.
12.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
12.2.8 vExpand
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms. On BlackBerry
platform, this property is not supported if the view mode is set as CALENDAR_VIEW_TYPE_WHEEL_
ONSCREEN.
12.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l cellTemplate
l containerHeight
l containerHeightReference
l dateEditable
l data
l dayTextAlignmentInCell
l displayedMonth
l hideDaysHeader
l hideMonthsHeader
l hoverSkin
l mode
l noOfMonths
l titleOnPopup
l toolTip
l widgetDataMapForCell
l wheelBackgroundColor
12.3.1 cellTemplate
Default: None
l HBox
l VBox
l Label
l Button
l Image
Syntax
JavaScript: cellTemplate
Type
Read / Write
JavaScript Example
alert("Calendar cellTemplate::"+Calendar.cellTemplate);
Yes
Platform Availability
l iOS
l Android/Android Tablet
12.3.2 containerHeight
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
12.3.3 containerHeightReference
Default: HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
12.3.4 dateEditable
This property determines whether the calendar date must be entered in the calendar textbox. Normally a user
can enter date by choosing the date icon or entering the date in the textbox. Set this property to false, to avoid
user from entering the date in textbox and allow the user to select the date only through icon.
Default: true
Syntax
JavaScript: dateEditable
Type
JavaScript: Boolean
Read / Write
JavaScript Example
No
Platform Availability
12.3.5 data
var data1 = {
"12/11/2012":{
template:newBox,
lblAppointments:"4",
lblTasks:"2"
},
"02/01/2012":{
"lblAppointments":"4",
"lblTasks":"21"
}
}
frmHome.mycal.setData(data1);
1. Click the Ellipsis ( ) button against the cellTemplate property. The Select/Search gridCalendars
window appears.
2. Select the template and click OK. The template is now assigned to a calendar.
3. Click the Ellipsis ( ) button against the data property.The Master Data for GridCalendar window
appears.
4. Click button to add a row and select the Date and then update Template Data.
5. Click OK.
Syntax
JavaScript: data
Type
JavaScript: JSObject
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Android/Android Tablet
12.3.6 dayTextAlignmentInCell
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the Calendar Day
cell.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the Calendar Day
cell.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the Calendar Day cell.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the Calendar Day
cell.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the Calendar Day cell.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the Calendar
Day cell.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the Calendar
Day cell.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
Calendar Day cell.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the Calendar
Day cell.
Syntax
JavaScript: dayTextAlignmentInCell
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Android/Android Tablet
12.3.7 displayedMonth
Default: The default value is as defined in dateComponents and get modified each time when the date is
changed in dateComponents.
Note: The property displayedMonth takes precedence over the dataComponents when both are specified
during the construction of the widget.
Note: Modifying the displayedMonth will not have any influence on dateComponent property.
Syntax
JavaScript: displayedMonth
Type
Read / Write
JavaScript Example
No
Platform Availability
l iOS
l Android/Android Tablet
12.3.8 hideDaysHeader
Default: false
If set to true, the weekdays are hidden and are not displayed.
Syntax
JavaScript: hideDaysHeader
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Android/Android Tablet
12.3.9 hideMonthsHeader
Default: false
If set to true, the months header is hidden and the navigation buttons are not displayed.
Syntax
JavaScript: hideMonthsHeader
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Android/Android Tablet
12.3.10 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Yes
Platform Availability
12.3.11 mode
Syntax
JavaScript: mode
Lua: mode
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
12.3.12 noOfMonths
Specifies the number between 1 and 12 which indicates the number of months to be displayed when the
calendar is selected. It is supported only on Desktop Web platform.
Syntax
JavaScript: noOfMonths
Type
JavaScript: Number
Read / Write
JavaScript Example
placeholder:"JSCalendar", calendarIcon:"cal.png"};
var calLayoutConf = {padding : [2,2,2,2], margin:[5,5,5,5], widgetAlignmen
t:constants.WIDGET_ALIGN_TOP_RIGHT, containerWeight:100, hExpand:true,vExp
and:true};
var calPSPConf = {titleOnPopup:"CalenderPopUpTitle", mode:constants.CALEDE
R_WHEEL_ONLY_TIME, noOfMonths:5};
Yes
Platform Availability
12.3.13 titleOnPopup
Syntax
JavaScript: titleOnPopup
Lua: titleonpopup
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
placeholder:"JSCalendar", calendarIcon:"cal.png"};
var calLayoutConf = {padding : [2,2,2,2], margin:[5,5,5,5], widgetAlignmen
t:constants.WIDGET_ALIGN_TOP_RIGHT, containerWeight:100, hExpand:true,vExp
and:true};
var calPSPConf = {titleOnPopup:"Calender PopUp Title"};
Yes
Platform Availability
l Desktop Web
l SPA
l Server side Mobile Web (BJS and Advanced)
12.3.14 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
12.3.15 widgetDataMapForCell
Specifies the mapping information between the widget id's and the keys in the data.
Note: It is the developer responsibility to ensure that widget data map to accommodate all the widget ids
required including the widgets referred in dynamic templates.
{
widgetID1: "dataId1",
widgetId2: "dataId2",
widgetId3: "dataId3",
widgetId4: "secDataId1"
widgetId5: "secDataId2"
}
Syntax
JavaScript: widgetDataMapForCell
Type
Read / Write
JavaScript Example
No
Platform Availability
l iOS
l Android/Android Tablet
12.3.16 wheelBackgroundColor
Specifies the background color for the wheel that is displayed when you click the Calendar. This property is
applicable only when you set the viewType as CALENDAR_VIEW_TYPE_WHEEL_POPUP.
Syntax
JavaScript: wheelBackgroundColor
Type
JavaScript: JSObject
Read / Write
JavaScript Example
No
Platform Availability
l iPad
l iPhone
l onSelection
12.4.1 onSelection
Note: On Android platform, this event works only from Android OS version 4.0 and above.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
Platform Availability
l clear
l clearData
l enableRangeOfDates
l navigateToPreviousMonth
l navigateToNextMonth
l removeDataAt
l setData
l setDataAt
l setEnabled
l setEnableAll
l setDatesSkin
l setContext
l addAppointments
l deleteAppointments
l modifyAppointments
l getAppointments
l clearAppointments
l switchToDate
12.5.1 clear
This method allows you to enables you to clear the date in the calendar and the date format is shown. But
when you use a placeholder, then placeholder text is shown instead of date format.
Note: On BlackBerry10 platform, if you use this method, the date gets cleared and validStartDate is
displayed. If validStartDate is not set then current date is displayed.
Signature
JavaScript: clear()
Lua: calendar.clear(calwidget)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.2 clearData
This method allows you to remove the data that is set through setData method.
Signature
JavaScript: clearData()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android/Android Tablet
12.5.3 enableRangeOfDates
This method allows you to enable/disable the range of dates that fall between the startdate and enddate and
disables/enables the rest of the dates.
Note: On Windows Phone platform, this method is supported only when you set viewType as CALENDAR_
VIEW_TYPE_GRID_ONSCREEN or CALENDAR_VIEW_TYPE_GRID_POPUP.
Signature
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.4 navigateToPreviousMonth
This method allows you to navigate to previous month of the calendar widget.
Signature
JavaScript: navigateToPreviousMonth()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android/Android Tablet
12.5.5 navigateToNextMonth
This method allows you to navigate to next month of the calendar widget.
Signature
JavaScript: navigateToNextMonth()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android/Android Tablet
12.5.6 removeDataAt
Signature
JavaScript: removeDataAt("date" )
Input Parameters
date[String] - Mandatory
Specifies the date in a tabular format which follows {dd/mm/yyyy} convention.
Return Values
None
Exceptions
None
JavaScript Example
dateFormat:"dd/MM/yyyy", viewType:constants.CALENDAR_VIEW_TYPE_GRID_POPUP,
validStartDate:[01,01,2012], validEndDate:[31,12,2012], date:[31,12,2012],
placeholder:"JSCalendar", calendarIcon:"cal.png"};
var calLayoutConf = {containerWeight:100};
var calPSPConf = {};
Platform Availability
l iOS
l Android/Android Tablet
12.5.7 setData
This method allows you to set new data to the widgets as specified in the widgetDataMap.
var data1 = {
"12/11/2012":{
template:newBox,
lblAppointments:"4",
lblTasks:"2"
},
"02/01/2012":{
"lblAppointments":"4",
"lblTasks":"21"
}
}
frmHome.mycal.setData(data1);
Signature
JavaScript: setData(dictionary)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android/Android Tablet
12.5.8 setDataAt
This method allows you to set new data to the segment. When you set new data, the existing data will be
replaced with the new data. If the calendar has no data, the new data is placed in the calendar.
Signature
Input Parameters
date[String]- Mandatory
Specifies the dates in a table format which follows {dd/mm/yyyy} convention.
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
l iOS
l Android/Android Tablet
12.5.9 setEnabled
This method allows you to enable/disable a list of dates if the startdate and enddate are not set in the
calendar, then this API is used to enable/disable any date in the calendar.
This method clears the dates that have been enabled/disabled earlier and considers the dates used in the
method as the latest dates. When the enable flag is true, the dates passed in this method are enabled and
remaining dates between startdate and enddate are disabled. When the enable flag is false, the dates passed
in this method are disabled and remaining dates between startdate and enddate are enabled.
Signature
Input Parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.10 setEnableAll
This method allows you to enable all the dates that fall between the startdate and enddate. The look and feel
of the dates is configured by the cell skin.
Signature
JavaScript: setEnableAll()
Lua: calendar.setenableall(calwidget)
Input parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.11 setDatesSkin
This method allows you to set the skin and control the look and feel of each cell in the calendar. This API
works on all the dates of the calendar. The dates need not be between startdate and enddate.
Signature
Input parameters
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.12 setContext
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
JavaScript: setContext(context)
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.13 addAppointments
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.14 deleteAppointments
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
JavaScript: setContext(context)
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.15 modifyAppointments
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
JavaScript: setContext(context)
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.16 getAppointments
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
JavaScript: setContext(context)
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.17 clearAppointments
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
JavaScript: setContext(context)
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
Platform Availability
12.5.18 switchToDate
Specifies the calendar that must be displayed for the context and also helps you to position the calendar on
the screen. The calendar can be positioned relative to a widget on the screen and setcontext enables you to
do that.
The context contains information regarding the widget for which the calendar must be shown and also the
anchoring of the calendar on the widget (left, right, center, top, or bottom).
Signature
JavaScript: setContext(context)
Input Parameters
It is a set of flags that are used to anchor the calendar with respect to the dimensions
of the widget. Possible values are ("top", "bottom", "right", "left").
Return Values
None
Exceptions
None
JavaScript Example
calPSPConf);
Platform Availability
l date
l format
l monthI18Nkey
l weekdayI18Nkey
12.6.1 date
Specifies the default date that must appear in the Date field.
Default: No date is specified. The calendar will display the value set in the Format property.
1. Click the Ellipsis ( ) button against the Date property. The following popup appears:
2. Clear the Set date and time to NONE option. The following popup appears:
3. Select the require date and time (optional and applicable only for iPhone). Click OK.
The selected date will appear in the calendar when rendered.
Type
Object
Read / Write
To set the date as 24th February, 2011, in a calendar with id cal1, enter the following:
cal1.date = {24,02,2011}
Note: If you enter an invalid date, the calendar date will remain unchanged. The order of the digits
entered in the above code snippet is not dependent on the display format.
You can also read the day, month, and year set in the Date of the calendar cal1 by using the following:
Day:
Month
Year
Yes
Platform Availability
12.6.2 format
Specifies the format in which the date must appear. You can choose to display the date in one of the following
formats:
l dd/MM/yyyy (Default)
l MM/dd/yyyy
l MM/dd/yy
Note: If you clear the date set in the calendar using calendar.clear()API, the calendar label will display the
value set in the "Format" field and the date will be reset to nil. To clear the date of a calendar with id cal1 in a
Form frm1, enter the following:
calendar.clear(frm1.cal1);
Note: The calendar will display the value set in the "Format" field and the date will be reset to nil.
Type
String
Read / Write
No
Yes
Platform Availability
12.6.3 monthI18Nkey
Specifies the i18n key for a month. The i18n key for a month has to be specified in the Internationalization
dialog box. For more information refer the Kony Studio User Guide.
Type
String
Read / Write
No
Yes
Platform Availability
12.6.4 weekdayI18Nkey
Specifies the i18n key for a week. The i18n key for a weekday has to be specified in the Internationalization
dialog box. For more information refer the Kony Studio User Guide.
Type
String
Read / Write
No
Yes
Platform Availability
gridcalendar template enables you to define a template for Calendar Day cell. Only one template can be used
for each Calendar. This is primarily useful for developers to achieve custom look and feel of Calendar Day
cell. You can define a template using the following widgets:
l HBox
l VBox
l Button
l Image
l Label
gridcalendar templates are used to achieve custom look and feel of Calendar Day cell.
When you want the pre-designed information to be displayed for a Calendar Day cell in the application, you
have a provision to add a gridcalendar Template using KonyOne Studio. For more information about section
headers refer KonyOne Studio User Guide.
1. Go to Applications View.
2. Expand the application for which you want to create the gridcalendar Template.
3. Navigate to templates > gridcalendar , right-click mobile/tablet and select New GridCalendar
Template. The Create a New GridCalendar window appears.
Note: Only HBox is supported on the form. You can add other widgets within
this widgets.
iv. Drag and drop the required widgets onto the HBox. Set the properties of these widgets
and click Save.
v. A gridcalendar template is created.
You can define only one template for each calendar using the above process.
1. Go to Applications view.
2. Expand the application for which you want to use gridcalendar template.
3. Navigate to forms > mobile/tablet, right-click and select New Form. The Create a New Form
window appears.
4. Enter a name for the Form and click Finish. A new Form is created.
13. CheckBoxGroup
The CheckBoxGroup widget allows you to make one or more selections from a group of check boxes. If you
select a check box, a check mark appears inside the check box to indicate the selection.
You can use a CheckBoxGroup widget to provide a selection of choices in groups from which the user can
select one or more choices.
Note: To provide only a single selection option to the user, use a ComboBox widget or a RadioButtonGroup
widget.
CheckBoxGroup provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, and Events.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Events
onSelection
preOnclickJS
postOnclickJS
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
1. From the IDE, drag and drop the CheckBoxGroup widget onto a form (occupies the complete available
width). Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize a CheckBoxGroup widget in the horizontal direction, place an HBox
on the form and drag and drop the CheckBoxGroup widget inside the HBox and resize
accordingly.
b. If you want to resize a CheckBoxGroup widget in the vertical direction, place an HBox on
the form and place a VBox inside the HBox; and drag and drop the CheckBoxGroup
widget inside the VBox and resize accordingly.
2. Specify the values to be displayed in the CheckBoxGroup widget from the IDE by using the
masterData property or from code by using the masterDataMap property.
3. (Optional) If you set the values from the code, you can use the selectedKeys property to specify the
values to be displayed as selected.
4. (Optional) For programming purposes, if you want to find the values selected by a user, use the
selectedKeyValues property.
5. (Optional) The check boxes in the CheckBoxGroup widget are aligned vertically by default. You can
choose to align them horizontally (not applicable on iPhone and iPad) by using the itemOrientation
property.
6. (Optional) Define an onSelection event.
Customizing Appearance
You can customize the appearance of the CheckBoxGroup widget by using the following properties:
Important Considerations
The following are the important considerations for the CheckBoxGroup widget.
All Platforms
Android
l If you set the itemOrientation to horizontal, the given number of checkboxes should not
exceed the width of device screen. If they exceed, only the number of checkboxes equal
to the width of the device are displayed.
If the checkboxes on the screen do not have enough space available to align
themselves, then they may look distorted.
iPhone
l For non-touch devices, you can specify focus images for ticked and unTicked images.
Platform Appearance
Android
BlackBerry
iPhone
Windows Phone
Platform Appearance
l focusSkin
l id
l info
l isVisible
l masterData
l masterDataMap
l selected Keys
l selected KeyValues
l skin
13.1.1 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
13.1.2 id
id is a unique identifier of CheckBox consisting of alpha numeric characters. Every CheckBox should have a
unique id within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
13.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
13.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can also set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
13.1.5 masterData
Specifies the set of values that must be displayed for the user to make a selection from the available choices.
Default: User Defined (You must specify the key and the display value)
To specify the set of values, click the Ellipsis ( ) button against the property to open the MasterData for
CheckBox window.
In the Master Data window, you can specify the Key, Display Value, i18n Key, and the Accessibility Config.
You can use the Selected column to specify the choice to be shown as selected when rendered. You can do
this by selecting true against the choice that you wish to show as selected.
Note: Select the Use as test data in preview mode option if you want to see the data you enter in the Master
Data when you use the quick preview feature of the IDE. (For more information on Quick Preview, see the
Kony Studio User Guide.
Note: If the key or the display value is nil, the value will not be listed as one of the available choices.
Note: The accessibilityConfigObject is optional and the object should contain the keys as defined in the
accessibilityConfig property.
[
["key1","value1",accessibilityConfigObject],
["key2","value2",accessibilityConfigObject],......,
["keyn","valuen",accessibilityConfigObject]
]
Syntax
JavaScript: masterData
Lua: masterdata
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
13.1.6 masterDataMap
Specifies the set of values from which you can make one or more selections. You must set the values from
the code.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can always read and write data to it.
This property is applicable only if the masterData is not set. You must use either the masterData or the
masterDataMap to set data for the CheckBox.
You must specify a key, value, and the accessibilityConfig in a master data map.
Two","accessibilityConfig":acObject},...,
["mykey":"itemn","myvalue":"Item N","accessibilityConfig":"acObject}
],
"mykey",
"myvalue"
]
Note: The accessibilityConfig is the standard key expected in each items data array. It is optional and the
object should contain the keys as defined in the accessibilityConfig property.
Note: If the key or the value is null/nil, the value will not be listed as one of the available choices.
Syntax
JavaScript: masterDataMap
Lua: masterdatamap
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
13.1.7 selectedKeys
If you create a CheckBox with multiple values, you can choose to show specific values as selected when the
CheckBox is rendered.
Syntax
JavaScript: selectedKeys
Lua: selectedkeys
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
13.1.8 selectedKeyValues
Syntax
JavaScript: selectedKeyValues
Lua: selectedkeyvalues
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
13.1.9 skin
Specifies the look and feel of the CheckBox when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l itemOrientation
l margin
l marginInPixel
l padding
l paddingInPixel
l widgetAlignment
13.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
13.2.2 itemOrientation
l CHECKBOX_ITEM_ORIENTATION_VERTICAL (default)
l CHECKBOX_ITEM_ORIENTATION_HORIZONTAL. This option is not supported in BlackBerry 10
platform.
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: itemOrientation
Lua: itemorientation
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
13.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
13.2.4 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
13.2.5 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10
13.2.6 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
13.2.7 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l focusTickedImage
l focusUnTickedImage
l groupCells
l hoverSkin
l tickedImage
l toolTip
l unTickedImage
l viewType
l wheelBackgroundColor
13.3.1 focusTickedImage
Specifies the image to be displayed when you make a selection on non-touch devices.
Syntax
JavaScript: focusTickedImage
Lua: focustickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l BlackBerry
l J2ME
13.3.2 focusUnTickedImage
Specifies the image to be displayed when you clear a selection on non-touch devices.
Syntax
JavaScript: focusUnTickedImage
Lua: focusuntickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l BlackBerry
l J2ME
13.3.3 groupCells
Specifies if the group cells style must be applied. when the style is applied the items in the checkbox are
grouped and they are indicated with a round corner rectangle box.
Default: false
Syntax
JavaScript: groupCells
Lua: groupcells
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
13.3.4 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
13.3.5 tickedImage
Note: If you specify a tickedImage, ensure that you also specify an unTickedimage. If not defined, the
behavior will be undefined.
Syntax
JavaScript: tickedImage
Lua: tickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l BlackBerry
l J2ME
l Windows Phone
l Windows Kiosk
13.3.6 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Phone
l Windows Tablet
l Windows Kiosk
13.3.7 unTickedImage
Note: If you specify an unTickedImage, ensure that you also specify a tickedImage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: unTickedImage
Lua: untickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l BlackBerry
l J2ME
l Windows Phone
l Windows Tablet
l Windows Kiosk
13.3.8 viewType
Default: CHECKBOX_VIEW_TYPE_ONOFFSWITCH
l CHECKBOX_VIEW_TYPE_ONOFFSWITCH
l CHECKBOX_VIEW_TYPE_TABLEVIEW
l CHECKBOX_VIEW_TYPE_ONSCREENWHEEL
Note: For toggleView you can further select the ViewStyle as plain, bordered, or bar.
TABLEVIEW
ONOFFSWITCH
ONSCREENWHEEL
The below image illustrate the nextprevtoolbar set to a check box. The highlighted toolbar is achieved on
setting the Mode as onscreenwheel to the Check Box and Input Accessory View Type as nextprevtoolbar
to the Form.
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
13.3.9 wheelBackgroundColor
Specifies the background color for the wheel that is displayed when you click the CheckBox. This property is
applicable only when you set the viewType as CHECKBOX_VIEW_TYPE_ONSCREENWHEEL.
Syntax
JavaScript: wheelBackgroundColor
Type
JavaScript: JSObject
Read / Write
JavaScript Example
No
Platform Availability
l iPad
l iPhone
l onSelection
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
13.4.1 onSelection
An event callback that is invoked by the platform when an item is selected or deselected.
Note: For Server side Mobile Web (Basic devices), this event is fired only when you make a selection and
then write an onClick event for a button.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
Platform Availability
This property is available on all platforms except Server side Mobile Web (basic)
13.4.2 preOnclickJS
This event allows the developer to execute custom javascript function before the onSelection callback of the
CheckBox is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript
file under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
onSelection:onSelCallBck}
var chkLayout = {containerWeight:100}
var chkPSP = {preOnclickJS:preOnclickJSCallBck}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
13.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onSelection callback of the
CheckBox is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript
file under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
14. ComboBox
A ComboBox is a widget that allows you to select a single item from a drop-down list.
If you select the drop-down arrow on a ComboBox, a drop-down list containing a list of items (values) is
displayed. When you select an item from the drop-down list, the selected item is displayed on the ComboBox.
A ComboBox is similar to a ListBox. However, unlike the ListBox, you can only select a single item at a time.
You can use a ComboBox widget when you require a user to select a single item from a list of items (greater
than 1 item) while occupying relatively lesser space as compared to a RadioButton widget (a radio button
displays all the available options to make a single selection and hence takes more space).
A ComboBox provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, and Events.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight blockedUISkin
id contentAlignment dropDownImage
info hExpand groupCells
isVisible margin hoverSkin
masterData marginInPixel placeholder
masterDataMap padding popupFocusSkin
selectedKey paddingInPixel popupSkin
selectedKeyValue vExpand popupTitle
skin widgetAlignment tickedImage
toolTip
singleLineText
singleLineTextInPopup
textTruncatePosition
textTruncatePositionInPopup
unTickedImage
viewType
viewConfig
wheelBackgroundColor
Events Deprecated
onSelection placeholderi18nkey
preOnclickJS
postOnclickJS
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
The appearance of the ComboBox with the default properties on various platforms is as follows:
Android
BlackBerry
iPhone
Windows Phone
Mobile Web (Advanced)
UI Behavior
When you click a ComboBox, the UI behavior is not the same on all the platforms.
Platform UI Behavior
Android
BlackBerry
iPhone
Platform UI Behavior
Windows Phone
1. From the IDE, drag and drop the ComboBox onto a form (occupies the complete available width). Or,
based on your requirements, you can choose to perform any of the following options:
a. If you want to resize ComboBox in the horizontal direction, place a Box on the form and
drag and drop the ComboBox inside the HBox and resize accordingly.
b. If you want to resize a ComboBox in the in the vertical direction, place a Box on the form
and place a VBox inside the HBox; and drag and drop the ComboBox inside the VBox
and resize accordingly.
2. Specify the values to be displayed in the ComboBox from the IDE by using the masterData property or
from code by using the masterDataMap property.
3. (Optional) If you have set the values from the code, you can use the selectedKey property to specify to
show any value of your choice as selected.
4. (Optional) For programming purposes, if you want to find the value selected by a user, use the
selectedKeyValue property.
5. (Optional) Define an onSelection event.
Customizing Appearance
You can customize the appearance of the ComboBox by using the following properties:
l You must not use a ComboBox if you require the user to make multiple selections. If you require a user
to make multiple selections, use a CheckBox or a ListBox widget.
l (Optional) You must first fetch the data for the ComboBox before showing the form. You must do so
because if a form is shown and the ComboBox has no values, an empty ComboBox is displayed
resulting in a bad user experience.
Limitations
The following are the limitations of the ComboBox widget across all platforms and individual platforms:
Work Around
To apply the skin and focusSkin to the default appearance of the ComboBox widget, do the following:
1. Create two NinePatchDrawable images and name them as "combo_box_normal_skin.9.png"
for Normal skin and "combo_box_focus_skin.9.png" for Focus skin. Place these images in
"<drive>:\workspace\<project name>\resources\mobilerichclient\android\" directory.
2. Build the Application for Android. The Normal and Focus skins will be applied to the default
ComboBox appearance.
l http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
l http://developer.android.com/guide/developing/tools/draw9patch.html
l J2ME platform: If you do not specify the focusSkin, it is not possible to identify the traversal.
l Mobile Web:
l The onSelection event is not supported on the Basic version of Mobile Web as the Java script is
not supported on browsers of basic devices.
To achieve the functionality similar to an onSelection event, you must create an additional
button for the Basic version of the Mobile Web with an onclick event and attach an onSelection
closure.
l Due to Browser restriction, you cannot apply padding for a ComboBox.
l focusSkin
l id
l info
l isVisible
l masterData
l masterDataMap
l selectedKey
l selectedKeyValue
l skin
14.1.1 focusSkin
Note: In Desktop Web platform, Chrome browser does not support if the properties defined in font tab are
different for skin and focusSkin.
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms.
14.1.2 id
id is a unique identifier of button consisting of alpha numeric characters. Every ComboBox should have a
unique id within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
14.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
14.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
14.1.5 masterData
Specifies the set of values that must be displayed for the user to make a selection from the available choices.
Default: User Defined (You must specify the key and the display value)
To specify the set of values, click the Ellipsis ( ) button against the property to open the MasterData for
ComboBox window.
In the Master Data window, you can specify the Key, Display Value, i18n Key, and the Accessibility Config.
You can use the Selected column to specify the choice to be shown as selected when rendered. You can do
this by selecting true against the choice that you wish to show as selected.
Note: Select the Use as test data in preview mode option if you want to see the data you enter in the Master
Data when you use the quick preview feature of the IDE. (For more information on Quick Preview, see the
Kony Studio User Guide.
Note: If the key or the display value is nil, the value will not be listed as one of the available choices.
Note: The accessibilityConfigObject is optional and the object should contain the keys as defined in the
accessibilityConfig property.
[
["key1","value1",accessibilityConfigObject],
["key2","value2",accessibilityConfigObject],......,
["keyn","valuen",accessibilityConfigObject]
]
Syntax
JavaScript: masterData
Lua: masterdata
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
14.1.6 masterDataMap
Specifies the set of values from which you can make a selection. You must set the values from the code.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
This property is applicable only if the masterData is not set. You must use either the masterData or the
masterDataMap property to set data for the ComboBox.
You must specify a key, value, and the accessibilityConfig in a master data map.
{"mykey":"item2","myvalue":"Item Two","accessibilityConfig":acObjec
t},...,
["mykey":"itemn","myvalue":"Item N","accessibilityConfig":"acObject}
],
"mykey",
"myvalue"
]
Note: The accessibilityConfig is the standard key expected in each items data array. It is optional and the
object should contain the keys as defined in the accessibilityConfig property.
Note: If the key or the value is null/nil, the value will not be listed as one of the available choices.
Syntax
JavaScript: masterDataMap
Lua: masterdatamap
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
14.1.7 selectedKey
Note: On Android platform, if you do not select a value, the first item in the ComboBox is selected.
If you create a ComboBox with multiple values, you can choose to show a specific value as selected when
the ComboBox is rendered.
Syntax
JavaScript: selectedKey
Lua: selectedkey
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
No
Platform Availability
14.1.8 selectedKeyValue
Syntax
JavaScript: selectedKeyValue
Lua: selectedkeyvalue
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
14.1.9 skin
Specifies the look and feel of the ComboBox when not in focus.
Note: In Desktop Web platform, Chrome browser does not support if the properties defined in font tab are
different for skin and focusSkin.
Note: In Android platform, you can apply skin only to the dropdown list that displays when ComboBox is
clicked.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
14.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
14.2.2 contentAlignment
Specifies the alignment of the text for a ComboBox with respect to its boundaries.
Note: This property is applicable only when the view is set as wheel type.
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the ComboBox.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the ComboBox.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the ComboBox.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
14.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Desktop Web, and SPA.
14.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
14.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
14.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Server side Mobile Web, Desktop Web, and SPA platforms. Padding is not supported by Windows
Mobile browser for Box and ImageGallery.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Desktop Web, SPA, and BlackBerry 10.
14.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
14.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
If set to false, the widget occupies the preferred height. The preferred height of a widget is the sum of its
contents height, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, and Server side Mobile Web
platforms.
14.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l blockedUISkin
l dropDownImage
l groupCells
l hoverSkin
l placeholder
l popupFocusSkin
l popupSkin
l popupTitle
l singleLineText
l singleLineTextInPopup
l textTruncatePosition
l textTruncatePositionInPopup
l tickedImage
l toolTip
l unTickedImage
l viewType
l viewConfig
l wheelBackgroundColor
14.3.1 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
14.3.2 dropDownImage
Specifies the image to be used for the drop-down box indicator (inverted triangle by default). The image you
specify is used to depict the drop-down box. If you do not specify an image, the drop-down box displays the
default image (inverted triangle).
Note: For iOS platform, the drop down image should be of size 20px * 33px for non retina devices and for
retina devices the image size should be 40px * 66px.
Syntax
JavaScript: dropDownImage
Lua: dropdownimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l BlackBerry
l J2ME
14.3.3 groupCells
Default: false
Syntax
JavaScript: groupCells
Lua: groupcells
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
14.3.4 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
14.3.5 placeholder
Specifies the temporary or substitute text (a hint provided as a word or phrase) that must be displayed on the
ComboBox until the actual selection is made.
If you do not specify the placeholder text, the first option in the list is shown as the selected value.
Note: On iPhone platform, placeholder is supported only when the viewType is set as COMBOBOX_
VIEW_TYPE_LISTVIEW.
Syntax
JavaScript: placeholder
Lua: placeholder
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
If you specify a value for the placeholder property and set selectedkey=nil or selectedkeyvalue=nil, then
the specified placeholder is displayed to the user when the Combo Box is rendered.
Yes
Platform Availability
l iPad
l iPhone
l BlackBerry
l Windows Phone
l J2ME
14.3.6 popupFocusSkin
Specifies the skin that is applied to each item in the native popup (list of options available) that appears when
you select the ComboBox.
Syntax
JavaScript: popupFocusSkin
Lua: popupfocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
14.3.7 popupSkin
Specifies the skin that is applied to each item in the native popup (list of options available) that appears when
you select the ComboBox.
Syntax
JavaScript: popupSkin
Lua: popupskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
14.3.8 popupTitle
Default: Please Select (This is the default text that will appear as the title of the ComboBox)
Syntax
JavaScript: popupTitle
Lua: popuptitle
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Symbian
14.3.9 singleLineText
If the length of the text is more than the space available, the selected options text will be displayed truncated,
in a single line with (...) ellipses. The position of the ellipses is controlled by textTruncatePosition property.
The default ellipses position is at the end of the line if textTruncatePosition property is not set.
Default:False
Syntax
JavaScript: singleLineText
Type
JavaScript: Boolean
Read / Write
JavaScript Example
No
Platform Availability
14.3.10 singleLineTextInPopup
If the length of the text is more than the space available, the popup options text will be displayed truncated, in
a single line with (...) ellipses. The position of the ellipses is controlled by textTruncatePositionInPopup
property. The default ellipses position is at the end of the line if textTruncatePositionInPopup property is not
set.
Default:False
Syntax
JavaScript: singleLineTextInPopup
Type
JavaScript: Boolean
Read / Write
JavaScript Example
No
Platform Availability
14.3.11 textTruncatePosition
When the property singleLineText is set to true, this property controls the position of the ellipses (...), in the
selected option text.
l constants.TEXT_TRUNCATE_START
l constants.TEXT_TRUNCATE_MIDDLE
l constants.TEXT_TRUNCATE_END
Default:constants.TEXT_TRUNCATE_END
Syntax
JavaScript: textTruncatePosition
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform Availability
14.3.12 textTruncatePositionInPopup
When the property singleLineTextInPopup is set to true, this property controls the position of the ellipses (...),
in the popup options text.
l constants.TEXT_TRUNCATE_START
l constants.TEXT_TRUNCATE_MIDDLE
l constants.TEXT_TRUNCATE_END
Default:constants.TEXT_TRUNCATE_END
Syntax
JavaScript: textTruncatePositionInPopup
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform Availability
14.3.13 tickedImage
Note: If you specify a tickedImage, ensure that you also specify an unTickedImage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: tickedImage
Lua: tickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
14.3.14 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
14.3.15 unTickedImage
Note: If you specify an unTickedImage, ensure that you also specify a tickedImage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: unTickedImage
Lua: untickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
14.3.16 viewType
Default: COMBOBOX_VIEW_TYPE_LISTVIEW
Note: For toggleView you can further select the View Style as plain, bordered, or bar.
listView
Note: If you select the listView and do not specify a selection in the masterData, the default behavior of the
platform is to select the first entry on the list.
tableView
toggleView
onscreenwheel
The below image illustrate the nextprevtoolbar set to a Combo Box. The highlighted toolbar is achieved
on setting the Mode as onscreenwheel to the Combo Box and Input Accessory View Type as
nextprevtoolbar to the Form.
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
//Defining the properties for ComboBox with the view type as Tableview.
var comboBasic ={id:"combobox1", isVisible:true};
var comboLayout = {containerWeight:100};
var comboPSP= {viewType:constants.COMBOBOX_VIEW_TYPE_TABLEVIEW};
Yes
Platform Availability
l iPad
l iPhone
l Windows Tablet
l Desktop Web
14.3.17 viewConfig
Specifies the view configuration for different viewtypes. You can set the configuration for toggle view.
viewStyle: Accepts the view style. This property is not supported in iOS7 and above versions.
Following are the available options:
l COMBOBOX_TOGGLE_VIEW_STYLE_PLAIN
l COMBOBOX_TOGGLE_VIEW_STYLE_BORDERED
l COMBOBOX_TOGGLE_VIEW_STYLE_BAR
equalSegments: Specifies the boolean value which indicates if the segments must be equal.
enableTint: Specifies the boolean value to enable tintColor property. When this property is set
to true, tintColor property is displayed.
tintColor: Specifies the tint color in RGB format. The default color is blue.
Note: Below are the view configuration properties in Desktop Web when the viewType is set as
COMBOBOX_VIEW_TYPE_EDITVIEW.
autoSuggest: Enables the users to quickly find and select from a pre-populated list of values as they type,
leveraging searching and filtering.
Type: Boolean
Default : false
editableAreaSkin: Specifies the skin to be applied to the editor area of the ComboBox.
Type: String
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//Defining the properties for ComboBox with the view type as Editview.
var comboBasic ={id:"combobox1", isVisible:true};
var comboLayout = {containerWeight:100};
var comboPSP= {viewType:constants.COMBOBOX_VIEW_TYPE_EDITVIEW, viewConfig:
{autoSuggest: true, editableAreaSkin: "editareaskin"} };
Yes
Platform Availability
l iPad
l iPhone
l Desktop Web
14.3.18 wheelBackgroundColor
Specifies the background color for the wheel that is displayed when you click the ComboBox. This property is
applicable only when you set the viewType as COMBOBOX_VIEW_TYPE_ONSCREENWHEEL.
Syntax
JavaScript: wheelBackgroundColor
Type
JavaScript: JSObject
Read / Write
JavaScript Example
//Defining the properties for ComboBox with the view type as Editview.
var comboBasic ={id:"combobox1", isVisible:true};
var comboLayout = {containerWeight:100};
var comboPSP= {viewType:constants.COMBOBOX_VIEW_TYPE_ONSCREENWHEEL, viewCo
nfig: {autoSuggest: true, editableAreaSkin: "editareaskin"} };
No
Platform Availability
l iPad
l iPhone
l onSelection
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
14.4.1 onSelection
This event is triggered when you select or unselect any item in ComboBox.
Note: For Server side Mobile Web (Basic devices), this event is fired only when you make a selection and
then write an onClick event for a button.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
Platform Availability
14.4.2 preOnclickJS
This event allows the developer to execute custom javascript function before the onSelection callback of the
ComboBox is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript
file under project>module>js folder.
Note: This event should return true, to continue with execution of onSelection and postOnclickJS events.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
14.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onSelection callback of the
ComboBox is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript
file under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
l placeholderi18nKey
14.5.1 placeholderi18nKey
Specifies the i18n key for the placeholder text to be used for internationalization.
Type
String
Read / Write
No
Yes
Platform Availability
l BlackBerry
l J2ME
15. DataGrid
DataGrid widget allows you to present a collection of data in rows and columns (tabular format).
DataGrid also supports common table formatting options, such as alternating the row background color,
customizing the gridline, and ability to hide or show headers.
You can use a DataGrid widget to show a read-only view of a small amount of data in a tabular format.
DataGrid widget provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Property, an Event, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
columnHeadersConfig containerWeight containerHeight
data contentAlignment containerHeightInPixel
gridHeight margin dockingHeader
headerSkin padding enableScrollBar
id widgetAlignment gridlineColor
info hoverSkin
isMultiSelect selectedCellItem
isVisible selectedCellIndex
rowAlternateSkin toolTip
rowCount
rowFocusSkin
rowNormalSkin
scrollable
selectedIndex
selectedIndices
selectedItem
selectedItems
showColumnHeaders
Event Methods
onRowSelected addAll
addDataAt
applyCellSkin
removeAll
removeAt
selectAllRows
setCellDataAt
setData
setDataAt
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
The following is the appearance of the DataGrid widget on various platforms with a specified Master Data,
Header skin, and row skin:
Platform Appearance
Android
Platform Appearance
BlackBerry
iPhone
Windows Phone
Platform Appearance
1. From the IDE, drag and drop the DataGrid widget onto a Form (occupies the complete available width).
Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the DataGrid in the horizontal direction, place an HBox on the Form and
drag and drop the DataGrid inside the HBox and resize accordingly.
b. If you want to resize the DataGrid in the vertical direction, place an HBox on the Form and place
a VBox inside the HBox; and drag and drop the DataGrid inside the VBox and resize
accordingly.
2. Specify the data for the DataGrid either by using the data property from the IDE or from code by using
the DataGrid Methods.
3. (Optional) Use the showColumnHeaders property to specify if the headers must be displayed or not
(they are displayed by default).
4. (Optional) Use the isMultiSelect property to specify if the DataGrid must support multiple selection or
not (multiple selection is supported by default).
5. (Optional) Define an onRowSelected event for the DataGrid.
Customizing Appearance
You can customize the appearance of a DataGrid by using the following properties:
Important Considerations
The following are the important considerations for the DataGrid widget:
l To set the data, you must first specify the columns using the data property from the IDE. If you do not
do this, you will not be able to set data for the DataGrid from the code.
l If the DataGrid supports the isMultiSelect property, you must ensure that you have specified the
rowFocusSkin property. Else, you will not be able to distinguish multiple selections.
l contentAlignment for cell is supported only on iOS platform.
l columnHeadersConfig
l data
l gridHeight
l headerSkin
l id
l info
l isMultiSelect
l isVisible
l rowAlternateSkin
l rowCount
l rowFocusSkin
l rowNormalSkin
l scrollable
l selectedIndex
l selectedIndices
l selectedItem
l selectedItems
l showColumnHeaders
15.1.1 columnHeadersConfig
It is a property to define the number of columns and the type of each column and their meta properties. The
number of elements in the Array defines the number of columns. The column JSObject must contain the
properties from following column details properties.
l DATAGRID_COLUMN_TYPE_TEXT (default)
l DATAGRID_COLUMN_TYPE_IMAGE
l DATAGRID_COLUMN_TYPE_TEMPLATE (supported on desktop web only)
l columnHeaderText [Mandatory] - The text string that is displayed as header of column.
l columnHeaderTemplate [Mandatory] - The template box reference (a composition of widgets in a
HBox or VBox) to be set as header. This property overrides columnHeaderText (supported on desktop
web only.)
l columnDataTemplate [Mandatory]- The template box reference to be used to create a row cell for this
column (supported on desktop web only.)
l columnWidthInPercentage [Mandatory] - The amount of width in percentage to be occupied from the
widget space. The sum of all the values in each column should be exactly 100% otherwise the
behavior is undefined. This option is not supported in BlackBerry 10 platform.
l isColumnSortable [Optional]- A Boolean property to specify whether the column must be sorted. If
set to true, the rows are reordered as per the sorting order. This option is not supported in Windows
Mango and BlackBerry 10 platforms.
l columnOnClick [Optional]- The event callback is invoked by the platform when a column is clicked.
l columnContentAlignment [Optional]- Specifies the alignment of the text or image within a column.
This option is not supported in BlackBerry 10 platform.
l CONTENT_ALIGN_TOP_LEFT
l CONTENT_ALIGN_TOP_CENTER
l CONTENT_ALIGN_TOP_RIGHT
l CONTENT_ALIGN_MIDDLE_LEFT
l CONTENT_ALIGN_CENTER (default)
l CONTENT_ALIGN_MIDDLE_RIGHT
l CONTENT_ALIGN_BOTTOM_LEFT
l CONTENT_ALIGN_BOTTOM_CENTER
l CONTENT_ALIGN_BOTTOM_RIGHT
Syntax
JavaScript: columnHeadersConfig
Lua: columnheadersconfig
Type
Lua: Table
Read / Write
No
JavaScript Example
Yes
Platform Availability
15.1.2 data
Array of JSObjects which represents the actual data to be rendered in each row. Each element in array
represents one row data.
The row data should be represented as a pair of "columnID" defined from columnHeaderConfig and its value
as per the type of the column.
//Example data for three column datagrid with 3 columns as columnid1 (TEXT
type), columnid2(IMAGE type), columnid3(TEXT type):
data = [{columnid1:"mytext", columnid2:"myimage.png", columnid3:"row one"},
{columnid1:"mytext2", columnid2:"myimage2.png", columnid3:"row tw
o"},
{columnid1:"mytext3", columnid2:"myimage.png", columnid3:"row thre
e"}
] //adding 3 rows
//Example for column with type template: columnid1 (TEXT type), columnid2(
IMAGE type), columnid3(TEMPLATE type) Assuming the template has one label
widget with id "labelwidgetid" and one image widget with id "imagewidgeti
d", the data construct should be as follows:
data = [{columnid1:"mytext", columnid2:"myimage.png", columnid3: { labelwi
dgetid: {text:"labeltext", skin:"blueskin"}, imagewidgetid: {src:"image.pn
g"} },
{ columnid1:"mytext2", columnid2:"myimage2.png", columnid3: { labe
lwidgetid: {text:"labeltext", skin:"blueskin"}, imagewidgetid: {src:"image
.png"} }}
] //adding 2 rows
1. Click the Ellipsis ( ) button against the Master Data property.The Data Grid Editor window appears.
Note: You cannot specify data in the Rows tab unless you specify the data in the Column tab.
1. In the Column tab you can specify the following for each column:
2. In the Rows tab, all the column headers that you specify in the Column tab appear as the headers for
rows. You can enter the required data for each row.
Note: After specifying the columns and rows, you can alternatively choose to specify the data from the code
by using the DataGrid Methods instead of the data property.
Syntax
JavaScript: data
Lua: data
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
col3:"$4000"}]
Yes
Platform Availability
15.1.3 gridHeight
Specifies the height of the DataGrid based in percentage or in pixel. The percentage is calculated based on
the height of the form.
Default: empty
Syntax
JavaScript: gridHeight
Lua: gridheight
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
No
Platform Availability
15.1.4 headerSkin
This is a skin property. This property specifies the skin that must be applied to the Header row.
Syntax
JavaScript: headerSkin
Lua: headerskin
Type
JavaScript: String
Lua: String
Read / Write
Note: On Windows Phone (Mango) platform, you cannot write data to this property.
JavaScript Example
Yes
Platform Availability
15.1.5 id
id is a unique identifier of a DataGrid consisting of alpha numeric characters. Every DataGrid widget should
have a unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
15.1.6 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But
you can always read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
15.1.7 isMultiSelect
An option to make the datagrid as multi selectable row. The selected rows are indicated by highlighting the
rows by focus skin.
Default: false
Note: Ensure to specify rowFocusSkin, otherwise the user won't be able to visually identify the selected
rows.
Syntax
JavaScript: isMultiSelect
Lua: ismultiselect
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
15.1.8 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
15.1.9 rowAlternateSkin
Syntax
JavaScript: rowAlternateSkin
Lua: rowalternateskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
15.1.10 rowCount
Syntax
JavaScript: rowCount
Lua: rowcount
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
15.1.11 rowFocusSkin
This is a skin property. This property specifies the skin that must be applied when the row is in focus.
Syntax
JavaScript: rowFocusSkin
Lua: rowfocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
[5,5,5,5], margin:[5,5,5,5]};
var dgridPSP = {};
Yes
Platform Availability
15.1.12 rowNormalSkin
This is a skin property. This property specifies the skin that must be applied when the row is not in focus.
Syntax
JavaScript: rowNormalSkin
Lua: rownormalskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
15.1.13 scrollable
Default: false
Syntax
JavaScript: scrollable
Lua: scrollable
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
No
Platform Availability
15.1.14 selectedIndex
Note: This property is applicable only if the isMultiSelect property is set to false.
Syntax
JavaScript: selectedIndex
Lua: selectedindex
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
15.1.15 selectedIndices
This property returns the list of user selected row object indexes. If "isMultiSelect" is set to false, the list will
contain only one entry.
Note: This property is applicable only if the isMultiSelect property is set to true.
Syntax
JavaScript: selectedIndices
Lua: selectedindices
Type
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
15.1.16 selectedItem
Note: This property is applicable only if the isMultiSelect property is set to false.
Syntax
JavaScript: selectedItem
Lua: selecteditem
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
15.1.17 selectedItems
This property returns the list of user selected row objects. If "isMultiSelect" is set to false, the list will contain
only one entry.
Note: This property is applicable only if the isMultiSelect property is set to true.
Syntax
JavaScript: selectedItems
Lua: selecteditems
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
15.1.18 showColumnHeaders
This property controls the visibility of the column headers of the DataGrid.
Default: true
Syntax
JavaScript: showColumnHeaders
Lua: showcolumnheaders
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l contentAlignment
l margin
l padding
l widgetAlignment
15.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
15.2.2 contentAlignment
Specifies the alignment of the text on the DataGrid with respect to its boundaries. A default value CONTENT_
ALIGN_CENTER is assigned for all platforms. To choose another alignment, click the drop-down arrow and
select the desired alignment. However, to change the default value on a particular platform, select the button
next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_CENTER
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the widget.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the widget.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the widget.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the widget.
l CONTENT_ALIGN_CENTER - Specifies the text should align at center of the widget.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the widget.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the widget.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
widget.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the widget.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
15.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
15.2.4 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
15.2.5 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l containerHeight
l containerHeightInPixel
l dockingHeader
l enableScrollBar
l gridlineColor
l hoverSkin
l selectedCellItem
l selectedCellIndex
l toolTip
15.3.1 containerHeight
Specifies the container height of the datagrid in percentage (%). Height is calculated with respect to the width
of the datagrid.
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
[5,5,5,5], margin:[5,5,5,5]};
var dgridPSP = {containerHeight:80};
Yes
Platform Availability
15.3.2 containerHeightInPixel
Syntax
JavaScript: containerHeightInPixel
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
15.3.3 dockingHeader
Default: false
Syntax
JavaScript: dockingHeader
Type
JavaScript: Boolean
Read / Write
JavaScript Example
[5,5,5,5], margin:[5,5,5,5]};
var dgridPSP = {dockingHeader:true;
Yes
Platform Availability
15.3.4 enableScrollBar
Specifies if the scrollbars on the datagrid is to be displayed vertically or the default option is to be retained.
Default: DATAGRID_SCROLLBAR_NONE
JavaScript: enableScrollBar
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
15.3.5 gridlineColor
Specifies the color of the grid line of the DataGrid. The color should be specified in the format of "RGBA" in
hex. For example "FF224400".
Syntax
JavaScript: gridlineColor
Lua: gridlinecolor
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
columnType:constants.DATAGRID_COLUMN_TYPE_TEXT, columnHeaderText:"Balance",
columnWidthInPercentage:30}], isMultiSelect:true, data:[{col1:"Checking",
col2:"490",col3:"$400", metainfo:{skin:"rowskin1", col1_skin:"colskin1"}},
{col1:"Checking",col2:"494", col3:"$2000.34"}, {col1:"Savings",col2:"567",
col3:"$4000"}]};
var dgridLayout = {widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT, conten
tAlignment:constants.CONTENT_ALIGN_CENTER, containerWeight:99, padding:[5,
5,5,5], margin:[5,5,5,5]};
var dgridPSP = {gridlineColor:"FF224400"};
The following image illustrates the Gridline color applied to the DataGrid:
Yes
Platform Availability
l BlackBerry
l BlackBerry 10
l Android/Android Tablet
15.3.6 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
JavaScript Example
Yes
Platform Availability
15.3.7 selectedCellItem
Returns the data object associated with the user selected row and columnID combination.
Syntax
JavaScript: selectedCellItem
Type
JavaScript: JSObject
Read / Write
JavaScript Example
No
Platform Availability
l Desktop Web
l BlackBerry 10
15.3.8 selectedCellIndex
Returns the user selected row index and the associated columnid as specified by the developer while defining
the columns. For example, first row with column id of "item1" is provided as [1, "item1"];
Syntax
JavaScript: selectedCellIndex
Type
JavaScript: Array
Read / Write
JavaScript Example
No
Platform Availability
l Desktop Web
l BlackBerry 10
15.3.9 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l onRowSelected
15.4.1 onRowSelected
Syntax
JavaScript: onRowSelected
Lua: onrowselected
Read / Write
JavaScript Example
Yes
Platform Availability
l addAll
l addDataAt
l applyCellSkin
l removeAll
l removeAt
l selectAllRows
l setCellDataAt
l setData
l setDataAt
15.5.1 addAll
This method allows you to add new data to the DataGrid. The new data is appended to the existing data. If the
DataGrid has no data, the new data is placed in the DataGrid.
Signature
JavaScript: addAll(data)
Lua:datagrid.addall(datagridid, data)
Input Parameters
Return Values
None
JavaScript Example
columnType:constants.DATAGRID_COLUMN_TYPE_TEXT, columnHeaderText:"Account
Number", columnWidthInPercentage:30}, {columnID:"col3", columnType:constan
ts.DATAGRID_COLUMN_TYPE_TEXT, columnHeaderText:"Balance", columnWidthInPer
centage:30}], isMultiSelect:true, data:[{col1:"Checking", col2:"490",col3:
"$400", metainfo:{skin:"rowskin1", col1_skin:"colskin1"}}, {col1:"Checking
",col2:"494", col3:"$2000.34"}, {col1:"Savings",col2:"567",col3:"$4000"}],
onRowSelected:onRowSelectedCalBck};
var dgridLayout = {widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT, conten
tAlignment:constants.CONTENT_ALIGN_CENTER, containerWeight:99, padding:[5,
5,5,5], margin:[5,5,5,5]};
var dgridPSP = {gridlineColor:"FF224400"};
Error Codes
None
Platform Availability
15.5.2 addDataAt
Allows you to set a row of data at a given index. The new data is placed before the index. The existing data is
pushed to the next row.
Signature
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.3 applyCellSkin
Note: The skin set in this property takes precedence over the skin set using rowNormalSkin.
Signature
Input Parameters
skinid [Object]
Handle to the skin.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.4 removeAll
This method is used to remove all the existing rows in the DataGrid. If you use this method, the data in the
DataGrid will not be visible.
Signature
JavaScript: removeAll()
Lua:datagrid.removeall(datagridid)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.5 removeAt
This method is used to remove all the existing rows in the DataGrid.
Signature
JavaScript: removeAt(rowIndex)
Lua:datagrid.removeat(datagridid, rowIndex)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.6 selectAllRows
Signature
JavaScript: selectAllRows(select)
Lua:datagrid.selectallrows(datagridid, select)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.7 setCellDataAt
Allows you to set data in a specific row and column. The existing data of the row and column will be replaced
with the new set. In case the index is not valid the operation is ignored.
Signature
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.8 setData
This method allows you to set new data to the DataGrid. When you set new data, the existing data will be
replaced with the new data. If the DataGrid has no data, the new data is placed in the DataGrid.
Signature
JavaScript: setData(data)
Lua:datagrid.setdata(datagridid, data)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
15.5.9 setDataAt
Allows you to set a row of data at a given index. The existing data of the row will be replaced with the new set.
In case the index is not valid the operation is ignored.
Signature
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
Grid Template is an HBox in which the developer adds the required widgets and set their alignment. These
templates are used to render columns and rows in the grid when the grid column is set to be of type template.
Grid Templates are used to display the data as well as widgets in a DataGrid.
When you want the same information to be displayed across all the DataGrids in the application, you have a
provision to add a Grid Template using Kony Studio.
1. Go to Applications View.
2. Expand the application for which you want to create the Grid Template.
3. Navigate to templates > grids, right-click desktop and select New Grid Template. The Create a New
Grid window appears.
Note: Only HBox and VBox are supported on the form. You can put other widgets
within these widgets. The widgets that can be dragged into the container are displayed
in the Palette view.
iv. Drag and drop the required widgets onto the HBox/ VBox. Set the properties of these
widgets.
v. A grid template is created.
You can set the created grid template for a row or a column using the Master Data Property of DataGrid.
Previously in the Master Data property for a DataGrid you could only specify text for the column header
template and column template. Using the Grid template, you can set images to be a part of the column header
template or the column template.
l HBox
l VBox
l Button
l Calendar
l CheckBoxGroup
l ComboBox
l Image
l Label
l Line
l Link
l RadioButtonGroup
l RichText
l TextArea
l TextBox
You can create separate templates for column Headers and Rows using the above process.
1. Go to Applications view.
2. Expand the application for which you want to use DataGrid.
3. Navigate to forms > desktop, right-click desktop and select New Form. The Create a New Form
window appears.
4. Enter a name for the Form and click Finish. A new form is created.
5. Drag-drop a DataGrid on the form and set data using data property.
16. Image
Image widget is a non-interactive widget that you can use to display a graphic (local or remote) from a PNG
file.
Platform Specific
Basic Properties Layout Properties
Properties
base64 containerWeight glossyEffect
id imageScaleMode hoverSkin
imageWhenFailed margin renderAsAnchor
imageWhileDownloading marginInPixel skin
info padding toolTip
isVisible paddingInPixel
rawBytes referenceHeight
src referenceWidth
widgetAlignment
Events Deprecated
onDownloadComplete hExpand
scaleMode
vExpand
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
For backward compatibility with support for all deprecated properties and behaviors, use the constructor
kony.ui.Image.
1. From the IDE, drag and drop the Image widget onto a Form (occupies the complete available width).
Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the Image widget in the horizontal direction, place an HBox on the Form
and drag and drop the Image inside the HBox and resize accordingly.
b. If you want to resize the Image widget in the vertical direction, place an HBox on the Form and
place a VBox inside the HBox; and drag and drop the Image inside the VBox and resize
accordingly.
2. Specify the image (local or remote) that must be displayed using the src property.
Note: To specify a local image, you must add the PNG file (the file name must follow a particular naming
convention) to the resources folder of the Application. For more information on how to add these files, see
the Working with Resources section of the Kony Studio User Guide.
3. (Optional) You can alternatively choose to display an image captured from a camera by using the
rawBytes property. Or, you can convert the raw bytes to base64 encryption format and set the same to
base64 property.
4. (Optional) If you are specifying a remote image, you can use the following properties as per your
requirement:
l ImageWhenFailed: Specifies the image to indicate that the image (that is being downloaded) is
not available.
l ImageWhileDownloading: Specifies the image to indicate that the download is taking place over
a network connection.
Note: These properties are not supported by the Mobile Web platform. A broken image appears in the
browser if a downloadable image is not available.
Customizing Appearance
You can customize the appearance of the Image widget by using the following properties:
Naming Convention
To specify a local image, you must add the PNG file to the resources folder of the Application.
Note: For more information on how to add these files, see the Working with Resources section of the Kony
Studio User Guide.
The files that you add must follow a particular naming convention. The following is the naming convention that
you must follow:
Note: Kony Studio does not recognize images that have invalid file names.
l base64
l id
l imageWhenFailed
l imageWhileDownloading
l info
l isVisible
l rawBytes
l src
16.1.1 base64
If the image source is a URL, and if the image is not downloaded, or if it encounters an error while
downloading, null is returned.
Note: SPA platform does not support reading base64 from an image src. But it can read base64 from an
image which is displayed through base64.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: base64
Lua: base64
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
function writeb()
{
frmBase64.image.base64="iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAYAAAAe2bNZAAAAA
XNSR0IArs4c6QAAAARnQU
1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAI3SURBVFhH7Zg9U8JAEIZTKyryGUgG
EEUUEQTHEnsbK34ANjZqjWMpM
5baYy09jRU2VlJLT2dD5x848x5euEBCLpIAhcUxDNnbe+7dvb0N0tflFjn1y6S8svghfd+kyV1
RWR6Y1/OEI5jKaozU1hPkMbBj
Ou430/S5U7WpMu/VpO3EM59CmsFd8ikfkoFSEh7t8D652rD3D3AKg2G1C6jwEsoKL24Fik1gQ9
PUojBIYjMjyN2PFWcGYYDwNU0
lyzC5oYaVSnW/+eYpzMOJalDGSxAGaAYkjdcZGDlJ0L/aImTVNaMIEq8KktXNHLED7URyhohIf
OLOIzzjgHy4dBgcO7udePGcV0
eHQUHzYjERn6z+6DBOK6vIIqI2rPZQGGS16EQv7HDH0esAHyDzYhFRn7i/dBiQiU70wo4lMVXm
H4ZrQ4zKhDKLDZN8MMqZ2oITu
BnODmFYezhQxbs3t5O4Hvo92migQNXRpHJ7ESF/iTKp+OJDZXAN4EtdgxKa7KD/FfHXig5rDIX
hL6p5tg8UVFPlIjTqvyX8yMga
ge25qvOsjPUzgOG7diglIu+sNt1USc8VPUw4Tejw2A8A6ytHngL1UqOk5Zs7Q6fHHuAW9yp/us
lJRXRlrF6qoNBHNO+eQloda6n
5idDYKsMMcP4bWkHqxQszQUGNWsD8XUkYhodqRrLOoJLHpK3kyW0kY/sebxsms/BBqetgmrRiO
fKmFkzHk7xHAVhVdfJPhGkCO3
Hgpu1SwfwALZUki7xaRB8AAAAASUVORK5CYII=";
}
No
Platform Availability
Available on all platforms except all Server side Mobile Web platforms
16.1.2 id
id is a unique identifier of Image consisting of alpha numeric characters. Every Image should have a unique id
within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
src:"http://www.fordesigner.com/imguploads/Image/cjbc/zcool/png20080525/12
11728825.png"};
var layoutConfImage = {containerWeight:100};
Yes
Platform Availability
16.1.3 imageWhenFailed
Specifies the image to be displayed when the remote resource is not available. This image is taken from the
resources folder.
Syntax
JavaScript: imageWhenFailed
Lua: imagewhenfailed
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
16.1.4 imageWhileDownloading
Specifies the image to be displayed when the remote source is still being downloaded. This image is taken
from the resources folder.
Syntax
JavaScript: imageWhileDownloading
Lua: imagewhiledownloading
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
16.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
16.1.6 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the visibility of the widget is controlled by the data property of the segment.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
16.1.7 rawBytes
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: rawBytes
Lua: rawbytes
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
16.1.8 src
Specifies the source of the image to be displayed. You can specify an image from the resources folder or
specify a URL of the image.
To specify a URL, enter the address (beginning with http or https) in the default, Mobile Native App, Mobile
Web, or all the three tabs of the Image Location screen.
Note: If the given source points to a HTTP URL the images will be a cached based on the Etag (or Entity
tag) which is typically used for cache validation of web resources.
Syntax
JavaScript: src
Lua: src
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l imageScaleMode
l margin
l marginInPixel
l padding
l paddingInPixel
l referenceHeight
l referenceWidth
l widgetAlignment
16.2.1 containerWeight
Specifies percentage of weight to be allocated by its parent widget. The parent widget space is distributed to
its child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except
when placed in kony.ui.ScrollBox.
This property specifies the maximum width of the Image widget and the actual image content fit in this
boundary based on the scale modes.
Note: If you want to restrict the width of the image, then choose the appropriate container weight. It
becomes developer responsibility to serve the right kind of images as per device screen form factors.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
16.2.2 imageScaleMode
This property specifies how the rendered image's width and height are identified when those of the source
image varies from the Image widget itself. Image Widget represents the underlying native widget which
renders (and applies alignment to) the Source Image.
Default: IMAGE_SCALE_MODE_MAINTAIN_ASPECT_RATIO
Note: When this property is modified programmatically from the code, the scale mode changes will be
reflected when a new source image is rendered.
The image aspect ratio is the width (x) of the image compared to its height (y). A square image has a ratio of
1:1, but a non-square (rectangular) image does not have the same height and width. It is commonly expressed
as two numbers separated by a colon, as in 16:9.
Before rendering the Image first the width and height of the Image widget is calculated. The width and height
are driven by the container weight that has been specified or referenceWidth and referenceHeight whichever
are applicable. Now the Source Image is scaled or cropped as per the ImageScale modes set in the property.
Note: For dynamic images (loaded from a remote server), specifying a referenceWidth / referenceHeight
avoids unnecessary screen re-layouts.
l If the source image size is less than the ImageWidget size then source image is rendered as is.
The ImageWidget is aligned as per the widget alignment rules.
l If the source image is size is greater than the ImageWidget size then the source image is
resized to the ImageWidget dimensions while maintaining the aspect ratio.
l Height is derived from reference height specified, if reference height is specified. If not
the actual Image height is taken.
l IMAGE_SCALE_MODE_CROP: This scale mode preserves the original size of the Source Image. In
case,
l If the source image size is less than the ImageWidget size then source image is rendered as is.
l If the source image is size is greater than the ImageWidget size then the source image is
cropped or clipped to fit the ImageWidget.
Note: referenceWidth and referenceHeight are not mandatory for this scalemode. This mode is not
supported on Server side Mobile Web, Desktop Web, and SPA platforms. They will render the sourceImage
as its actual size.
l If the source image size is less than the ImageWidget size then source image is stretched to
the ImageWidget dimensions (height and width).
l If the source image is size is greater than the ImageWidget size then the source image is
squeezed to fill the ImageWidget dimensions (height and width).
Note: referenceWidth and referenceHeight are mandatory for this scalemode. Not specifying the
referenceWidth / referenceHeight will lead to undefined behaviour.
Note: If the reference image is bigger than container weight, Mobile Web and SPA platforms may not be
able to adhere to the container weight but will spill over.
Syntax
JavaScript: imageScaleMode
Lua: imagescalemode
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and SPA. The option IMAGE_SCALE_
MODE_CROP is not supported on Desktop Web.
16.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
16.2.4 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
16.2.5 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10
16.2.6 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
16.2.7 referenceHeight
It is the reference image height in pixels. The source image height is resized to fill the widget dimensions. The
image aspect ratio is not preserved. The referenceHeight is respected only when the imageScaleMode
property is set to IMAGE_SCALE_MODE_FIT_TO_DIMENSIONS. The pixels are device independent
pixels specified against 163 dpi.
For example, HzImage widget dimensions are 200 x 100 (height and width respectively ) and your image is
300 x 200 px, then you have to specify referenceHeight as 200 and referenceWidth as 100. The image is
resized to fit in the widget by reducing the height and width.
Syntax
JavaScript: referenceHeight
Lua: referenceheight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
16.2.8 referenceWidth
It is the reference image width in pixels. The source image width is resized to fill the widget dimensions. The
image aspect ratio is not preserved. The referenceWidth is respected only when the imageScaleMode
property is set to IMAGE_SCALE_MODE_FIT_TO_DIMENSIONS. The pixels are device independent
pixels specified against 163 dpi.
For example, HzImage widget dimensions are 200 x 100 (height and width respectively ) and your image is
300 x 200 px, then you have to specify referenceHeight as 200 and referenceWidth as 100. The image is
resized to fit in the widget by reducing the height and width.
Syntax
JavaScript: referenceWidth
Lua: referencewidth
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
16.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
widgetAlignment:constants.WIDGET_ALIGN_MIDDLE_LEFT};
Yes
Platform Availability
l glossyEffect
l hoverSkin
l renderAsAnchor
l skin
l toolTip
16.3.1 glossyEffect
Default: IMAGE_GLOSSY_EFFECT_DEFAULT
l IMAGE_GLOSSY_EFFECT_DEFAULT
l IMAGE_GLOSSY_EFFECT_LINEAR
l IMAGE_GLOSSY_EFFECT_RADIAL
Syntax
JavaScript: glossyEffect
Lua: glossyeffect
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
PSPConfImage);
Yes
Platform Availability
l iPhone
l iPad
16.3.2 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Availability on platforms
16.3.3 renderAsAnchor
Most of the Mobile Web browsers do not offer a very good user experience when the entire segment is made
clickable. To offer an acceptable user experience, one of the image in a segment is made clickable and the
onClick event for the segment is bound to a image.
This property is typically set to true when the segment onClick is bound to an image.
Note: This property is available only when the Image Widget is placed in a Segment.
Default: false
If set to true, the Image is the first clickable element in the Segment.
If set to false, the Image is not the first clickable element in the Segment.
Syntax
JavaScript: renderAsAnchor
Lua: renderasanchor
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
16.3.4 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l BlackBerry
l Windows Tablet
16.3.5 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
l onDownloadComplete
16.4.1 onDownloadComplete
This event is triggered when the image download from the URL is complete.
Note: This event is triggered only when the image download from the URL is complete in a Form which is
visible.
This event is not a background job which starts after setting the URL property and is called after the download
is complete.
Signature
Input Parameters
The onDownloadComplete event callback accepts additional parameters when an Image is placed in a
segment row or section template.
Signature
Input Parameters
Read / Write
JavaScript Example
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
l hExpand
l scaleMode
l vExpand
16.5.1 hExpand
Note: This is always true in all thin client platforms and this property is never respected.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Note: This property is not supported on Browser, Image, Map, Chart, and PickerView widgets.
Default: False
Type
Boolean
Read / Write
Yes
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Symbian and SPA.
16.5.2 scaleMode
Specifies the scale mode of the downloaded image. You can choose one of the following Scale Modes:
default
Specifies that the downloaded image must occupy the allocated width. This is the default option.
maintainaspectratio
Specifies that the downloaded image must maintain the aspect ratio (the proportional relationship of the
screen's physical width to its height).
retaininitialimagedimensions
Specifies that the downloaded image must retain the initial image dimensions.
Type
Number
Read / Write
No
Yes
Platform Availability
16.5.3 vExpand
Specifies the widget expansion in the vertical direction. The default value is false.
Note: All thin client platforms do not respected property as it is not possible to vertically expand the widgets.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Note: This property is not supported on Browser, Image, Map, Chart, and PickerView widgets.
Default: false (the checkbox is not selected and the widget occupies the preferred height)
If you set the value to true (select the checkbox), the widget occupies the entire available height.
Type
Boolean
Read / Write
Yes
Yes
Platform Availability
17. Label
Label widget is used to display non-editable text on the Form and is non-interactive.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
The following is the appearance of a Label widget with the text "This is a Label Widget" on various platforms:
Platform Appearance
Android
BlackBerry
iPhone
Windows Phone
1. From the IDE, drag and drop the Label widget onto a Form (occupies the complete available width).
2. Use the text property to specify the text for the Label.
Customizing Appearance
You can customize the appearance of the Label widget by using the following properties:
Important Considerations
l If the text in the Label is occupying more space than the allocated height of the Label widget, the Label
is stretched vertically to accommodate the full text (infinite wrapping) and does not stretch in the
horizontal direction.
l If you place a Label in the Form and do not enter a text, when rendered, the height and width occupied
by the Label depends on the following:
l If the Expand property is false, the Label occupies zero height and width.
l If the Expand property is true, the Label occupies the width and height as determined by the
Expand property.
l id
l info
l isVisible
l skin
l text
l toolTip
17.1.1 id
id is the unique identifier of a Label consisting of alpha numeric characters. Every Label should have a unique
id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
17.1.2 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
17.1.3 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the visibility of the widget is controlled by the data property of the segment.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using setVisibility method.
Yes
Platform Availability
17.1.4 skin
Specifies the look and feel of the Label widget when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
17.1.5 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
17.1.6 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
17.2.1 containerWeight
Specifies the percentage of the parent width that should allocated to the widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
width except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
No
Platform Availability
17.2.2 contentAlignment
Specifies the alignment of the text on the Label with respect to its boundaries. A default value CONTENT_
ALIGN_MIDDLE_LEFT is assigned for all platforms. To choose another alignment, click the drop-down arrow
and select the desired alignment. However, to change the default value on a particular platform, select the
button next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_MIDDLE_LEFT
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the label.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the label.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the label.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the label.
l CONTENT_ALIGN_CENTER- Specifies the text should be horizontally and vertically centered on the
label.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the label.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the label.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the label.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the label.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
17.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Desktop Web, and SPA
17.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget or the container.
To define the margin values for a platform, click the Ellipsis ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
17.2.5 marginInPixel
Enables you to define the space around a widget in pixels or in percentage. You can use this option to define
the top, left, right, and bottom distance between the widget and the next element.
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
17.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the Ellipsis ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
Note: On iOS platform, padding is not respected when no text is provided to Label widget.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
17.2.7 paddingInPixel
Enables you to define the space between the content of the widget and the widget boundaries in pixels or in
percentage. You can use this option to define the top, left, right, and bottom distance between the widget
content and the widget boundary.
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property will be made true for iPhone, iPad, Android
and Windows Phone it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
17.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
If set to false, the widget occupies the preferred height. The preferred height of a widget is the sum of its
contents height, padding and margin.
If set to true, the widget ensures that the entire height available to it is occupied.
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and Desktop Web platforms
17.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT - (BlackBerry 10 supports this option)
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l hoverSkin
l pasteboardType
l renderAsAnchor
l textCopyable
l toolTip
l wrapping
17.3.1 hoverSKin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
17.3.2 pasteboardType
This property enables an application to share data within the application or with another application using
system-wide or application-specific pasteboards.
Typically, an object in the application writes data to a pasteboard when the user requests a copy or cut
operation on a selection in the user interface. Another object in the same or different application then reads
that data from the pasteboard and presents it to the user at a new location; this usually happens when the user
requests a paste operation.
JavaScript: pasteboardType
Type
JavaScript: Number
Read / Write
JavaScript Example
hExpand:true, vExpand:false};
var lblPSP ={pasteboardType:constants.PASTE_BOARD_TYPE_SYSTEM_LEVEL};
Yes
Platform Availability
l iPhone
l iPad
17.3.3 renderAsAnchor
Most of the Mobile Web browsers do not offer a very good user experience when the entire segment is made
clickable. To offer an acceptable user experience, one of the labels in a segment is made clickable and the
onClick event for the segment is bound to a label.
This property is typically set to true when the segment onClick is bound to a label.
Note: This property is available only when the Label Widget is placed in a Segment.
Default: false
Syntax
JavaScript: renderAsAnchor
Lua: renderasanchor
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
17.3.4 textCopyable
This property enables you to copy a text from a Label widget when the widget is enabled state.
Default: false
If set to false, the text of the Label cannot be copied to other widgets.
Syntax
JavaScript: textCopyable
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Android
l SPA
17.3.5 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
17.3.6 wrapping
When the content of the label reaches the boundaries, it starts wrapping. While wrapping, two strategies can
be applied:
l WIDGET_TEXT_WORD_WRAP: Specifies if the complete word must be moved to the next line when
you reach the right margin. This is the default wrapping property.
l WIDGET_TEXT_CHAR_WRAP: Specifies if the characters in a word must be moved to the next line
when you reach the right margin.
The following image illustrates the character wrapping property:
Syntax
JavaScript: wrapping
Lua: wrapping
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
18. Line
The Line widget allows you to draw a horizontal or a vertical line on a Form. It is used as a separator between
widgets for a better visual experience.
Line widget provides you with an option to set Basic Properties and Layout Properties.
Platform Specific
Basic Properties Layout Properties
Properties
id margin toolTip
info marginInPixel
isVisible thickness
skin
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
You can use a Line widget to indicate a separator between two widgets which are placed side-by-side or
placed one below the other.
l Orientation of a line can be horizontal or vertical. The orientation of the line depends on the widget it is
placed in. If a Line widget is placed in an HBox, it becomes a VLine and if it placed in a VBox or a Form,
it becomes an HLine.
Platform Appearance
Android
BlackBerry
iPhone
Platform Appearance
Windows Phone
1. From the IDE, drag and drop the Line widget in between two widgets which are aligned side-by-side in
an HBox or one below the other in a VBox or a Form.
2. Specify the thickness of the line in pixels.
Customizing Appearance
You can customize the appearance of the Line widget by using the following properties:
l id
l info
l isVisible
l skin
18.1.1 id
id is a unique identifier of Line consisting of alpha numeric characters. Every Line should have a unique id
within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Platform Availability
18.1.2 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
18.1.3 isVisible
This property controls the visibility of the line widget on the form.
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the Visibility of the widget is controlled by the data property of the segment.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
18.1.4 skin
Specifies the look and feel of the Line when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l margin
l marginInPixel
l thickness
18.2.1 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
18.2.2 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
18.2.3 thickness
Specifies the thickness of the widget in pixels. The pixel values are scaled to density specific pixels by the
respective platforms.
Syntax
JavaScript: thickness
Lua: thickness
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l toolTip
18.3.1 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Creating a Line.
var line1 = new kony.ui.Line(lineBasicConf,lineLayoutConf,linePSPConf);
Yes
Platform Availability
l toolTip
toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Creating a Line.
var line1 = new kony.ui.Line(lineBasicConf,lineLayoutConf,linePSPConf);
Yes
Platform Availability
19. Link
Link widget allows you to define a hyperlink that you can interact with (select and click) and navigate to an
external location or a location within the application.
Link provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties, and
Events.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight blockedUISkin
id contentAlignment contextMenu
info hExpand externalURL
isVisible margin glowEffect
skin marginInPixel hoverSkin
text padding showProgressIndicator
paddingInPixel submitURL
widgetAlignment toolTip
Events Deprecated
onClick focusImage
preOnclickJS image
postOnclickJS normalImage
The link widget by default does not have any border surrounding it (unless specified in the skin) and
looks like plain text unlike a button widget which has a frame and a border.
The following image illustrates a Label widget with a Link and Button widgets:
In the above image, you can notice that link widget looks like plain text unlike the button widget.
The following images illustrate a Button widget between two TextArea widgets and a Link widget
between two TextArea widgets:
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
Platform Appearance
Android
Platform Appearance
BlackBerry
iPhone
Windows Phone
Mobile Web (Advanced)
1. From the IDE, drag and drop the Link widget onto a Form (occupies the complete available width). Or,
based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the Link widget in the horizontal direction, place an HBox on the Form and
drag and drop the Link inside the HBox and resize accordingly.
b. If you want to resize the Link widget in the vertical direction, place an HBox on the Form and
place a VBox inside the HBox; and drag and drop the Link inside the VBox and resize
accordingly.
2. Use the text property to specify the text that must be displayed as a link when rendered.
3. Specify the action that must take place when the link is clicked (navigation to another Form or website
etc.) using the onclick event.
Customizing Appearance
You can customize the appearance of the Link widget by using the following properties:
Here is a sample use case that explains you to go to a url on click of the link:
1. From the Kony Studio, drag and drop the Link widget onto a Form as frm1.
2. Create another Form as frm2 and drag and drop a Browser widget on it.
3. Double-click the Link widget in the form frm1 and locate onClick property from the properties window.
4. Click the ellipse button to define an event. The Event Editor window appears.
5. Right-click on Action Sequence and select Navigate to Form/Popup. The Form/Popup option
appears.
6. From the left window, select the form frm2 from the dropdown and click OK.
7. Navigate to the Form frm2, double-click browser widget and locate masterData property from the
properties window.
8. Click the ellipse button to define the URL. The Browser Data window appears.
9. Select the option URL and enter the URL as www.google.com.
10. Click OK.
11. Build the application for a rich client to see the results.
Important Considerations
l If you do not specify a skin, the default skin is applied to the link (link appears in blue font and is
underlined).
l If you do not specify a focusSkin, the default focus skin is applied to the link (link appears in black font
and is underlined).
l If you specify a skin or focusSkin without an underline, when rendered, the link will appear without an
underline on the platform.
l For Server side Mobile Web (basic), font styles are not supported.
l focusSkin
l id
l info
l isVisible
l skin
l text
l toolTip
19.1.1 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and SPA (Windows 7.5 nth) platforms
19.1.2 id
id is a unique identifier of Link consisting of alpha numeric characters. Every Link should have a unique id
within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
//Reading Id of Link.
alert("Link id::"+link1.id);
Yes
Platform Availability
19.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
19.1.4 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the Visibility of the widget is controlled by the data property of the segment.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
19.1.5 skin
Specifies the look and feel of the Link when not in focus.
Note: On Windows Tablet platform, because of native behavior a skin with font style as underline is not
supported.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
19.1.6 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
19.1.7 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
contentAlignment:CONTENT_ALIGN_TOP_LEFT, containerWeight:100};
var linkPSP = {};
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l widgetAlignment
19.2.1 containerWeight
Specifies the percentage of the parent width that should allocated to the widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
width except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
19.2.2 contentAlignment
Specifies the alignment of the text on the Link with respect to its boundaries. A default value CONTENT_
ALIGN_CENTER is assigned for all platforms. To choose another alignment, click the drop-down arrow and
select the desired alignment. However, to change the default value on a particular platform, select the button
next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_CENTER (the default value for all platforms is center; content is aligned at the
center of the button)
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the button.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the button.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the button.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the button.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the button.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the button.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the button.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
button.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the button.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
19.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Server side Mobile Web platform does not support the Expand property. This is because a widget in a
Server side Mobile Web cannot expand or contract based on the neighboring widget (default behavior of a
widget in a Server side Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Desktop Web, and SPA
19.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
19.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
19.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
19.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
19.2.8 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_LEFT
l WIDGET_ALIGN_CENTER - (BlackBerry 10 supports this option)
l WIDGET_ALIGN_MIDDLE_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT - (BlackBerry 10 supports this option)
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l blockedUISkin
l contextMenu
l externalURL
l glowEffect
l hoverSKin
l showProgressIndicator
l submitURL
l toolTip
19.3.1 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For Server side Mobile Web, if you want to use this property, then set it in the IDE against
blockedUISkin property. Only then Server side Mobile Web shows blocked UI when the action is performed.
This is also applicable for Server side Mobile Web iPhone, Android, and Blackberry (Touch) devices.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
19.3.2 contextMenu
A context menu is a menu that appears upon clicking a widget. A context menu typically offers a limited set of
choices that are applicable for that widget. Usually these choices are actions, related to the widget.
If you define a context menu for a widget, the steps involved to invoke the context menu on a platform and the
appearance of the context menu varies.
In Desktop Web, on right-click mouse the context specific menu will be displayed with the array of menu
items.
l You can invoke the context menu either by clicking on the widget (applicable only on BlackBerry
versions 6.x and above) or by a long press on the screen (or trackpad).
l You can choose to add icons to indicate the menu items in the context menu (applicable only on
BlackBerry versions 6.x and above).
l BlackBerry layouts menu items in a 3 item grid view. The menu items Switch Application, Help, Close,
and Full Menu are added automatically based on the number of menu items added in the context menu.
For example, If you add a context menu with 2 items, it will display Full Menu item along with the items
added. If you add a context menu with 3 items, it will display Full Menu, Help, Switch Application items
along with the items added.
l If the focus is on a widget that has a context menu; and if you click the "menu key", the Full Menu
appears along with the context menu items.
l On Blackberry Non-Touch Devices, only Full Menu item is displayed irrespective of number of items
added in the context menu.
Note: The context menu items in the Full Menu will disappear if the focus is shifted from the widget which
has the context menu.
The following images illustrates the context menu on various BlackBerry devices:
l You can invoke the context menu by a long press on the widget.
l The menu items are displayed as text (no support for icons).
l There is no support for sub-menus in a context menu.
The following image illustrates the context menu on Android platform:
Syntax
JavaScript: contextMenu
Lua: contextmenu
Type
JavaScript: Array(kony.ui.MenuItem)
Lua: Table
Read / Write
JavaScript Example
Note: On Android platform, the image icon, separator, and submenu properties are not supported.
No
Platform Availability
l Android/Android Tablet
l BlackBerry
l Windows Phone (Mango)
19.3.3 externalURL
Specifies that the URL must be opened directly from the web site without having to contact the Kony Server.
For example, in a Banking Application, for Terms and Conditions section, you can provide an external URL
which will open the required section in a new window rather than opening the section in the same window.
Syntax
JavaScript: externalURL
Lua: externalurl
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
19.3.4 glowEffect
Specifies if there must be glow effect when you touch the link.
Default: false
Note: The glow appears on the button only for a moment on touch and disappears.
The following image illustrates a link with and without the glow effect:
Syntax
JavaScript: glowEffect
Lua: gloweffect
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
19.3.5 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
JavaScript Example
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
19.3.6 showProgressIndicator
Specifies if the progress indicator must be displayed when the link is clicked. This is typically set to true, if it
is known at design time that the link onClick event handling is going to trigger a long running call.
Default: true
Syntax
JavaScript: showProgressIndicator
Lua: showprogressindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Server side Mobile Web (advanced)
19.3.7 submitURL
Specifies the URL to which the current Form data should be submitted, without contacting Kony Server. This
is typically required when the data collection is done using Kony Studio Form but is actually posted to a third-
party site.
For example, for an application that requires the user to provide confidential data, you can route the data
directly to the server of the website without contacting the Kony Server using the externalURL property. Doing
so, opens the resultant site in the same window rather than opening it in a new window.
Default: false
If set to false, then the URL is submitted contacting the Kony Server.
If set to true, then the URL is submitted without contacting the Kony Server.
Syntax
JavaScript: submitURL
Lua: submiturl
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
19.3.8 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
l onClick
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
19.4.1 onClick
An event callback that is invoked by the platform when the user performs a click action on the link.
Signature
JavaScript: onClick
Lua: onclick
The onClick event callback accepts additional parameters when a Link widget is placed in a segment row or
section template.
Signature
Input Parameters
Read / Write
JavaScript Example
//The below function is the callback function for onClick event of Link.
function onClickCallBack(link)
{
//Write your logic here.
}
Platform Availability
19.4.2 preOnclickJS
This event allows the developer to execute custom javascript function before the onClick callback of the Link
is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
19.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the Link is
invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
l focusImage
l image
l normalImage
19.5.1 focusImage
Default: False
Type
Boolean
Read / Write
Yes
Yes
Platform Availability
19.5.2 image
Specifies the scale mode of the downloaded image. You can choose one of the following Scale Modes:
default
Specifies that the downloaded image must occupy the allocated width. This is the default option.
maintainaspectratio
Specifies that the downloaded image must maintain the aspect ratio (the proportional relationship of the
screen's physical width to its height).
retaininitialimagedimensions
Specifies that the downloaded image must retain the initial image dimensions.
Type
Number
Read / Write
No
Yes
Platform Availability
19.5.3 normalImage
Specifies the look and feel of the widget when not in focus.
Type
Boolean
Read / Write
Yes
Yes
Platform Availability
20. ListBox
List Box displays a list of items as a drop-down box and allows you to select a one or more items from the list.
The data model for ListBox widget is a key value pair. The key is hidden part of the model while value is
displayed to the user.
Note: ListBox does not support multiple selection from Release 3.0 onwards. However, if you have
upgraded from a version prior to Release 3.0 and used multiple selection, the backward compatibility will be
maintained. If you require multiple selection capability, use either a CheckBox or a Segment with multiple
selection enabled.
ListBox provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
and Events.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight applySkinsToPopup
id contentAlignment blockedUISkin
info hExpand dropDownImage
isVisible margin groupCells
masterData marginInPixel hoverSkin
masterDataMap padding nativeListFieldSkin
selectedKey paddingInPixel nativeListFieldFocusSkin
selectedKeys vExpand placeholder
selectedKeyValue widgetAlignment placeholderSkin
selectedKeyValues popupIcon
skin popupTitle
singleLineText
singleLineTextInPopup
textTruncatePosition
textTruncatePositionInPopup
tickedImage
toolTip
untickedImage
viewType
viewConfig
Events Deprecated
onSelection multiple
preOnclickJS placeholderi18nkey
postOnclickJS selectedkeys
selectedkeyvalues
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
The appearance of the widget with the default properties (with and without skin) on various platforms is as
follows:
Android
BlackBerry
iPhone
Important Considerations
l focusSkin
l id
l info
l isVisible
l masterData
l masterDataMap
l selectedKey
l selectedKeys
l selectedKeyValue
l selectedKeyValues
l skin
20.1.1 focusSkin
Note: In Desktop Web platform, Chrome browser does not support if the properties defined in font tab are
different for skin and focusSkin.
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
20.1.2 id
id is a unique identifier of ListBox consisting of alpha numeric characters. Every ListBox should have a unique
id within a Form.
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
20.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
20.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can also set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
20.1.5 masterData
Specifies the set of values that must be displayed for the user to make a selection from the available choices.
Default: User Defined (You must specify the key and the display value)
To specify the set of values, click the Ellipsis ( ) button against the property to open the MasterData for
ListBox window.
In the Master Data window, you can specify the Key, Display Value, i18N Key, and the Accessibility Config.
You can use the Selected column to specify the choice to be shown as selected when rendered. You can do
this by selecting true against the choice that you wish to show as selected.
Note: Select the Use as test data in preview mode option if you want to see the data you enter in the Master
Data when you Quick Preview. (For more information on Quick Preview, see the Kony Studio User Guide.
Note: If the key or the display value is null/nil, the value will not be listed as one of the available choices.
Note: The accessibilityConfigObject is optional and the object should contain the keys as defined in the
accessibilityConfig property.
[
["key1","value1",accessibilityConfigObject],
["key2","value2",accessibilityConfigObject],......,
["keyn","valuen",accessibilityConfigObject]
]
Syntax
JavaScript: masterData
Lua: masterdata
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
20.1.6 masterDataMap
Specifies the set of values from which you can make selections.You must specify a key and a value in a
master data map.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But
you can always read and write data to it.
Note: This property is applicable only if the masterData is not set. You must use either the masterData or
the masterDataMap to set data for the CheckBox.
You must specify a key, value, and the accessibilityConfig in a master data map.
Two","accessibilityConfig":acObject},...,
["mykey":"itemn","myvalue":"Item N","accessibilityConfig":"acObject}
],
"mykey",
"myvalue"
]
Note: The accessibilityConfig is the standard key expected in each items data array. It is optional and the
object should contain the keys as defined in the accessibilityConfig property.
Note: If the key or the value is null/nil, the value will not be listed as one of the available choices.
Syntax
JavaScript: masterDataMap
Lua: masterdatamap
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
listbx.masterDataMap = [[{"mykey":"key1","myvalue":"value1","accessibility
Config":acObject}, {"mykey":"key2","myvalue":"value2", "accessibilityConfi
g":acObject}, {"mykey":"key3","myvalue":"value3", "accessibilityConfig":ac
Object}], "mykey","myvalue"];
No
Platform Availability
20.1.7 selectedKey
Syntax
JavaScript: selectedKey
Lua: selectedkey
Type
JavaScript: String
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
20.1.8 selectedKeys
Returns the keys from the data representing the selected keys.
Syntax
JavaScript: selectedKeys
Type
JavaScript: Array
Read / Write
JavaScript Example
//Defining the properties for Listbox with the selectedKeys: "key1", "key2"
var listBasic ={id:"listbx",isVisible:true, masterData:[["key1", "value1"],
["key2", "value2"],["key3", "value3"]], skin:"listSkin", focusSkin:"listFS
kin", selectedKeys:["key1","key2"]};
var listLayout = {widgetAlignment:constants.WIDGET_ALIGN_CENTER, padding:[
0,0,0,0], margin:[0,0,0,0], containerWeight:40, hExpand:false};
var listPSP = {};
No
Platform Availability
20.1.9 selectedKeyValue
Syntax
JavaScript: selectedKeyValue
Lua: selectedkeyvalue
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
20.1.10 selectedKeyValues
Returns the array of selected key-value pair from the data representing the selected key and value.
Syntax
JavaScript: selectedKeyValues
Type
JavaScript: Array
Read / Write
JavaScript Example
No
Platform Availability
20.1.11 skin
Note: In Desktop Web platform, Chrome browser does not support if the properties defined in font tab are
different for skin and focusSkin.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Defining the properties for Listbox with the skin:"listSkin", Skin with
the same name should be created through IDE or handcode
var listBasic ={id:"listbx", isVisible:true, masterData:[["key1", "value
1"], ["key2", "value2"], ["key3", "value3"]], skin:"listSkin", focusSkin:"
listFSkin"};
var listLayout = {widgetAlignment:constants.WIDGET_ALIGN_CENTER, padding:[
0,0,0,0], margin:[0,0,0,0], containerWeight:40, hExpand:false};
var listPSP = {};
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
20.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
20.2.2 contentAlignment
Specifies the alignment of the text for a ListBox with respect to its boundaries.
Default:CONTENT_ALIGN_CENTER
Note: This property is applicable only when the view is set as wheel type.
Note: On SPA platform, only two options are supported CONTENT_ALIGN_MIDDLE_LEFT and
CONTENT_ALIGN_MIDDLE_RIGHT. The default option is CONTENT_ALIGN_MIDDLE_LEFT.
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the ListBox.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the ListBox.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the ListBox.
l CONTENT_ALIGN_MIDDLE_LEFT - Specifies the text should align at middle left of the ListBox.
(Android and SPA platforms support this option only).
l CONTENT_ALIGN_CENTER - Specifies the text should align at center of the ListBox. (Android
platform supports this option only).
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the ListBox.
(Android and SPA platforms support this option only).
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the ListBox.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
ListBox.
l CONTENT_ALIGN_BOTTOM_RIGHT- Specifies the text should align at bottom right of the ListBox.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
20.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, and SPA
20.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
20.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
20.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ListBox and Form widgets on Mobile
Web platform. Padding is not supported by Windows Mobile browser for Box and Image Gallery.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
20.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
20.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
20.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
focusSkin:"listFSkin"};
var listLayout = {widgetAlignment:constants.WIDGET_ALIGN_CENTER, padding:[
0,0,0,0], margin:[0,0,0,0], containerWeight:40, hExpand:false};
var listPSP = {};
Yes
Platform Availability
l applySkinsToPopup
l blockedUISkin
l dropDownImage
l groupCells
l hoverSkin
l multiSelect
l multiSelectRows
l nativeListFieldSkin
l nativeListFieldFocusSkin
l placeholder
l placeholderSkin
l popupIcon
l popupTitle
l singleLineText
l singleLineTextInPopup
l textTruncatePosition
l textTruncatePositionInPopup
l tickedImage
l toolTip
l untickedImage
l viewType
l viewConfig
l wheelBackgroundColor
20.3.1 applySkinsToPopup
Specifies if the skin and focusSkin properties specified for the ListBox must be applied to the popup that
appears when you click on the ListBox.
Default: false
Syntax
JavaScript: applySkinsToPopup
Lua: applyskinstopopup
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
20.3.2 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
20.3.3 dropDownImage
Specifies the image to be used for the drop-down box indicator (inverted triangle by default). The image you
specify is used to depict the drop-down box. If you do not specify an image, the drop-down box displays the
default image (inverted triangle).
Note: For Windows Phone platform, you can specify the image from the ListBox skin.
Note: For iOS platform, the drop down image should be of size 20px * 33px for non retina devices and for
retina devices the image size should be 40px * 66px.
Syntax
JavaScript: dropDownImage
Lua: dropdownimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l BlackBerry
20.3.4 groupCells
Specifies if all the rows in the ListBox should be grouped using a rounded corner background and border.
Default: false
Note: For iOS platform, this property is applicable only when viewType is set as LISTBOX_VIEW_TYPE_
TABLEVIEW.
Syntax
JavaScript: groupCells
Lua: groupcells
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
20.3.5 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
20.3.6 multiSelect
Specifies if the widget allows multiple values to be selected from the drop down list.
Default: false
Syntax
JavaScript: multiSelect
Type
JavaScript: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
20.3.7 multiSelectRows
Specifies the number of visible rows in the ListBox. A ListBox in Desktop Web can grow to any length. This
property is used to restrict the number of rows visible in a ListBox.
Note: This property is displayed only when the multiSelect is set to true.
Default: none
Syntax
JavaScript: multiSelectRows
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
20.3.8 nativeListFieldSkin
Specifies the skin that is applied to each item in the native popup that appears when you click on the ListBox.
Syntax
JavaScript: nativeListFieldSkin
Lua: nativelistfieldskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l BlackBerry
20.3.9 nativeListFieldFocusSkin
Specifies the skin that is applied to a focused item in the native popup that appears when you click on the
ListBox.
Syntax
JavaScript: nativeListFieldFocusSkin
Lua: nativelistfieldfocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l BlackBerry
20.3.10 placeholder
Specifies the temporary or substitute text (a hint provided as a word or phrase) that must be displayed on the
ListBox until the actual selection is made. If you do not specify the placeholder text, the first option in the list
is shown as the selected value.
If placeholder is set then by default (without user selecting any option) selectedKey and selectedKeyValue
properties will return null/nil.
If placeholder is not set then by default the first entry should be shown as selected and selectedKey and
selectedKeyValue properties will return the first options key-value pair.
Syntax
JavaScript: placeholder
Lua: placeholder
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l BlackBerry
l Windows Phone
l Windows Kiosk
20.3.11 placeholderSkin
This property reads the font color set in the skin and ignores the other attributes.Android does not support
setting a background color for a placeholder.
Syntax
JavaScript: placeholderSkin
Lua: placeholderskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
20.3.12 popupIcon
Specifies the icon that appears in the title area of the popup (on the top left side of the popup). For the popup to
appear, you have to expand or click the Listbox.
Default: empty
The figure below depicts how a Popup Icon in a List Box looks:
Syntax
JavaScript: popupIcon
Lua: popupicon
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
20.3.13 popupTitle
Default: Please Select (This is the default text that will appear as the title of the Listbox)
Syntax
JavaScript: popupTitle
Lua: popuptitle
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Symbian
20.3.14 singleLineText
If the length of the text is more than the space available, the selected options text will be displayed truncated,
in a single line with (...) ellipses. The position of the ellipses is controlled by textTruncatePosition property.
The default ellipses position is at the end of the line if textTruncatePosition property is not set.
Default:False
Syntax
JavaScript: singleLineText
Type
JavaScript: Boolean
Read / Write
JavaScript Example
No
Platform Availability
20.3.15 singleLineTextInPopup
If the length of the text is more than the space available, the popup options text will be displayed truncated, in
a single line with (...) ellipses. The position of the ellipses is controlled by textTruncatePositionInPopup
property. The default ellipses position is at the end of the line if textTruncatePositionInPopup property is not
set.
Default:False
Syntax
JavaScript: singleLineTextInPopup
Type
JavaScript: Boolean
Read / Write
JavaScript Example
No
Platform Availability
20.3.16 textTruncatePosition
When the property singleLineText is set to true, this property controls the position of the ellipses (...), in the
selected option text.
l constants.TEXT_TRUNCATE_START
l constants.TEXT_TRUNCATE_MIDDLE
l constants.TEXT_TRUNCATE_END
Default:constants.TEXT_TRUNCATE_END
Syntax
JavaScript: textTruncatePosition
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform Availability
20.3.17 textTruncatePositionInPopup
When the property singleLineTextInPopup is set to true, this property controls the position of the ellipses (...),
in the popup options text.
l constants.TEXT_TRUNCATE_START
l constants.TEXT_TRUNCATE_MIDDLE
l constants.TEXT_TRUNCATE_END
Default:constants.TEXT_TRUNCATE_END
Syntax
JavaScript: textTruncatePositionInPopup
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform Availability
20.3.18 tickedImage
Note: If you specify a ticked Image, ensure that you also specify an unTickedimage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: tickedImage
Lua: tickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
20.3.19 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
20.3.20 unTickedImage
Note: If you specify an unTickedImage, ensure that you also specify a tickedImage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: unTickedImage
Lua: untickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
20.3.21 viewType
Default: LISTBOX_VIEW_TYPE_LISTVIEW
Note: For toggleView you can further select the View Style as plain, bordered, or bar.
listView
Note: If you select the listView and do not specify a selection in the masterData, the default behavior of the
platform is to select the first entry on the list.
tableView
toggleView
onscreenwheel
spinner
The below image illustrate the nextprevtoolbar set to a listbox. The highlighted toolbar is achieved on
setting the Mode as onscreenwheel to the List Box and Input Accessory View Type as nextprevtoolbar to
the Form.
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet ( only Spinner view is available for the platform)
20.3.22 viewConfig
Specifies the view configuration for different viewtypes. You can set the configuration for toggle view.
viewStyle: Accepts the view style. This property is not supported in iOS7 and above versions.
Following are the available options:
l LISTBOX_TOGGLE_VIEW_STYLE_PLAIN
l LISTBOX_TOGGLE_VIEW_STYLE_BORDERED
l LISTBOX_TOGGLE_VIEW_STYLE_BAR
equalSegments: Specifies the boolean value which indicates if the segments must be equal.
enableTint: Specifies the boolean value to enable tintColor property. When this property is set
to true, tintColor property is displayed.
tintColor: Specifies the tint color in RGB format. The default color is blue.
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
Yes
Platform Availability
l iPad
l iPhone
20.3.23 wheelBackgroundColor
Specifies the background color for the wheel that is displayed when you click the ListBox. This property is
applicable only when you set the viewType as LISTBOX_VIEW_TYPE_ONSCREENWHEEL.
Syntax
JavaScript: wheelBackgroundColor
Type
JavaScript: JSObject
Read / Write
JavaScript Example
No
Platform Availability
l iPad
l iPhone
l onSelection
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
20.4.1 onSelection
An event callback that is invoked by the platform when an item is selected or deselected.
Note: For Server side Mobile Web (Basic devices), this event is fired only when you make a selection and
then write an onClick event for a button.
Note: This callback is not invoked if the selectedKey and selectedKeyValue are changed programmatically.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
//The below function is the call back function for onSelection event.
function onSelectionCallBck(list)
{
alert("onSelection event triggered");
}
{
//Defining the properties for Listbox with onSelection:onSelectionCallBck.
var listBasic ={id:"listbox",isVisible:true, masterData:[["key1", "value
1"],["key2", "value2"],["key3", "value3"]],
onSelection:onSelectionCallBck};
Platform Availability
Available on all platforms except Server side Mobile Web (Basic). This event is not supported because
Java script is not supported on browsers of basic devices. To achieve a functionality similar to this on
Server side Mobile Web (Basic), you must create an additional button for the Basic version of the Server
side Mobile Web with an onclick event and attach an ondone closure.
20.4.2 preOnclickJS
This event allows the developer to execute custom javascript function before the onClick callback of the
ListBox is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file
under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
//The below function is the call back function for preOnclickJS event.
function preOnclickJSCallBck(list)
{
alert("preOnclickJS event triggered");
}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
20.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the
ListBox is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript file
under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
//The below function is the call back function for postOnclickJS event.
function postOnclickJSCallBck(list)
{
alert("postOnclickJS event triggered");
}
Yes
Platform Availability
l listStyle
l multiple
l placeholderi18nKey
l selectedkeys
l selectedkeyvalues
20.5.1 listStyle
Specifies the appearance of the List Box. You can set the style to one of the following:
If you change the List Style to Spinner Style, the appearance of the ListBox is as follows:
Type
Number
Read / Write
No
Yes
Platform Availability
20.5.2 multiple
Specifies if the widget allows multiple values to be selected from the drop down list.
Default: false
Note: List Box does not support multiple selection from Release 3.0 onwards. However, if you have
upgraded from a version prior to Release 3.0 and used multiple selection, to maintain backward
compatibility, this property is enabled. If you then change the value to false, you cannot change the value
back to true.
Note: If you require multiple selection capability, use either a CheckBox widget or a Segment with multiple
selection enabled.
Type
Boolean
Read / Write
No
Yes
Platform Availability
Available on all platforms except Mobile Web (basic) and Win Mobile6x.
20.5.3 placeholderi18nKey
Specifies the i18n key for the placeholder text to be used for internationalization.
Type
String
Read / Write
No
Yes
Platform Availability
l BlackBerry
l J2ME
20.5.4 selectedKey
Type
String
Read / Write
Yes (Write)
If a Form frm1 has a ListBox lstbx1, and the master data is as follows:
frm1.lstbx1.masterdata = {{"A","Asia"},{"E","Europe"},{"NA","North
America"} }
frm1.lstbx1.selectedkey = "A"
No
Platform Availability
Available on all platforms except Mobile Web (basic) and Win Mobile6x.
20.5.5 selectedKeyValue
Type
Object
Read / Write
Yes (Read)
If a Form frm1 has a ListBox lstbx1, and the master data is as follows:
frm1.lstbx1.masterdata = {{"A","Asia"},{"E","Europe"},{"NA","North
America"} }
When the user makes a selection, you can know the user selection by entering the following:
For example, if the user selected Asia, the value returned is {"A","Asia"}
No
Platform Availability
Available on all platforms except Mobile Web (basic) and Win Mobile6x.
21. MenuContainer
A MenuContainer is a horizontal strip that can contain any number of Menus and MenuItems. The Menus
provide the access to functions such as navigate to a specified form, access to an external link, or a specific
user action.
A Menu Template currently allows you to drag and drop the following widgets:
l HBox
l VBox
l Image
l Label
l Link
For example, in a Retail Application, you can have menus showing various segments of products. You
can add number of menu items on a MenuContainer.
MenuContainer provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Property, Events, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
activeSkin containerWeight contextMenu
collapsedImage margin collapsedImage
data marginInPixel expandedImage
expandedImage padding viewType
hoverSkin paddingInPixel
id widgetAlignment
info
isVisible
menuItemTemplate
orientation
selectedMenuIndex
selectedMenuItem
skin
widgetDataMap
Event Methods
onClick addAll
onRightClick addDataAt
removeAll
removeAt
setData
setDataAt
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
children: [
{template: hbox2,
label2: {text: "Test Match"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "One Day Match"},
image2: "btn.png"
}
]
},
{template: hbox2,
label2: {text: "England"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Australia"},
image2: "btn.png"
}
} ]
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", isVisible: tr
ue, widgetDataMap: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
1. Go to Applications view.
2. Expand the application for which you want to use Menus.
3. Navigate to forms > desktop, right-click desktop and select New Form. The Create a New Form
window appears.
4. Enter a name for the form and click Finish. A new form is created.
Note: The MenuContainer should not be placed at the bottom of the form because the menu always
expands downwards. If still want to place the menu at the bottom of the form, ensure that you have
enough space to view the items when the menu is expanded.
6. To add menu, define a menu template as explained in templates section. You can define different
templates for menus and sub menus.
7. To assign the template to menu container, follow the below steps:
a. Select the MenuContainer and from the Widget Properties window and locate the
property menuItemTemplate. Set the template from the drop down menu.
b. Locate the property data and assign data to it. The following image illustrates the Master
Data for MenuBar window:
c. Right-click on the row MenuBar Data and select Add MenuItem. A row gets added.
Select Template ID, click Template Data to update the values for the properties
displayed.
d. To add sub menu items, set the subMenucolumn false/true to the respective menu
item. If the menu item is set to true you can add sub menu items.
e. To create a submenu item for a menu item, right-click on submenu item and select Add
MenuItem. A row gets added.
f. Select Template ID, click Template Data to update the values for the properties
displayed.
g. Once you are done, click OK. Following is the snapshot of a typical menu with sub menu
items.
l activeSkin
l data
l hoverSkin
l id
l info
l isVisible
l menuItemTemplate
l orientation
l selectedMenuIndex
l selectedMenuItem
l skin
l widgetDataMap
21.1.1 activeSkin
Syntax
JavaScript: skin
Type
JavaScript: String
Read / Write
JavaScript Example
Yes
Platform Availability
21.1.2 data
Specifies the menu items that must be displayed in the Menu. You can set the data in the below format.
//Data format
{ metaInfo : {"skin" : "skinname"} //skin is applied to the box.
template: boxRef2,
label1:{"skin":"someskin", "text":"foo", "isVisible":false} //JSObject w
ith write properties of the widget as keys with corresponding values.
image2:"icon.png" //JSObject with write properties of the widget as keys
with corresponding values.
children: [{Array of Child menu items}]
}
Note:
Template is the standard key which can be used optionally to override the common menuItemTemplate
provided with a specific template for the row. For template, always the value has to be valid box reference, if
not it falls back to common menuItemTemplate.
metaInfo is another standard key which can be used to specify some meta information about the row. For
example clickable and skin.
All write properties of the widget are allowed to be set as a part of the widget data while programming for the
menu items.
To add menu and sub menu items to the menu container, follow these steps:
Before proceeding, ensure that you have already created menu templates to be used in the data property.
1. To specify the values, click the Ellipsis button against the property to open the screen Master data for
MenuBar.
2. Right-click on MenuBar Data and select Add MenuItem. A Menu item is added.
3. Assign the Template Id and click Template Data to update the values for the properties displayed.
4. To add sub menu items, set the subMenucolumn false/true to the respective menu item. If the menu
item is set to true you can add sub menu items. Right-click on the menu item and select Add
MenuItem and update the data accordingly.
5. Once you are done, click OK.
Note: When you change a submenu to menu or viceversa, the data that is set will be lost and templateID
gets reset to default template.
Syntax
JavaScript: data
Type
JavaScript: JSObject
Read / Write
JavaScript Example
}
} ]
},
{template: hbox2,
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
Yes
Platform Availability
21.1.3 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Type
JavaScript: String
Read / Write
JavaScript Example
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Two"},
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Three"},
image2: "btn.png",
},
{template: hbox2,
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
Yes
Platform Availability
21.1.4 id
Syntax
JavaScript: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
21.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Type
JavaScript: JSObject
Read / Write
JavaScript Example
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
No
Platform Availability
21.1.6 isVisible
Default: true
Syntax
JavaScript: isVisible
Type
JavaScript: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
21.1.7 menuItemTemplate
Indicates a common template to be used for each menuItem while creating the menu items and filling the data.
Syntax
JavaScript: menuItemTemplate
Type
Read / Write
JavaScript Example
No
Platform Availability
21.1.8 orientation
Specifies how you can stack the widgets within the MenuContainer. You can set the orientation of the
MenuContainer as horizontal or vertical.
Default: MENUCONTAINER_POSITION_AS_HORIZONTAL
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: orientation
Type
JavaScript: Number
Read / Write
JavaScript Example
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"}, orientation:constants.MENUCONTAINE
R_POSITION_AS_HORIZONTAL};
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW, };
Yes
Platform Availability
21.1.9 selectedMenuIndex
JavaScript: selectedMenuIndex
Type
JavaScript: Array
Read / Write
JavaScript Example
No
Platform Availability
21.1.10 selectedMenuItem
Syntax
JavaScript: selectedMenuItem
Type
JavaScript: Array
Read / Write
JavaScript Example
},
{template: hbox2,
label2:{text: "Three Two Two"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Three Two Three"},
image2: "btn.png"
}
} ]
},
{template: hbox2,
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", isVisible: tr
ue, widgetDataMap: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
No
Platform Availability
21.1.11 skin
For more information on how to create and work with skins, see the Working with Applications section of the
Kony Studio User Guide.
Syntax
JavaScript: skin
Type
JavaScript: String
Read / Write
JavaScript Example
Yes
Platform Availability
21.1.12 widgetDataMap
Specifies the mapping information between the widget id's and the keys in the data.
Note: It is developer responsibility to ensure that widget data map to accommodate all the widget ids
required including the widgets referred in dynamic templates.
{
widgetID1: "dataId1",
widgetId2: "dataId2",
widgetId3: "dtaId3",
widgetId4: "secDataId1"
widgetId5: "secDataId2"
}
Syntax
JavaScript: widgetDataMap
Type
JavaScript: JSObject
Read / Write
JavaScript Example
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", isVisible: tr
ue, widgetDataMap: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
No
Platform Availability
l containerWeight
l margin
l marginInPixel
l padding
l paddingInPixel
l widgetAlignment
21.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform Availability
21.2.2 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Type
Read / Write
JavaScript Example
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
Yes
Platform Availability
21.2.3 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Type
JavaScript: Boolean
Read / Write
No
JavaScript Example
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Two"},
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Three"},
image2: "btn.png",
},
{template: hbox2,
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
Yes
Platform Availability
21.2.4 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox and Form widgets on Mobile
Web platform. Padding is not supported by Windows Mobile browser for Box and Image Gallery.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Type
Read / Write
JavaScript Example
Yes
Platform Availability
21.2.5 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Type
JavaScript: Boolean
Read / Write
No
JavaScript Example
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", widgetDataMap
: {label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
Yes
Platform Availability
21.2.6 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_TOP_LEFT
l WIDGET_ALIGN_TOP_CENTER
l WIDGET_ALIGN_TOP_RIGHT
l WIDGET_ALIGN_MIDDLE_LEFT
l WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT
Syntax
JavaScript: widgetAlignment
Type
JavaScript: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l contextMenu
l collapsedImage
l expandedImage
l viewType
21.3.1 contextMenu
The context specific menu will be displayed with the array of menu items (appropriate to the widget in focus)
on right-click mouse.
Default: None
a. Go to Applications View.
b. Expand the application for which you want to create a menu template.
c. Navigate to templates and expand menus, right-click desktop and select New Menu Template.
The Create a New Menu window appears.
d. Enter a Name for the template and click Finish.
e. A new form is created. Drag-drop an HBox and then a VBox within an HBox. You can add other
widgets within these widgets.
a. Go to Applications View.
b. Expand the application for which you want to create a contextmenu template.
c. Navigate to templates and expand contextmenus, right-click desktop and select New
ContextMenu Template. The Create a New ContextMenu window appears.
d. Enter a Name for the template and click Finish. A new form is created
e. Drag-drop a menucontainer.
f. (optional) Select menuItemTemplate from the drop down.
g. Define data using the data property.
3. Go to your project and then to desired form and drag-drop a hbox and navigate to Desktop Web
properties in Widget Properties window.
4. Select the contextmenu template from the dropdown.
Syntax
JavaScript: contextMenu
Type
Read / Write
JavaScript Example
Yes
Platform Availability
21.3.2 collapsedImage
Note: This property is displayed only when the viewType is selected as MENU_CONTAINER_VIEW_
TYPE_TREEVIEW.
Syntax
JavaScript: skin
Type
JavaScript: String
Read / Write
JavaScript Example
Yes
Platform Availability
21.3.3 expandedImage
Note: This property is displayed only when the viewType is selected as MENU_CONTAINER_VIEW_
TYPE_TREEVIEW.
Syntax
JavaScript: skin
Type
JavaScript: String
Read / Write
JavaScript Example
Yes
Platform Availability
21.3.4 viewType
Default: MENU_CONTAINER_VIEW_TYPE_DROPDOWNVIEW
Note: MenuContainer first level is always horizontal when the view is set as DROPDOWNVIEW and
DROPLINEVIEW.
Syntax
JavaScript: viewType
Type
JavaScript: Number
Read / Write
JavaScript Example
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", , isVisible:
true, widgetDataMap: {label2: "label2", image2: "image2"}, orientation:con
stants.MENUCONTAINER_POSITION_AS_HORIZONTAL};
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={viewType: constants.MENU_CONTAINER_VIEW_DROPDOWNVIEW};
Yes
Platform Availability
l onClick
l onRightClick
21.4.1 onClick
An event callback is invoked by the platform when the user performs a click action on the MenuContainer.
Signature
Input Parameters
Read / Write
JavaScript Example
if(itemData.label2 == "One") {
frmOne.show();
} else if(itemData.label2 == "Two") {
frmTwo.show();
}
}
children: [
{template: hbox2,
label2: {text: "Three Two One One"},
image2: "btn.png",
},
{template: hbox2,
label2: {text: "Three Two One Two"},
image2: "btn.png",
}
]
},
{template: hbox2,
label2:{text: "Three Two Two"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Three Two Three"},
image2: "btn.png"
}
} ]
},
{template: hbox2,
label2:{text: "Four"},
image2: "btn.png",
children: []
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", viewType: con
stants.MENU_CONTAINER_VIEW_DROPDOWNVIEW, widgetDataMap: {label2: "label2",
image2: "image2"}, onClick:onClickCalBck };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={};
Yes
Platform Availability
21.4.2 onRightClick
An event callback is invoked by the platform when the user performs a right-click action on the
MenuContainer.
Signature
Input Parameters
Read / Write
JavaScript Example
if(itemData.label2 == "One") {
frmOne.show();
} else if(itemData.label2 == "Two") {
frmTwo.show();
}
}
Yes
Platform Availability
l addAll
l addDataAt
l removeAll
l removeAt
l setData
l setDataAt
21.5.1 addAll
This method allows you to add new data to the menu container widget. The new data is appended to the
existing data.
Signature
JavaScript: addAll(data)
Input Parameters
Return Values
None
JavaScript Example
},
{template: hbox2,
label2: {text: "Science"},
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Sports"},
image2: "btn.png",
children: [
{template: hbox2,
label2: {text: "Football"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Cricket"},
image2: "btn.png",
children: [
{template: hbox2,
label2: {text: "India"},
image2: "btn.png",
children: [
{template: hbox2,
label2: {text: "Test Match"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "One Day Match"},
image2: "btn.png"
}
]
},
{template: hbox2,
label2: {text: "England"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Australia"},
image2: "btn.png"
}
} ]
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", viewType: con
stants.MENU_CONTAINER_VIEW_DROPDOWNVIEW, isVisible: true, widgetDataMap: {
label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={};
Error Codes
None
Platform Availability
21.5.2 addDataAt
Allows you to add an array of menu items at a given index. The new data is placed before the index. The
existing menu items are pushed to the next row.
Signature
Input Parameters
if at any level of the hierarchy if a provided position is not found, it is simply added to the last
available menu item.
For example, addDataAt(data, [1, 2, 3]) if the 3rd row is not found, then menu items defined will be
added under the last available menu item which in this case will be the 2nd position. Which means
the data is actually added to the position [1, 2, 2].
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
21.5.3 removeAll
This method is used to remove all the menu items and sub menus from the menu container.
Signature
JavaScript: removeAll()
Input Parameters
None
Return Values
None
JavaScript Example
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Science"},
image2: "btn.png",
children: []
},
{template: hbox2,
label2: {text: "Sports"},
image2: "btn.png",
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", viewType: con
stants.MENU_CONTAINER_VIEW_DROPDOWNVIEW, isVisible: true, widgetDataMap: {
label2: "label2", image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={};
Error Codes
None
Platform Availability
21.5.4 removeAt
This method is used to remove the menu item from hierarchy based on the index provided.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
JavaScript: removeAt(Index)
Input Parameters
Return Values
None
JavaScript Example
menu1.removeAt ([0,1]);
Error Codes
None
Platform Availability
21.5.5 setData
This method allows you to set new data to the menuContainer widget. When you set new data, the existing
data will be replaced with the new data.
Signature
JavaScript: setData()
Input Parameters
Return Values
None
JavaScript Example
image2: "btn.png"
},
{template: hbox2,
label2: {text: "One Day Match"},
image2: "btn.png"
}
]
},
{template: hbox2,
label2: {text: "England"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Australia"},
image2: "btn.png"
}
} ]
}
];
Error Codes
None
Platform Availability
21.5.6 setDataAt
This method allows you to set/modify the menu item at a particular index in the hierarchy with in the
menuContainer.
Signature
Input Parameters
if at any level of the hierarchy if a provided position is not found, it is simply added to the last
available menu item.
For example, addDataAt(data, [1, 2, 3]) if the 3rd row is not found, then menu items defined will be
added under the last available menu item which in this case will be the 2nd position. Which means
the data is actually added to the position [1, 2, 2].
Return Values
None
JavaScript Example
{template: hbox2,
label2: {text: "England"},
image2: "btn.png"
},
{template: hbox2,
label2: {text: "Australia"},
image2: "btn.png"
}
} ]
}
], isVisible:true, menuItemTemplate: hbox2, skin: "mnuSkin", viewType: con
stants.MENU_CONTAINER_VIEW_DROPDOWNVIEW, widgetDataMap: {label2: "label2",
image2: "image2"} };
var mnuLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
paddingInPixel:true, marginInPixel:true, widgetAlignment:constants.WIDGET_
ALIGN_TOP_LEFT};
var mnuPSP ={};
Error Codes
None
Platform Availability
In Kony platform, a menu template is a container which can hold widgets in it. You can customize the behavior
and look and feel of the menu template. The customized behavior is applied across the forms where the Menu
Templates are used.
l MenuContainer
l Menu Template
MenuContainer: It is a parent container which acts as a menu when a Menu Template is mapped to it.
MenuTemplate: It is a container which holds widgets in it. You can define multiple templates to be used for
menus and sub menus.
A Menu Template currently allows you to drag and drop the following widgets:
l HBox
l VBox
l Image
l Label
l Link
You can create a multiple templates that can be used for menus and sub menus.
1. Go to Applications View.
2. Expand the application for which you want to create a menu template.
3. Navigate to templates > menus, right-click desktop and select New Menu Template. The Create a
New Menu window appears.
Note: Only HBox and VBox are supported on the form. You can put other widgets
within these widgets.
iv. Drag and drop the required widgets onto the HBox/VBox. Set the properties of these
widgets.
v. A menu template is created.
Always create multiple templates for menus, sub menus for better user experience.
1. Go to Applications view.
2. Expand the application for which you want to use Menus.
3. Navigate to forms > desktop, right-click desktop and select New Form. The Create a New Form
window appears.
4. Enter a name for the form and click Finish. A new form is created.
5. Drag-drop a MenuContainer on the form.
Note: The MenuContainer should not be placed at the bottom of the Form because the menu always
expands downwards. If still want to place the menu at the bottom of the form, ensure that you have
enough space to view the items when the menu is expanded.
6. From the Widget Properties window, select menuItemTemplate and select the template what you
have created. You can define different templates for menus and sub menus.
7. To assign the template to menu container, follow the below steps:
a. Select the MenuContainer and from the Widget Properties window and locate the
property menuItemTemplate. Set the template from the drop down menu.
b. Locate the property data and assign data to it. The following image illustrates the Master
Data for MenuBar window:
c. Right-click on the row MenuBar Data and select Add MenuItem. A row gets added.
Select Template ID, click Template Data to update the values for the properties
displayed.
d. To add sub menu items, set the subMenu column false/true to the respective menu
item. If the menu item is set to true you can add sub menu items.
e. To create a submenu item for a menu item, right-click on submenu item and select Add
MenuItem. A row gets added.
f. Select Template ID, click Template Data to update the values for the properties
displayed.
g. Once you are done, click OK. Following is the snapshot of a typical menu with sub menu
items.
22. MenuItem
MenuItem is a choice on the Menu. It is typically a command or function such as Application Logout, Form
Exit, Sending SMS, or other options that you can select inside a Menu.
You can add MenuItems for a specific Form. These MenuItems appear when you navigate to the Form (that
contains the MenuItems) and select the Menu button on the device. The added MenuItems appear along with
the regular device MenuItems for that Form.
Note: Menuitem is supported only on Android/Android tablet, BlackBerry, BlackBerry 10, and J2ME.
For example, in an Airlines Booking Application, in the confirmation page, you can add additional
MenuItems like, "Modify Travel Dates", "Modify Passenger Details" etc.
Menuitem provides you with an option to set Basic Properties and an Event.
1. From the IDE, open the Form for which you want to add MenuItems.
2. Click Menu which is present on the right-hand bottom corner of the Form.
A Box appears on top of the Menu into which you can drag and drop the MenuItem from the Palette.
The following image illustrates the box into which you can drag the MenuItems in the IDE:
Note: You can drag and drop any number of MenuItems into the box as per your requirement.
Important Considerations
l focusImage
l id
l info
l image
l title
l type
22.1.1 focusImage
Syntax
JavaScript: focusImage
Lua: focusimage
Type
JavaScript: String
Lua: String
Read / Write
No
Yes
Platform Availability
l BlackBerry
l BlackBerry 10
l J2ME
22.1.2 id
id is a unique identifier of Menuitem consisting of alpha numeric characters. Every Menuitem should have a
unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
Yes
Platform Availability
l Android/Android tablet
l BlackBerry
l BlackBerry 10
l J2ME
22.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
No
Platform Availability
l BlackBerry
l BlackBerry 10
l J2ME
22.1.4 image
Syntax
JavaScript: image
Lua: image
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
l Android/Android tablet
l BlackBerry
l BlackBerry 10
l J2ME
22.1.5 title
Syntax
JavaScript: title
Lua: title
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
l Android/Android tablet
l BlackBerry
l BlackBerry 10
l J2ME
22.1.6 type
The execution engine will try to map the MenuItem to one of the available standard buttons on the platforms. If
no such capability is available on the platform, the execution engine adds the MenuItem as a custom item
(appends the item to the left key menu).
Syntax
JavaScript: type
Lua: type
Type
JavaScript: Number
Lua: Number
Read / Write
No
Yes
Platform Availability
l BlackBerry 10
l J2ME
l onClick
22.2.1 onClick
An event callback is invoked by the platform when the user performs a click action on the Menuitem.
Signature
JavaScript: onClick
Lua: onclick
Read / Write
Yes
Platform Availability
l Android/Android Tablet
l BlackBerry
l BlackBerry 10
l J2ME
23. RadioButtonGroup
RadioButtonGroup is a widget that allows you to define a set of radio buttons and the user can choose one of it
as an option.
A radio button usually contains a small circle with text next to it. When you make a selection, a dot appears in
the circle to indicate your selection.
If you select one button in the set, the previously selected button is deselected. Hence only one of the options
is selected at a time.
You can use a RadioButtonGroup widget to choose one option from a set of mutually exclusive choices.
The data model for RadioButtonGroup widget is a key value pair. The key is hidden part of the model while
value is displayed to the user.
RadioButtonGroup provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, and Events.
Platform Specific
Basic Properties Layout Properties
Properties
focusSkin containerWeight dropdownImage
id hExpand focusTickedImage
info itemOrientation focusUnTickedImage
isVisible margin groupCells
masterData marginInPixel hoverSkin
masterDataMap padding placeholder
selectedKey paddingInPixel tickedImage
selectedKeyValue vExpand toolTip
skin widgetAlignment untickedmage
viewType
viewConfig
wheelBackgroundColor
Events
onSelection
preOnclickJS
postOnclickJS
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
Platform Appearance
Android
BlackBerry
Platform Appearance
iPhone
Windows Phone
1. From the IDE, drag and drop the RadioButtonGroup widget onto a form (occupies the complete
available width). Or, based on your requirements, you can choose to perform any of the following
options:
2. Specify the values to be displayed in the RadioButtonGroup widget from the IDE by using the
masterData property or from code by using the masterDataMap property.
3. (Optional) If you set the values from the code, you can use the selectedKey property to specify the
value to be displayed as selected.
4. (Optional) For programming purposes, if you want to find the value selected by a user, use the
selectedKeyValue property.
5. (Optional) The radio buttons in the RadioButtonGroup widget are aligned vertically by default. You can
choose to align them horizontally (not applicable on iPhone and iPad) by using the itemOrientation
property.
6. (Optional) Define an onSelection event.
Customizing Appearance
You can customize the appearance of the RadioButtonGroup widget by using the following properties:
Important Considerations
The following are the important considerations for the RadioButtonGroup widget.
All Platforms
Android
l If you set the itemOrientation to horizontal, we suggest that you do not place more than
two items in the group, as there is a platform limitation.
If you place more than two items and the associated text with the items is large, there is
a possibility that the additional items will not fit in the screen width and will not be visible
on the screen.
l For non-touch devices, you can specify focus images for ticked and unTicked states.
l The focusSkin property, background color is not be applied to the selected item, only font
color is be applied. For example, if you define a skin for focusSkin property as
background as red and font color as yellow, then only the font color is applied ignoring the
background color.
Mobile Web
l focusSkin
l id
l info
l isVisible
l masterData
l masterDataMap
l selectedKey
l selectedKeyValue
l skin
23.1.1 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms.
23.1.2 id
id is a unique identifier of RadioButton consisting of alpha numeric characters. Every RadioButton should
have a unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
23.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
23.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
23.1.5 masterData
Specifies the set of values that must be displayed for the user to make a selection from the available choices.
Default: User Defined (You must specify the key and the display value)
To specify the set of values, click the Ellipsis ( ) button against the property to open the MasterData for
RadioButtonGroup window.
In the Master Data window, you can specify the Key, Display Value, i18n Key, and the Accessibility Config.
You can use the Selected column to specify the choice to be shown as selected when rendered. You can do
this by selecting true against the choice that you wish to show as selected.
Note: Select the Use as test data in preview mode option if you want to see the data you enter in the Master
Data when you Quick Preview. (For more information on Quick Preview, see the Kony Studio User Guide.
Note: If the key or the display value is null/nil, the value will not be listed as one of the available choices.
Note: The accessibilityConfigObject is optional and the object should contain the keys as defined in the
accessibilityConfig property.
[
["key1","value1",accessibilityConfigObject],
["key2","value2",accessibilityConfigObject],......,
["keyn","valuen",accessibilityConfigObject]
]
Syntax
JavaScript: masterData
Lua: masterdata
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
23.1.6 masterDataMap
Specifies the set of values from which you can make a selection.You must specify a key and a value in a
master data map.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can always read and write data to it.
This property is applicable only if the masterData is not set. You must use either the masterData or the
masterDataMap property to set data for the radio button.
You must specify a key, value, and the accessibilityConfig in a master data map.
"mykey",
"myvalue"
]
Note: The accessibilityConfig is the standard key expected in each items data array. It is optional and the
object should contain the keys as defined in the accessibilityConfig property.
Note: If the key or the value is null/nil, the value will not be listed as one of the available choices.
Syntax
JavaScript: masterDataMap
Lua: masterdatamap
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
skin:"radSkin", focusSkin:"radFSkin"};
var radioLayout = {widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT, paddin
g:[0,0,0,0], margin:[0,0,0,0], containerWeight:40, hExpand:false};
var radioPSP= {};
No
Platform Availability
23.1.7 selectedKey
If you create a radio button with multiple values, you can choose to show a specific value as selected when
the radio button is rendered.
Syntax
JavaScript: selectedKey
Lua: selectedkey
Type
JavaScript: String
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
23.1.8 selectedKeyValue
Syntax
JavaScript: selectedKeyValue
Lua: selectedkeyvalue
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
23.1.9 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerWeight
l hExpand
l itemOrientation
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
23.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
23.2.2 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Desktop Web, and SPA.
23.2.3 itemOrientation
Default: RADIOGROUP_ITEM_ORIENTATION_VERTICAL
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Note: On Android platform, if you set the itemOrientation to horizontal, due to platform limitations, we
suggest that you do not place more than two items in the group. If you place more than two items and the
associated text with the items is large, there is a possibility that the additional items will not fit in the screen
width and will not be visible on the screen.
Syntax
JavaScript: itemOrientation
Lua: itemorientation
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
23.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
23.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone Mango
l Windows Kiosk
23.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform. Padding is not supported by Windows Mobile browser for Box and Image Gallery.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10 platforms
23.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone Mango
l Windows Kiosk
23.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
23.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l dropDownImage
l focusTickedImage
l focusUnTickedImage
l groupCells
l hoverSkin
l placeholder
l tickedImage
l toolTip
l unTickedImage
l viewType
l viewConfig
l wheelBackgroundColor
23.3.1 dropDownImage
Specifies the image to be used for the drop-down box indicator (inverted triangle by default). The image you
specify is used to depict the drop-down box. If you do not specify an image, the drop-down box displays the
default image (inverted triangle).
Note: For Windows Phone platform, you can specify the image from the RadioButton skin.
Note: For iOS platform, the drop down image should be of size 20px * 33px for non retina devices and for
retina devices the image size should be 40px * 66px.
Syntax
JavaScript: dropDownImage
Lua: dropdownimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
23.3.2 focusTickedImage
Specifies the image to be displayed when you make a selection on non-touch devices.
Syntax
JavaScript: focusTickedImage
Lua: focustickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l BlackBerry
l J2ME
23.3.3 focusUnTickedImage
Specifies the image to be displayed when you clear a selection on non-touch devices.
Syntax
JavaScript: focusUnTickedImage
Lua: focusuntickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l BlackBerry
l J2ME
23.3.4 groupCells
Specifies if all the rows in the RadioButton widget should be grouped using a rounded corner background and
border.
Default: false
Syntax
JavaScript: groupCells
Lua: groupcells
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
23.3.5 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
23.3.6 placeholder
Specifies the temporary or substitute text (a hint provided as a word or phrase) that must be displayed on the
RadioButton until the actual selection is made. If you do not specify the Placeholder text, the first option in the
list is shown as the selected value.
If placeholder is set then by default (without user selecting any option) selectedKey and selectedKeyValue
properties will return null/nil.
If placeholder is not set then by default the first entry should be shown as selected and selectedKey and
selectedKeyValue properties will return the first options key-value pair.
Syntax
JavaScript: placeholder
Lua: placeholder
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
23.3.7 tickedImage
Note: If you specify a tickedImage, ensure that you also specify an unTickedImage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: tickedImage
Lua: tickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
23.3.8 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
23.3.9 unTickedImage
Note: If you specify an unTickedImage, ensure that you also specify a tickedImage. If not specified, the
behavior will be undefined.
Syntax
JavaScript: unTickedImage
Lua: untickedimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Kiosk
23.3.10 viewType
Default: RADIOGROUP_VIEW_TYPE_LISTVIEW
l RADIOGROUP_VIEW_TYPE_LISTVIEW
l RADIOGROUP_VIEW_TYPE_TABLEVIEW
l RADIOGROUP_VIEW_TYPE_TOGGLEVIEW
l RADIOGROUP_VIEW_TYPE_ONSCREENWHEEL
Note: On iPhone platform, skin is not supported when the view type is set as RADIOGROUP_VIEW_
TYPE_TOGGLEVIEW and RADIOGROUP_VIEW_TYPE_ONSCREENWHEEL.
listView
Note: If you select the listView and do not specify a selection in the masterData, the default behavior of the
platform is to select the first entry on the list.
tableView
toggleView
Plain
Bordered
Bar
onscreenwheel
The below image illustrates the nextprevtoolbar set to a RadioButtonGroup. The highlighted toolbar is
achieved by setting the Mode as onscreenwheel to the RadioButtonGroup and Input Accessory View
Type as nextprevtoolbar to the Form.
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
23.3.11 viewConfig
Specifies the view configuration for different viewtypes. You can set the configuration for toggle view.
viewStyle: Accepts the view style. This property is not supported in iOS7 and above versions.
Following are the available options:
l RADIOGROUP_TOGGLE_VIEW_STYLE_PLAIN
l RADIOGROUP_TOGGLE_VIEW_STYLE_BORDERED
l RADIOGROUP_TOGGLE_VIEW_STYLE_BAR
equalSegments: Specifies the boolean value which indicates if the segments must be equal.
enableTint: Specifies the boolean value to enable tintColor property. When this property is set
to true, tintColor property is displayed.
tintColor: Specifies the tint color in RGB format. The default color is blue.
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
No
Platform Availability
l iPad
l iPhone
23.3.12 wheelBackgroundColor
Specifies the background color for the wheel that is displayed when you click the RadioButton group. This
property is applicable only when you set the viewType as RADIOGROUP_VIEW_TYPE_
ONSCREENWHEEL.
Syntax
JavaScript: wheelBackgroundColor
Type
JavaScript: JSObject
Read / Write
JavaScript Example
No
Platform Availability
l iPad
l iPhone
l onSelection
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
23.4.1 onSelection
An event callback that is invoked by the platform when an item is selected or deselected.
Note: For Server side Mobile Web (Basic devices), this event is fired only when you make a selection and
then write an onClick event for a button.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
//The below function is the call back function for onSelection event
function onSelectionCallBck(radio)
{
alert("onSelection event triggered");
}
Platform Availability
23.4.2 preOnclickJS
This event allows the developer to execute custom javascript function before the onSelection callback of the
RadioButton is invoked. This is applicable only for Mobile Web channel. The function must exist in a
javascript file under project>module>js folder.
Note: This event should return true, to continue with execution of onSelection and postOnclickJS events.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
//The below function is the call back function for preOnclickJS event
function preOnclickJSCallBck(radio)
{
alert("preOnclickJS event triggered");
}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
23.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onSelection callback of the
RadioButton is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript
file under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
//The below function is the call back function for postOnclickJS event
function postOnclickJSCallBck(radio)
{
alert("postOnclickJS event triggered");
}
Yes
Platform Availability
24. RichText
RichText widget is used to display non-editable and well formatted text on the Form. HTML formatting tags
are used in RichText widget to display text with styles (bold, underlined etc.), links, and images.
You can use a RichText widget to show a read-only view of a well formatted text and to display text with
different formatting styles.
For example, you can use the RichText widget in the "Contact Us" Form of an Application. You can use the
widget's text styles (bold, italics etc.) to display the contact information, URL's telephone numbers instead of
using multiple widgets like Label, Phone, and Link widgets on the Form.
RichText provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
and an Event.
Platform Specific
Basic Properties Layout Properties
Properties
id containerWeight hoverSkin
info contentAlignment linkFocusSkin
isVisible hExpand superScriptSkin
linkSkin margin telephoneLinkSkin
skin marginInPixel toolTip
text padding wrapping
paddingInPixel
vExpand
widgetAlignment
Event
onClick
preOnclickJS
postOnclickJS
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
//The below function is the callback function for onClick event of RichText
widget.
function onClickCalBck(richText)
{
Platform Appearance
Android
BlackBerry
iPhone
Windows Phone
1. From the IDE, drag and drop the RichText widget onto a Form (occupies the complete available width).
Or, based on your requirement, you can choose to perform any of the following options:
a. If you want to resize the RichText widget in the horizontal direction, place an HBox on the Form
and drag and drop the RichText widget inside the HBox and resize accordingly.
b. If you want to resize the RichText widget in the vertical direction, place an HBox on the Form
and place a VBox inside the HBox; and drag and drop the RichText widget inside the VBox and
resize accordingly.
2. Enter the text using HTML formatting tags for the RichText widget using the text property.
The intended use of Rich Text is to display well formatted text using the following HTML formatting tags:
Tags Description
<b>Text </b> Displays Text in Bold.
<i> Text </i> Displays Text in italics.
Displays Text underlined.
<u> Text </u> Note: On BlackBerry and J2ME platforms, if the text
contains multiple words, the individual words are
underlined and not the whole text.
This tag is used to display a link. It supports
<a href=""> </a>
optional href attribute.
This tag is used to display an image and supports src
attribute. The path for the image can be local or url based.
<img src="" > </img>
Note: Specify the absolute path of an image for
MobileWeb platforms.
Tags Description
Displays a telephone number on Mobile Web
<a href="tel:"></a>
platforms.
Note: If you need to apply multiple formats on the same text, these tags can be nested. For example:
<b><i><u>BoldItalicAndUnderlined</u></i></b>.
Customizing Appearance
You can customize the appearance of the RichText widget by using the following properties:
Important Considerations
l All Platforms: If you specify a skin for the RichText widget, all the font level settings (color style, or
size etc.) is applied to the complete content in RichText widget. You can use the label style HTML
formatting tag to override the text color specified at the skin level.
l In onClick event, the attribute does not respect anchor tags in rich client. It is respected only on
browser based platforms (Mobile Web, SPA etc).
For example, in the below code when we click on "Click here" link, javascript confirm function is not
invoked. Only in Mobile Web and SPA it is invoked.
<a href="#" onclick=confirm("Do you want to proceed")>Click here </a>
l iPhone: <img> HTML formatting tag is not supported. While integrating custom fonts, the name of the
font file should match its PostScript name. You have to determine the PostScript name using some
tool (in Mac you can install the font to find the PostScript name) and make sure that you name the font
file as the <postscriptname>.ttf. For example, if the PostScript font file name is "DBOzoneX-
BoldItalic", then the font name during integration should be "DBOzoneX-BoldItalic.ttf".
l BlackBerry and J2ME: If you use the <u> HTML formatting tag, and the text contains multiple words,
the individual words are underlined and not the whole text (spaces between the words are not
underlined).
l id
l info
l isVisible
l linkSkin
l skin
l text
24.1.1 id
id is a unique identifier of RichText consisting of alpha numeric characters. Every RichText should have a
unique id within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
Yes
Platform Availability
24.1.2 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
24.1.3 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the Visibility of the widget is controlled by the data property of the segment.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
24.1.4 linkSkin
Specifies the skin that must be applied to the link in the RichText widget.
Syntax
JavaScript: linkSkin
Lua: linkskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
24.1.5 skin
Specifies the look and feel of the RichText when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
24.1.6 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
24.2.1 containerWeight
Specifies the percentage of width that should allocated by its parent widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
weight except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
No
Platform Availability
24.2.2 contentAlignment
Specifies the alignment of the text on the RichText with respect to its boundaries. A default value
CONTENT_ALIGN_MIDDLE_LEFT is assigned for all platforms. To choose another alignment, click the
drop-down arrow and select the desired alignment. However, to change the default value on a particular
platform, select the button next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_MIDDLE_LEFT
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the RichText.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the RichText.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the RichText.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the RichText.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the RichText.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the RichText.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the RichText.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
RichText.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the
RichText.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
24.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, Windows Kiosk, Desktop Web, and SPA.
24.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
24.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
l BlackBerry 10
24.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic), BlackBerry 10, and Widows 7 Kiosk
24.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
24.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and Desktop Web platforms
24.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l hoverSkin
l linkFocusSkin
l superScriptSkin
l telephoneLinkSkin
l toolTip
l wrapping
24.3.1 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
JavaScript Example
Yes
Platform Availability
24.3.2 linkFocusSkin
Specifies the skin that must be applied to the link when focused.
Syntax
JavaScript: linkFocusSkin
Lua: linkfocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l BlackBerry
l J2ME
l Desktop Web
l SPA (iOS, Android, BlackBerry, and all Windows channels except on Windows 7.5 platform)
24.3.3 superScriptSkin
Syntax
JavaScript: superScriptSkin
Lua: superscriptskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l BlackBerry
l Windows Phone (Mango)
l Windows Tablet
l Windows Kiosk
24.3.4 telephoneLinkSkin
Specifies the skin to be applied to the telephone links in the RichText widget.
Syntax
JavaScript: telephoneLinkSkin
Lua: telephonelinkskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
24.3.5 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
24.3.6 wrapping
When the content of the RichText reaches the boundaries, it starts wrapping. While wrapping two strategies
can be applied:
Default: WIDGET_TEXT_WORD_WRAP
l WIDGET_TEXT_WORD_WRAP: Specifies if the complete word must be moved to the next line when
you reach the right margin. This is the default wrapping property.
l WIDGET_TEXT_CHAR_WRAP: Specifies if the characters in a word must be moved to the next line
when you reach the right margin.
The following image illustrates the character wrapping property:
Syntax
JavaScript: wrapping
Lua: wrapping
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l onClick
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
24.4.1 onClick
An event callback is invoked by the platform when the user performs a click action on the portion of the text
only where a link is defined. If the link is not defined, then onClick event is not invoked.
Note: When the anchor tag is available and onClick event is not defined, the widget opens all anchor tags in
a device browser.
Signature
Input Parameters
Note: In onClick event , the attribute does not respect anchor tags in rich client. It is
respected only on browser based platforms (Mobile Web, SPA etc).
For example, in the below code when we click on "Click here" link, javascript confirm function
is not invoked. Only in Mobile Web and SPA it is invoked.
<a href="#" onclick=confirm("Do you want to proceed")>Click here </a>
Read / Write
JavaScript Example
//The below function is the callback function for onClick event of RichText
widget.
function onClickCalBck(rText, linktext, attributes)
{
//Write your logic here
}
Yes
Platform Availability
24.4.2 preOnclickJS
This event allows the developer to execute custom javascript function before the onClick callback of the
widget is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file
under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
//The below function is the callback function for preOnclickJS event call.
function preOnclickJSCalBck(rText)
{
//Write your logic here.
}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
24.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the widget
is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
//The below function is the callback function for postOnclickJS event call.
function postOnclickJSCalBck(rText)
{
//Write your logic here.
}
Yes
Platform Availability
25. Slider
Slider widget allows you to select a value from a defined range of values by moving the thumb (an indicator) in
a horizontal direction. The Slider widget consists of a seekbar (or track) and a thumb (a control that you can
slide). You can optionally choose to display a minimum value and a maximum value. When you drag the
thumb along the slider, the value or process is updated continuously and is displayed on the track (you must
define an event to achieve this behavior).
Note: The Slider widget is not supported on all Server side Mobile Web platforms.
The Slider widget provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, and Events.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
The appearance of the widget with the default properties inside an HBox is as follows:
Android
BlackBerry
iPhone
Windows Phone
1. From the IDE, drag and drop the Slider widget onto a form (occupies the complete available width).
You can also choose to place the Slider in an HBox and use the widgetAlignment property to specify
the slider alignment as top, center, or bottom.
2. (Optional) Specify the maximum and the minimum values that the Slider can select.
3. (Optional) Specify a thumbImage and a focusThumbImage.
Note: The maximum and minimum values are not displayed on the slider by default. You must
specify the maxLabel and minLabel to display the same (not supported on iPhone).
Customizing Appearance
You can customize the appearance of the Slider widget by using the following platform specific properties:
l leftSkin: Specifies the skin to be applied to the background of the slider on left side of the thumb image
of the seekbar.
l rightSkin: Specifies the skin to be applied to the background of the slider on right side of the thumb
image of the seekbar.
l minLabel: Specifies the text or number to be displayed for the minimum value of the slider.
l maxLabel: Specifies the text or number to be displayed for the maximum value of the slider.
l thickness: Specifies the thickness of the seekbar.
l minLabelSkin: Specifies the skin for the minLabel property of the slider.
l maxLabelSkin: Specifies the skin for the maxLabel property of the slider.
Important Considerations
l All platforms (except iPhone): The slider widget does not display the minimum and maximum values
unless the minLabel and maxLabel are specified.
l iPhone: You cannot display the minimum and maximum values. You can use the minValueImage and
the maxValueImage to indicate the values.
l focusThumbImage
l id
l info
l isVisible
l leftSkin
l max
l min
l rightSkin
l selectedValue
l step
l thumbImage
25.1.1 focusThumbImage
Specifies the image to indicate that there is focus on the thumb. You can select the image from the resources
folder.
Note: If you specify a focus thumb image, you must also ensure that you have specified an image for the
thumb image property.
Syntax
JavaScript: focusThumbImage
Lua: focusthumbimage
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.1.2 id
A unique identifier of Slider consisting of alpha numeric characters. Every Slider should have a unique id
within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.1.4 isVisible
Default:true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.1.5 leftSkin
Skin to be applied to the background of the slider on left side of the thumb image. Specifies the skin to be
applied to the selected part of the seekbar (skin is applied to the left side of the thumb icon).
If you want to apply a skin, select the desired skin from the available skins.
Syntax
JavaScript: leftSkin
Lua: leftskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
25.1.6 max
Specifies the maximum value on the slider that you can select. It accepts a non-decimal value.
Note: The maximum value is not displayed on the Slider. To display the maximum value, you must specify
the maxLabel (not supported on iPhone).
Default: 100 (The default maximum value on the slider that you can select is hundred)
If you want to set a different maximum value, you can set any Number (the Number can be upto 4 bytes
(positive or negative)) as the maximum value.
Note: The maximum value must be greater than the minimum value.
Syntax
JavaScript: max
Lua: max
Type
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
25.1.7 min
Specifies the minimum value on the slider that you can select. It accepts a non-decimal value.
Note: The minimum value is not displayed on the Slider. To display the minimum value, you must specify
the minLabel (not supported on iPhone).
Default: 0 (The default minimum value on the slider that you can select is zero)
If you want to set a different minimum value, you can set any Number (the Number can be upto 4 bytes
(positive or negative)) as the minimum value.
Note: The minimum value must be less than the maximum value.
Syntax
JavaScript: min
Lua: min
Type
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
25.1.8 rightSkin
Skin to be applied to the background of the slider on right side of the thumb image. Specifies the skin to be
applied to the progress part of the seekbar (skin is applied to the right side of the thumb icon).
If you want to apply a skin, select the desired skin from the available skins.
Syntax
JavaScript: rightSkin
Lua: rightskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
25.1.9 selectedValue
Specifies the value that must be displayed as selected when rendered. If you specify the default selected
value, the thumb shows the specified value as the selected value when rendered.
The default value is the minimum value plus half the difference between the minimum and the
maximum value.
For example, if the minimum value is 0 and the maximum value is 100, the default value is 50.
If you specify a default value which is lesser than the minimum value, the minimum value is
taken as the default value.
If you specify a default value which is greater than the maximum value, the maximum value is
taken as the default value.
Syntax
JavaScript: selectedValue
Lua: selectedvalue
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.1.10 step
Specifies the value by which the slider is increased or decreased between the allowed slider values. It
accepts a non-decimal value.
If you want a different Step value, you can specify a value which is in between the difference of the maximum
and minimum values of the slider.
For example, if you set the minimum value to 40 and the maximum value to 45, the step value can be a
number between 1 and 5.
Note: If you specify a value which is not in between the difference of the maximum and minimum values of
the slider, the step increment value is reset to 1.
Syntax
JavaScript: step
Lua: step
Type
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
25.1.11 thumbImage
Specifies the image to indicate the thumb. You can select the image from the resources folder.
Syntax
JavaScript: thumbImage
Lua: thumbimage
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
l containerWeight
l margin
l marginInPixel
l widgetAlignment
25.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.2.2 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
25.2.3 marginInPixel
Enables you to define the space around a widget in pixels or in percentage. You can use this option to define
the top, left, right, and bottom distance between the widget and the next element.
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
25.2.4 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
l enableThumbTintColor
l maxLabel
l maxLabelSkin
l maxValueImage
l minLabel
l minLabelSkin
l minValueImage
l orientation
l thickness
l thumbTintColor
l viewType
25.3.1 enableThumbTintColor
Syntax
JavaScript: thumbTintColor
Type
JavaScript: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
25.3.2 maxLabel
Specifies the text or number to be displayed for the maximum value of the slider. This text is displayed just
below the slider on the right.
The following image illustrates a Slider with the text "Maximum Value" in the maxLabel property:
Syntax
JavaScript: maxLabel
Lua: maxlabel
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Windows Phone(Mango)
l Windows Kiosk
l SPA (iPhone/Android/BlackBerryWindows NTH)
25.3.3 maxLabelSkin
Specifies the skin (font color or style) for the maxLabel property of the slider.
Note: For the Max Label Skin, only the changes made under the Font tab of the skin property is applied.
Rest of the changes are ignored. For example, if you specify a skin for the Slider widget and define a
background image and font color, only the font color will be applied and not the background image.
The following image illustrates the Max Label with a defined skin:
Syntax
JavaScript: maxLabelSkin
Lua: maxlabelskin
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
l SPA (iPhone/Android/BlackBerryWindows NTH)
25.3.4 maxValueImage
Specifies the image for the maximum value of the slider. You can select the image from the resources folder.
Syntax
JavaScript: maxValueImage
Lua: maxvalueimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
25.3.5 minLabel
Specifies the text or number to be displayed for the minimum value of the slider. This text is displayed just
below the slider on the left.
The following image illustrates a Slider with the text "Minimum Value" in the minLabel property:
Syntax
JavaScript: minLabel
Lua: minlabel
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
l SPA (iPhone/Android/BlackBerryWindows NTH)
25.3.6 minLabelSkin
Note: For the Min Label Skin, only the changes made under the Font tab of the skin property is applied. Rest
of the changes are ignored. For example, if you specify a skin for the Slider widget and define a background
image and font color, only the font color will be applied and not the background image.
Syntax
JavaScript: minLabelSkin
Lua: minlabelskin
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Tablet
l Windows Kiosk
l SPA (iPhone/Android/BlackBerryWindows NTH)
25.3.7 minValueImage
Specifies the image for the minimum value of the slider. You can select the image from the resources folder.
Syntax
JavaScript: minValueImage
Lua: minvalueimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
25.3.8 orientation
Specifies the orientation of the slider widget. You can select the orientation as horizontal or vertical.
Default: SLIDER_HORIZONTAL_ORIENTATION
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: orientation
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
25.3.9 thickness
Specifies the thickness of the seekbar. You can specify a thickness between 1 and 25.
If you do not specify the thickness (the thickness field is blank), the device specific thickness is assigned.
Note: On Android platform, the thickness property is applicable only if a leftSkin or rightSkin is applied. If
you do not specify a left or a right skin, Android specific seekbar thickness is assigned.
Syntax
JavaScript: thickness
Lua: thickness
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l BlackBerry
l Windows Kiosk
l Windows Phone
l Windows Tablet
l SPA (iPhone/Android/BlackBerryWindows NTH)
25.3.10 thumbOffset
If the thumb image is a valid drawable (not null), by default half its width is used as the new thumb offset. If the
thumb image drawable is symmetric, thumb offset is set such that the thumb image hangs halfway off either
edge of the slider widget. To avoid half hanging of the thumb image, set the thumbOffset value to zero.
Syntax
JavaScript: thumbOffset
Lua: thumboffset
Type
JavaScript: Number
Lua: Number
Read / Write
Write only
JavaScript Example
No
Platform Availability
25.3.11 thumbTintColor
Note: When both the thumbImage and thumbTintColor are configured, the property thumbTintColor takes
precedence over thumbImage.
Syntax
JavaScript: thumbTintColor
Type
JavaScript: String
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
25.3.12 viewType
Default: SLIDER_VIEW_TYPE_DEFAULT
JavaScript: viewType
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l onSelection
l onSlide
25.4.1 onSelection
An event callback that is invoked by the platform when the user makes a selection.
For touch based devices, this event is triggered when you stop sliding the thumb icon.
For non touch based devices, this event is triggered when the left or right key is released.
Syntax
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
25.4.2 onSlide
An event callback that is invoked by the platform when there is a change in the default selected value.
For touch based devices, this event is triggered when you stop sliding the thumb icon.
For non touch based devices, this event is triggered when the left or right key is released.
Syntax
JavaScript: onSlide
Lua: onslide
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
26. TextArea
TextArea is used to provide an editable field for the user to enter text which spans over multiple lines .
You can use the TextArea widget to provide a field where a user can enter multiple lines of text.
For example, in the "Feedback" section of an Application, you can place a TextArea widget and instruct the
users to enter their comments.
Note: The TextArea widget inherits all the properties of the TextBox widget.
TextArea provides you with an option to set Basic Properties, Layout Properties, and Platform Specific
Properties.
Platform Specific
Basic Properties Layout Properties
Properties
autoCapitalize contentAlignment autoCorrect
focusSkin containerWeight blockedUISkin
id hExpand closeButtonText
info margin keyboardActionLabel
isVisible marginInPixel pasteboardType
keyBoardStyle padding placeholderSkin
maxTextLength paddingInPixel showCloseButton
numberOfVisibleLines widgetAlignment showProgressIndicator
placeholder toolTip
secureTextEntry
skin
text
textInputmode
Events Deprecated
onDone editable
onBeginEditing No of Rows
onEndEditing
onTextChange
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
The appearance of the TextArea widget with a specified text on various platforms is as follows:
Platform Appearance
Android
BlackBerry
iPhone
Platform Appearance
Windows Phone
1. From the IDE, drag and drop the TextArea widget onto a Form (occupies the complete available width).
Or, based on your requirement, you can choose to perform any of the following options:
a. If you want to resize the TextArea widget in the horizontal direction, place an HBox on the Form
and drag and drop the TextArea widget inside the HBox and resize accordingly.
b. If you want to resize the TextArea widget in the vertical direction, place an HBox on the Form
and place a VBox inside the HBox; and drag and drop the TextArea widget inside the VBox and
resize accordingly.
2. Enter text for the TextArea widget using the text property.
Note: When the widget is rendered, the text is editable by the user.
3. (Optional) Specify the maximum number of characters that a user can enter into the TextArea widget
using the maxTextLength property.
4. (Optional) For Windows and Symbian platforms, specify an onDone event.
Customizing Appearance
You can customize the appearance of the TextArea widget by using the following properties:
Important Considerations
The following are the important considerations for the TextArea widget:
l Editing on devices with small form factor takes place in a new screen.
l Editing on devices with medium or large form factor takes place in the same screen.
l In Mobile web, some browsers by default enable a scroll bar (vertical/horizontal) for the text area, even
if the number of lines is less than numberOfVisibleLines. The Mobile Web platform has no control if the
scroll bar should appear or not.
l For Desktop Web platform, transparency ( border/font) is not support in Internet Explorer 7 and Internet
Explorer 8.
l For Desktop Web platform, rounded corner skins do not support in Internet Explorer 7 and Internet
Explorer 8.
l autoCapitalize
l focusSkin
l id
l info
l isVisible
l keyBoardStyle
l maxTextLength
l numberOfVisibleLines
l placeholder
l secureTextEntry
l skin
l text
l textInputmode
26.1.1 autoCapitalize
Default: TEXTAREA_AUTO_CAPITALIZE_NONE
Note: For Desktop Web platform, autoCapitalize property is not supported, use the events onBeginEditing,
onEndEditing, onKeyUp, and onKeyDown, and onDone as necessary.
Syntax
JavaScript: autoCapitalize
Lua: autocapitalize
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except SPA, Desktop Web, and on all Server side Mobile Web platforms
26.1.2 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, BlackBerry 10, and SPA (Android) platforms
26.1.3 id
A unique identifier of TextArea consisting of alpha numeric characters. Every TextArea should have a unique
id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
26.1.4 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
26.1.5 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
26.1.6 keyBoardStyle
When you interact with a TextBox widget, a keyboard is displayed. You can use this property to select the
type of keyboard that you want to display.
Note: Keys on the keyboard style may vary from platform to platform.
Note: On Desktop Web platform, KeyBoardStyle property is not supported, use the events onBeginEditing,
onEndEditing, onKeyUp, and onKeyDown, and onDone as necessary.
The following are the available keyboard types when you select textInputMode as TEXTAREA_INPUT_
MODE_ANY.
The following are the available keyboard types when you select textInputMode as TEXTAREA_INPUT_
MODE_NUMERIC.
JavaScript: keyBoardStyle
Lua: keyboardstyle
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, Windows Kiosk, and Desktop Web
platforms
26.1.7 maxTextLength
Specifies the maximum number of characters that the text field can accept.
Default: empty
If you specify a number for this property, the number of input characters cannot exceed the specified number.
Syntax
JavaScript: maxTextLength
Lua: maxTextLength
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
26.1.8 numberOfVisibleLines
Number of lines to be displayed at a given time in the view port of the TextArea. This essentially decides the
height of the text area.
Note: In Android platform, you cannot fix the height of the TextArea to any value. The form by default is a
vertical scroll container, if you restrict the height of TextArea, you will not be able to scroll the content,
because of double scrolling issue. For example,
If the numberOfVisibleLines property is set to 10, then the height of the TextArea will be at least 10 lines tall.
As you enter text more than 10 lines, TextArea height expands accordingly.
Syntax
JavaScript: numberOfVisibleLines
Lua: numberofvisiblelines
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and Windows Phone (Mango) platforms.
26.1.9 placeholder
The placeholder attribute specifies a short hint that describes the expected value of an input field (example, a
sample value or a short description of the expected format). The hint is displayed in the input field when it is
empty, and disappears when the field gets focus.
For example, for the Username field, you can enter the placeholder text as Enter User ID or Email Address.
The user then clicks on the TextArea widget and enters the Username.
Syntax
JavaScript: placeholder
Lua: placeholder
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Note: You can set the placeholder text from the code only on iPhone, Android, BlackBerry, Windows
Phone, J2ME, Symbian and Mobile Web Advanced platforms.
Yes
Platform Availability
Available on all platforms except on Server side Mobile Web (Basic and BJS)
26.1.10 secureTextEntry
Specifies whether the text entered by the user will be secured using a mask character, such as asterisk or
dot. This is typically set to true for a password field.
Default: false
If set to false, the text in the TextArea will be displayed as clear text.
Syntax
JavaScript: secureTextEntry
Lua: securetextentry
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except BlackBerry 10, Desktop Web, and on all Server side Mobile Web
platforms
26.1.11 skin
Specifies the look and feel of the widget when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
26.1.12 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
26.1.13 textInputMode
Specifies the type of input characters that a user can enter into the TextArea widget. You can use this
property to restrict the input characters to only numbers or a combination of alphabets, numbers, and special
characters.
Default: TEXTAREA_INPUT_MODE_ANY
Note: In Android platform, multiple lines for a textbox is displayed only when textInputMode property is set
to TEXTAREA_INPUT_MODE_ANY. When the option is set to TEXTAREA_INPUT_MODE_NUMERIC
the text is shown as single line.
Syntax
JavaScript: textInputMode
Lua: textinputmode
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except SPA, BlackBerry, and on all Server side Mobile Web platforms
l contentAlignment
l containerWeight
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l widgetAlignment
26.2.1 contentAlignment
Specifies the alignment of the text and place holder text for a TextArea with respect to its boundaries. The
default value is CONTENT_ALIGN_MIDDLE_LEFT for all platforms. To choose another alignment, click the
drop-down arrow adjacent to the property from the properties window and select the alignment option.
Default: constants.CONTENT_ALIGN_MIDDLE_LEFT
l constants.CONTENT_ALIGN_TOP_LEFT: Specifies the text should align at top left corner of the
TextArea.
l constants.CONTENT_ALIGN_TOP_RIGHT: Specifies the text should align at top right of the
TextArea.
l constants.CONTENT_ALIGN_TOP_CENTER: Specifies the text should align at top center of the
TextArea.
l constants.CONTENT_ALIGN_MIDDLE_LEFT: Specifies the text should align from left of the
TextArea.
l constants.CONTENT_ALIGN_CENTER: Specifies the test should align at the center of the TextArea.
l constants.CONTENT_ALIGN_MIDDLE_RIGHT: Specifies the text should align from right of the
TextArea.
l constants.CONTENT_ALIGN_BOTTOM_LEFT: Specifies the text should align at bottom left of the
TextArea.
l constants.CONTENT_ALIGN_BOTTOM_CENTER: Specifies the text should align at bottom center
of the TextArea.
l constants.CONTENT_ALIGN_BOTTOM_RIGHT: Specifies the text should align at bottom right of the
TextArea.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
26.2.2 containerWeight
Specifies percentage of width that should be allocated by its parent widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
weight except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
No
Platform Availability
26.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding, and margin.
If set to true, the widget ensures that the entire width available to it is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and SPA
26.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
26.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
26.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
Note: In DesktopWeb platform, Firefox browser does not support percentage (%) based padding, while
other browsers does support.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
26.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
26.2.8 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
Note: The alignment property is applicable only if the widget size is lesser than the allocated size.
On Windows Platform TextArea does not support horizontal alignment attributes. By default, the TextArea is
aligned to the center of the horizontal space.
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l autoCorrect
l blockedUISkin
l closeButtonText
l hoverSkin
l keyboardActionLabel
l pasteboardType
l placeholderSkin
l showCloseButton
l showProgressIndicator
l toolTip
26.3.1 autoCorrect
This property determines whether auto-correction is enabled or disabled during typing. With auto-correction
enabled, the text object tracks unknown words and suggests a more suitable replacement candidate to the
user, replacing the typed text automatically unless the user explicitly overrides the action.
Default: false
Syntax
JavaScript: autoCorrect
Lua: autocorrect
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l SPA (iPhone/Android/BlackBerry)
l Desktop Web
l Server side Mobile Web
26.3.2 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (Advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
26.3.3 closeButtonText
Specifies the text to replace the "Done" button that appears in the Keypad (opens when you select a textbox).
If you want to change the text for the close button, enter the text of your choice. For example, if you want to
change the text from Done to Go, enter Go in the property field. The following image illustrates the Keypad
when the text in the property is changed to Go:
Syntax
JavaScript: closeButtonText
Lua: closebuttontext
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
26.3.4 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
JavaScript Example
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
26.3.5 keyboardActionLabel
Default: TEXTBOX_KEYBOARD_LABEL_DONE
l TEXTBOX_KEYBOARD_LABEL_DONE
l TEXTBOX_KEYBOARD_LABEL_GO
l TEXTBOX_KEYBOARD_LABEL_SEARCH
l TEXTBOX_KEYBOARD_LABEL_NEXT
l TEXTBOX_KEYBOARD_LABEL_SEND
l TEXTBOX_KEYBOARD_LABEL_GOOGLE
l TEXTBOX_KEYBOARD_LABEL_JOIN
l TEXTBOX_KEYBOARD_LABEL_ROUTE
l TEXTBOX_KEYBOARD_LABEL_YAHOO
l TEXTBOX_KEYBOARD_LABEL_CALLs
The following images illustrate the Keyboard label as Done and Search respectively:
Syntax
JavaScript: keyboardActionLabel
Lua: keyboardactionlabel
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
26.3.6 pasteboardType
This property enables an application to share data within the application or with another application using
system-wide or application-specific pasteboards.
Typically, an object in the application writes data to a pasteboard when the user requests a copy or cut
operation on a selection in the user interface. Another object in the same or different application then reads
that data from the pasteboard and presents it to the user at a new location; this usually happens when the user
requests a paste operation.
Note: You can only paste the text to a textbox with the same pasteboard type as that of the source textbox.
For example, if you set the pasteboardType as TEXTAREA_PASTE_BOARD_TYPE_APP_LEVEL_
PERSISTENT, you can paste the text only to another textbox whose pasteboard type is set to
applevelpersistent.
type set as systemlevel) across different applications on the device. Even if you exit the source
application, the copied text persists in the memory and can be pasted across applications or within the
same application.
l TEXTAREA_PASTE_BOARD_TYPE_APP_LEVEL_PERSISTENT: If you select this option , the
text copied from a TextArea can be pasted in TextArea (with the pasteboard type set as applevel)
within the same application. Even if you close the application, the copied text persists in the memory
and can be copied to another TextArea whose pasteboard type is applevel, when you restart that
application.
l TEXTAREA_PASTE_BOARD_TYPE_APP_LEVEL_NON_PERSISTENT: If you select this option ,
the text copied from a TextArea can be pasted in TextArea (with the pasteboard type set as
applevelnonpersistent) within the same application. This text is not retained in the memory when you
close the application.
l TEXTAREA_PASTE_BOARD_TYPE_NO_PASTE_BOARD: Select this option, if you want to
disable the content to be copied from a TextArea.
Syntax
JavaScript: pasteboardType
Lua: pasteboardtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
26.3.7 placeholderSkin
Specifies the skin to be applied to the placeholder text in the TextArea widget. Only the font color skin
attribute is applicable.
The following image illustrates the placeholder text with a placeholder color applied:
Syntax
JavaScript: placeholderSkin
Lua: placeholderskin
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Note: You cannot specify an image as a skin for a placeholder as of now. You can only specify a single
color as a skin for a textbox for BlackBerry.
Yes
Platform Availability
l Android
l BlackBerry
l Windows Phone
26.3.8 showCloseButton
Specifies if the "Done" button that appears in the keypad (opens when you select text box) must be visible or
not.
Default: true
The following image illustrates the Keypad when the property is set to true:
The following image illustrates the Keypad when the property is set to false:
Syntax
JavaScript: showCloseButton
Lua: showclosebutton
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
26.3.9 showProgressIndicator
Specifies if there must be an indication to the user that the widget content is being loaded.
You can use this property typically for forms that require network calls during post show.
Default: true
Syntax
JavaScript: showProgressIndicator
Lua: showprogressindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
26.3.10 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l onDone
l onBeginEditing
l onEndEditing
l onKeyUp
l onKeyDown
l onTextChange
26.4.1 onDone
This event is triggered when user is done with entering text in textarea and click or touch the Go or Enter
option.
Note: In Desktop Web platform, this event is fired when the enter key is pressed when the textarea has
focus.
Signature
JavaScript: onDone
Lua: ondone
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except SPA and on all Server side Mobile Web platforms
26.4.2 onBeginEditing
This is an event callback that is invoked by the platform when the user clicks within the TextArea and is about
to start editing.
Signature
JavaScript: onBeginEditing
Lua: onbeginediting
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Desktop Web
l BlackBerry 10
26.4.3 onEndEditing
This is an event callback that is invoked by the platform when the user performs one of the below actions:
l onendediting
l ondone
Signature
JavaScript: onEndEditing
Lua: onendediting
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Desktop Web
l BlackBerry 10
26.4.4 onKeyUp
This is an event callback that is invoked by the platform when the user releases a key (on the keyboard).
Signature
JavaScript: onKeyUp
Read / Write
JavaScript Example
Yes
Platform Availability
26.4.5 onKeyDown
This is an event callback that is invoked by the platform when the user presses a key (on the keyboard).
Signature
JavaScript: onKeyDown
Read / Write
JavaScript Example
Yes
Platform Availability
26.4.6 onTextChange
This is an event callback triggered when text in the TextArea changes. This event is not fired when the text is
changed programmatically.
Note: In Desktop Web platform, this event is fired when the focus is out after changing the text in the
textarea.
Signature
JavaScript: onTextChange
Lua: ontextchange
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
l editable
l No of Rows
26.5.1 editable
Default: true (the checkbox is selected and the TextArea widget can be edited)
If you do not want the TextArea widget to be editable, set the value to false (clear the checkbox).
Type
Boolean
Read / Write
No
Yes
Platform Availability
l iPhone
l iPad
26.5.2 No of Rows
The TextArea widget, by default displays three rows of text (irrespective of the text size). You can use this
property to customize the number of rows that the TextArea widget must display.
If you want the TextArea widget to display more number of rows, enter the desired number (between 3 and 10)
in this field.
Type
Boolean
Read / Write
No
Yes
Platform Availability
27. TextBox
TextBox widget is an editable text component that can be placed on a Form and is used to obtain an input from
a user.
You can use the TextBox widget to provide a field where a user can enter input text.
For example, in the "Login" page of an Application, you can place two TextBox widgets for Login and
Password fields and instruct the users to enter their login credentials in those fields.
TextBox provides you with an option to set Basic Properties, Layout Properties, Platform Specific Properties,
and Events.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Platform Specific
Basic Properties Layout Properties
Properties
autoCapitalize containerHeight autoComplete
focusSkin containerHeightReference autoCorrect
id containerHeightMode autoFilter
info containerWeight blockedUISkin
isVisible contentAlignment closeButtonText
keyBoardStyle hExpand filterlist
maxTextLength margin hoverSkin
placeholder marginInPixel keyboardActionLabel
secureTextEntry padding leftViewImage
skin paddingInPixel nativeListFieldFocusSkin
text widgetAlignment nativeListFieldSkin
textInputMode pasteboardType
placeholderSkin
showClearButton
showCloseButton
showProgressIndicator
toolTip
viewType
Events Deprecated
onCancel inputMode
onDone inputStyle
onBeginEditing keyBoardType
onEndEditing type
onKeyUp
onKeyDown
onTextChange
preOnclickJS
postOnclickJS
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
For backward compatibility with support for all deprecated properties and behaviors, use the constructor
kony.ui.TextBox.
The appearance of the TextBox widget with the Text "Editable text component" on various platforms is as
follows:
Platform Appearance
Android
BlackBerry
Platform Appearance
iPhone
Windows Phone
1. From the IDE, drag and drop the TextBox widget onto a Form (occupies the complete available width).
Or, based on your requirement, you can choose to perform any of the following options:
a. If you want to resize the TextBox widget in the horizontal direction, place an HBox on the Form
and drag and drop the TextBox widget inside the HBox and resize accordingly.
b. If you want to resize the TextBox widget in the vertical direction, place an HBox on the Form
and place a VBox inside the HBox; and drag and drop the TextBox widget inside the VBox and
resize accordingly.
2. Enter text for the TextBox widget using the text property.
Note: When the widget is rendered, the text is editable by the user.
3. (Optional) Specify the maximum number of characters that a user can enter into the TextBox widget
using the maxTextLength property.
4. (Optional) Specify the restriction on the input characters that a user can enter (for example you can
restrict the entry to numbers) using the textInputMode property.
5. Specify an onDone event.
Customizing Appearance
You can customize the appearance of the TextBox widget by using the following properties:
l autoCapitalize
l focusSkin
l id
l info
l isVisible
l keyBoardStyle
l maxTextLength
l placeholder
l secureTextEntry
l skin
l text
l textInputMode
l toolTip
27.1.1 autoCapitalize
Default: TEXTBOX_AUTO_CAPITALIZE_NONE
Note: For Desktop Web platform, autoCapitalize property is not supported, use the events onBeginEditing,
onEndEditing, onKeyUp, and onKeyDown, and onDone as necessary.
Syntax
JavaScript: autoCapitalize
Lua: autocapitalize
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
//Creating a Textbox.
var textBox1 = new kony.ui.TextBox2(txtBasic, txtLayout, txtPSP);
Yes
Platform Availability
Available on all platforms except Desktop Web and on Server side Mobile Web (basic and BJS). It is
browser specific on Server side Mobile Web (Advanced) platform.
Below is the browser specific limitations on SPA platform for the available options:
SENTENC
Browsers/Devices NONE WORDS All
ES
Not Not
IE8 Supported Not supported
supported supported
Not Not
IE9 Supported Not supported
supported supported
Not Not
IE10 Supported Not supported
supported supported
Not Not
Chrome 29.0 Supported Not supported
supported supported
Not Not
Firefox 23.0.0 Supported Not supported
supported supported
Not Not
Safari 5 Supported Not supported
supported supported
Not Not
iPhone4 OS 4.2 Not supported Supported
supported supported
iPhone5 OS 6.1.3 Supported Supported Supported Supported
Not Not
Android 2.3.3 Supported Not supported
supported supported
Not Not
Android 4.2 Supported Not supported
supported supported
Not Not
BlackBerry Supported Not supported
supported supported
Not Not
Windows Supported Not supported
supported supported
27.1.2 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
//Creating a Textbox.
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
27.1.3 id
id is a unique identifier of TextBox consisting of alpha numeric characters. Every TextBox should have a
unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
//Creating a Textbox.
var textBox1 = new kony.ui.TextBox2(txtBasic, txtLayout, txtPSP);
Yes
Platform Availability
27.1.4 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//Creating a Textbox.
var textBox1 = new kony.ui.TextBox2(txtBasic, txtLayout, txtPSP);
textBox1.info = {key:"Textboxinfo"};
No
Platform Availability
27.1.5 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
27.1.6 keyBoardStyle
When you interact with a TextBox widget, a keyboard is displayed. You can use this property to select the
type of keyboard that you want to display.
Note: Keys on the keyboard style may vary from platform to platform.
Note: On Desktop Web platform, KeyBoardStyle property is not supported, use the events onBeginEditing,
onEndEditing, onKeyUp, and onKeyDown, and onDone as necessary.
Note: On BlackBerry 10 platform, only the option TEXTBOX_INPUT_MODE_ANY is supported. Click here
for BlackBerry 10 supported keyboard styles. The key ".com" is shown as "/" on the device when you set
keyboard style as TEXTBOX_KEY_BOARD_STYLE_URL, instead of ".com" as mentioned in the
BlackBerry documentation site.
The following are the available keyboard types when you select textInputMode as TEXTBOX_INPUT_
MODE_ANY.
The following are the available keyboard types when you select textInputMode as TEXTBOX_INPUT_
MODE_NUMERIC.
Syntax
JavaScript: keyBoardStyle
Lua: keyboardstyle
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on Server side Mobile Web (basic, BJS), Windows Kiosk, SPA, and it is
device specific on Server side Mobile Web (Advanced) platform.
27.1.7 maxTextLength
Specifies the maximum number of characters that the text field can accept.
Default: empty
If you specify a number for this property, the number of input characters cannot exceed the specified number.
Note: On Server side Mobile Web, support for this property depends on the device that support maxlength
attribute for TextBox (HTML input tag), else this property is ignored.
Syntax
JavaScript: maxTextLength
Lua: maxtextlength
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platform except Server side Mobile Web(basic) and BlackBerry 10 platform
27.1.8 placeholder
The placeholder attribute specifies a short hint that describes the expected value of an input field (example, a
sample value or a short description of the expected format). The hint is displayed in the input field when it is
empty, and disappears when the field gets focus.
For example, for the Username field, you can enter the placeholder text as Enter User ID or Email Address.
The user then clicks on the TextBox widget and enters the Username.
Syntax
JavaScript: placeholder
Lua: placeholder
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Note: You can set the placeholder text from the code only on iPhone, Android, BlackBerry, Windows,
J2ME, and Server side Mobile Web Advanced platforms.
Yes
Platform Availability
Available on all platforms except SPA Windows 7.5 devices and Server side Mobile Web (Basic, BJS,
and Windows NTH devices)
27.1.9 secureTextEntry
Specifies whether the text entered by the user will be secured using a mask character, such as asterisk or
dot. This is typically set to true for a password field.
Default: false
If set to false, the text in the TextBox will be displayed as clear text.
Syntax
JavaScript: secureTextEntry
Lua: securetextentry
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
27.1.10 skin
Specifies the look and feel of the widget when not in focus.
Note: On BlackBerry 10 platform, skin font style with underline is not supported.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
27.1.11 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
27.1.12 textInputMode
Specifies the type of input characters that a user can enter into the TextBox widget. You can use this property
to restrict the input characters to only numbers or a combination of alphabets, numbers, and special
characters.
Default: TEXTBOX_INPUT_MODE_ANY
l TEXTBOX_INPUT_MODE_ANY: Specifies that the input characters can be letters, numbers, special
characters, or a combination of all the three. Only this option is supported in BlackBerry 10 platform.
l TEXTBOX_INPUT_MODE_NUMERIC: Specifies that the input characters must be numbers only.
This option is not supported on Mobile Web platforms.
Syntax
JavaScript: textInputMode
Lua: textinputmode
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms expect SPA and on all Server side Mobile Web (Basic, BJS and Advanced),
and Desktop Web platforms
27.1.13 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerHeight
l containerHeightReference
l containerHeightMode
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l widgetAlignment
27.2.1 containerHeight
Specifies the height of the textbox in terms of percentage. The percentage is with reference to the value of
containerHeightReference property.
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms.
27.2.2 containerHeightReference
This property is enabled when you set the containerHeight. The textbox height percentage is calculated based
on the option selected.
Default: TEXTBOX_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
FORM_REFERENCE, widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT};
var txtPSP ={};
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms.
27.2.3 containerHeightMode
Default: TEXTBOX_CUSTOM_HEIGHT
l TEXTBOX_DEFAULT_PLATFORM_HEIGHT: This is default option for iPhone and SPA platform and
is available on those platforms only.
l TEXTBOX_FONT_METRICS_DRIVEN_HEIGHT: This the default option on Android, Blackberry, and
Windows Phone platforms. It is supported on all platforms.
l TEXTBOX_CUSTOM_HEIGHT: This option is supported by all platforms and accepts height in
percentage (%). The percentage is evaluated using the containerHeightReference.
Syntax
JavaScript: containerHeightMode
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms.
27.2.4 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
No
Platform Availability
27.2.5 contentAlignment
Specifies the alignment of the text for a TextBox with respect to its boundaries. The default value is
CONTENT_ALIGN_TOP_LEFT for all platforms. To choose another alignment, click the drop-down arrow
adjacent to the property from the properties window and select the alignment option.
Default: constants.CONTENT_ALIGN_TOP_LEFT
l constants.CONTENT_ALIGN_TOP_LEFT: Specifies the text should align at top left corner of the
TextBox.
l constants.CONTENT_ALIGN_TOP_RIGHT: Specifies the text should align at top right of the
TextBox.
l constants.CONTENT_ALIGN_TOP_CENTER: Specifies the text should align at top center of the
TextBox.
l constants.CONTENT_ALIGN_MIDDLE_LEFT: Specifies the text should align from left of the
TextBox.
l constants.CONTENT_ALIGN_CENTER: Specifies the test should align at the center of the TextBox.
l constants.CONTENT_ALIGN_MIDDLE_RIGHT: Specifies the text should align from right of the
TextBox.
l constants.CONTENT_ALIGN_BOTTOM_LEFT: Specifies the text should align at bottom left of the
TextBox.
l constants.CONTENT_ALIGN_BOTTOM_CENTER: Specifies the text should align at bottom center
of the TextBox.
l constants.CONTENT_ALIGN_BOTTOM_RIGHT: Specifies the text should align at bottom right of the
TextBox.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and Windows Kiosk platforms
27.2.6 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding, and margin.
If set to true, the widget ensures that the entire width available to it is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and SPA
27.2.7 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
27.2.8 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
27.2.9 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the Ellipsis ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web(basic) and BlackBerry 10
27.2.10 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
27.2.11 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
Note: The alignment property is applicable only if the widget size is lesser than the allocated size.
On Windows Platform TextBox does not support horizontal alignment attributes. By default, the TextBox is
aligned to the center of the horizontal space.
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l autoComplete
l autoCorrect
l autoFilter
l blockedUISkin
l closeButtonText
l filterList
l hoverSkin
l keyboardActionLabel
l leftViewImage
l nativeListFieldFocusSkin
l nativeListFieldSkin
l pasteboardType
l placeholderSkin
l showClearButton
l showCloseButton
l showProgressIndicator
l toolTip
l viewType
27.3.1 autoComplete
Autocomplete, enables users to quickly find and select from a prepopulated list of values as they type,
leveraging searching and filtering.
Default: false
Syntax
JavaScript: autoComplete
Lua: autocomplete
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
27.3.2 autoCorrect
This property determines whether auto-correction is enabled or disabled during typing. With auto-correction
enabled, the text object tracks unknown words and suggests a more suitable replacement candidate to the
user, replacing the typed text automatically unless the user explicitly overrides the action.
Default: false
Syntax
JavaScript: autoCorrect
Lua: autocorrect
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Server side MobileWeb (Advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
Below is the browser specific limitations on SPA platform when autoCorrect property is set to true/false.
27.3.3 autoFilter
Specifies if the input characters you enter in the TextBox widget must be matched against the filterList and
possible matches be displayed.
Default: false (the checkbox is not selected and the input characters are not matched against the filterlist)
If you want the input characters to be matched against the filterlist and possible matches to be displayed, set
the value to true (select the checkbox).
On Windows platform, if you set the autoFilter property to true, the following additional properties are made
available :
filterCriteria
Specifies the criteria with which the items attached to the filterlist are compared. You can select one of
the following criteria:
l None - No criteria is specified. If you leave the selection unchanged, the event
associated with ontextchange is triggered.
l StartsWith: Filters and displays all the values that start with the value defined in this
mode.
l StartsWithCaseSensitive: Filters and displays all the values that start with the value
defined in this mode with case sensitivity.
l StartsWithOrdinal: Filters and displays all the values that start with the sequence of
values defined in this mode.
l StartsWithOrdinalCaseSensitive: Filters and displays all the values that start with the
sequence of values defined in this mode with case sensitivity.
l Contains: Filters and displays all the values that contain the value defined in this mode.
l ContainsCaseSensitive: Filters and displays all the values that contain the value defined
in this mode with case sensitivity.
l ContainsOrdinal: Filters and displays all the values that contain the sequence of values
defined in this mode.
l ContainsOrdinalCaseSensitive: Filters and displays all the values that contain the
sequence of values defined in this mode with case sensitivity.
l Equals: Filters and displays all the values that are equal to the value defined in this
mode.
l EqualsCaseSensitive: Filters and displays all the values that are equal to the value
defined in this mode with case sensitivity.
l EqualsOrdinal: Filters and displays all the values that are equal to the sequence of
values defined in this mode.
l EqualsOrdinalCaseSensitive: Filters and displays all the values that are equal to the
sequence of values defined in this mode with case sensitivity.
filterBoxSkin
Specifies the skin that must be applied to the box in which the filtered values are displayed.
Syntax
JavaScript: autoFilter
Lua: autofilter
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l BlackBerry
l Windows Mobile
l Android
l Windows Kiosk
27.3.4 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for Blocked UI under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
27.3.5 closeButtonText
Specifies the text to replace the "Done" button that appears in the Keypad (opens when you select a textbox).
If you want to change the text for the close button, enter the text of your choice. For example, if you want to
change the text from Done to Go, enter Go in the property field. The following image illustrates the Keypad
when the text in the property is changed to Go:
Syntax
JavaScript: closeButtonText
Lua: closebuttontext
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
27.3.6 filterList
The values you enter in the TextBox are matched against this list and possible matches are displayed.
Note: For BlackBerry, Android, and Windows platforms, this property is applicable only if the autoFilter
property is set to true.
Syntax
JavaScript: filterList
Lua: filterlist
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
l BlackBerry
l Windows Mobile
l Android
l Windows Kiosk
27.3.7 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
JavaScript Example
Yes
Availability on platforms
l Windows Tablet
l Desktop Web
27.3.8 keyboardActionLabel
Default: TEXTBOX_KEYBOARD_LABEL_DONE
l TEXTBOX_KEYBOARD_LABEL_DONE
l TEXTBOX_KEYBOARD_LABEL_GO
l TEXTBOX_KEYBOARD_LABEL_SEARCH
l TEXTBOX_KEYBOARD_LABEL_NEXT
l TEXTBOX_KEYBOARD_LABEL_SEND
l TEXTBOX_KEYBOARD_LABEL_GOOGLE
l TEXTBOX_KEYBOARD_LABEL_JOIN
l TEXTBOX_KEYBOARD_LABEL_ROUTE
l TEXTBOX_KEYBOARD_LABEL_YAHOO
l TEXTBOX_KEYBOARD_LABEL_CALL
l TEXTBOX_KEYBOARD_LABEL_DONE
l TEXTBOX_KEYBOARD_LABEL_GO
l TEXTBOX_KEYBOARD_LABEL_SEARCH
l TEXTBOX_KEYBOARD_LABEL_NEXT
l TEXTBOX_KEYBOARD_LABEL_SEND
l TEXTBOX_KEYBOARD_LABEL_PREVIOUS
The following images illustrate the Keyboard label as Done and Search respectively:
Syntax
JavaScript: keyboardActionLabel
Lua: keyboardactionlabel
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
27.3.9 leftViewImage
Specifies the image that must be displayed on the left-hand side within a TextBox widget. For example, if you
want a magnifying glass image to be displayed to indicate "Search" option, you can use this property to
display the image.
The following image illustrates a TextBox widget with a Left View image:
Syntax
JavaScript: leftViewImage
Lua: leftviewimage
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
27.3.10 nativeListFieldFocusSkin
Specifies the skin that is applied to a focused item in the native popup (the list of items are displayed and a
pop up appears just below the textfield) that appears when you enter a value in the TextBox.
Syntax
JavaScript: nativeListFieldFocusSkin
Lua: nativelistfieldfocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
27.3.11 nativeListFieldSkin
Specifies the skin that is applied to each item in the native popup (the list of items are displayed and a pop up
appears just below the text field) that appears when you enter a value in the TextBox.
Syntax
JavaScript: nativeListFieldSkin
Lua: nativelistfieldskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
27.3.12 pasteboardType
This property enables an application to share data within the application or with another application using
system-wide or application-specific pasteboards.
Typically, an object in the application writes data to a pasteboard when the user requests a copy or cut
operation on a selection in the user interface. Another object in the same or different application then reads
that data from the pasteboard and presents it to the user at a new location; this usually happens when the user
requests a paste operation.
Note: You can only paste the text to a textbox with the same pasteboard type as that of the source textbox.
For example, if you set the Pasteboard type as applevelpersistent, you can paste the text only to another
textbox whose pasteboard type is set to applevelpersistent.
JavaScript: pasteboardType
Lua: pasteboardtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
27.3.13 placeholderSkin
Specifies the skin to be applied to the placeholder text in the TextBox widget. Only the font color skin attribute
is applicable.
The following image illustrates the placeholder text with a placeholder color applied:
Syntax
JavaScript: placeholderSkin
Lua: placeholderskin
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Note: You cannot specify an image as a skin for a placeholder as of now. You can only specify a single
color as skin background for a textbox for BlackBerry.
Yes
Platform Availability
l iPhone
l iPad
l Android
l BlackBerry
l Windows Phone (Mango)
27.3.14 showClearButton
Specifies if a "Clear" button must be provided. You can use the "Clear" button to erase the text in the TextBox
widget.
Default: true
The following images illustrate a TextBox widget with and without a Clear Button:
Syntax
JavaScript: showClearButton
Lua: showclearbutton
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
27.3.15 showCloseButton
Specifies if the "Done" button that appears in the keypad (opens when you select text box) must be visible or
not.
Default: true
The following image illustrates the Keypad when the property is set to true:
The following image illustrates the Keypad when the property is set to false:
Syntax
JavaScript: showCloseButton
Lua: showclosebutton
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
27.3.16 showProgressIndicator
Specifies if there must be an indication to the user that the widget content is being loaded.
You can use this property typically for forms that require network calls during post show.
Default: true
Syntax
JavaScript: showProgressIndicator
Lua: showprogressindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
27.3.17 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
27.3.18 viewType
Specifies the appearance of the Textbox as Search view or a textbox to accept text input. You can select one
of the following available views:
l TEXTBOX_VIEW_TYPE_DEFAULT - This is the default selection and if this option is unchanged, the
appearance of the Textbox remains unchanged.
l TEXTBOX_VIEW_TYPE_SEARCH_VIEW - The Textbox appears as a Search view.
On Android platform, when you select the viewType as Search view, and click anywhere within the search
box, a cancel button appears along with a keypad. On clicking Cancel, the keypad goes out of view.
The following image illustrates the "Cancel" button for a search box on android platform:
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
Yes - (Read and Write) ( on Android Platform, this property is not writable)
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Server side Mobile Web (Advanced)
l Android
l onCancel
l onDone
l onBeginEditing
l onEndEditing
l onKeyUp
l onKeyDown
l onTextChange
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
27.4.1 onCancel
This event is a callback that is invoked by the platform then the user performs a click action on the Cancel
button.
Note: This event is triggered only when the viewType is set as TEXTBOX_VIEW_TYPE_SEARCH_VIEW.
Signature
JavaScript: onCancel
Read / Write
JavaScript Example
No
Platform Availability
27.4.2 onDone
This event is a callback that is invoked by the platform then the user performs a click action on the Go or Enter
button.
Note: In Desktop Web platform, this event is fired when the enter key is pressed when the textbox has
focus.
Signature
JavaScript: onDone
Lua: ondone
Read / Write
JavaScript Example
Yes
Platform Availability
27.4.3 onBeginEditing
This is an event callback that is invoked by the platform when the user clicks within the TextBox and is about
to start editing.
Signature
JavaScript: onBeginEditing
Lua: onbeginediting
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Desktop Web
27.4.4 onEndEditing
This is an event callback that is invoked by the platform when the user performs one of the below actions:
l onendediting
l ondone
Note: In Android platform, onEndEditing event will be triggered when the focus is lost from the textbox.
Example, click on any other focusable widget, like a Button.
Signature
JavaScript: onEndEditing
Lua: onendediting
Read / Write
JavaScript Example
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Desktop Web
27.4.5 onKeyUp
This is an event callback that is invoked by the platform when the user releases a key (on the keyboard).
Signature
JavaScript: onKeyUp
Read / Write
JavaScript Example
Yes
Platform Availability
27.4.6 onKeyDown
This is an event callback that is invoked by the platform when the user presses a key (on the keyboard).
Signature
JavaScript: onKeyDown
Read / Write
JavaScript Example
Yes
Platform Availability
27.4.7 onTextChange
This is an event callback triggered when text in the text box changes. This event is not fired when the text is
changed programmatically.
Note: In Server side Mobile Web platform, this event is triggered only when the user enters minimum three
characters. This event cannot be used to display a form or a popup or an alert. It is used to update filterList
property.
Note: In Desktop Web platform, this event is fired when the focus is out after changing the text in the
textbox.
Signature
JavaScript: onTextChange
Lua: ontextchange
Read / Write
JavaScript Example
onTextChange:onTextChangeCallBack};
var txtLayout = {padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100,
hExpand:true, widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT};
var txtPSP ={};
Platform Availability
27.4.8 preOnclickJS
This event allows the developer to execute custom javascript function before the onClick callback of the
widget is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file
under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
//The below function is the callback function for preOnclickJS event call.
function preOnclickJSCalBck(txtBox)
{
//Write your logic here.
}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
27.4.9 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the widget
is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
//The below function is the callback function for postOnclickJS event call.
function postOnclickJSCalBck(txtBox)
{
//Write your logic here.
}
Yes
Platform Availability
l inputStyle
l keyBoardType
l type
27.5.1 inputStyle
If Any is selected in the Mode property, then the following options are made available:
l default: This is the default selection. If you leave this option unchanged, no action takes place on the
input string.
l Capitalize Words: This option changes the first character of all the words to uppercase.
l Capitalize sentence: This option changes the first character of all the sentences in a string to
uppercase.
l ALL CAPS: This option changes all the characters to uppercase.
l Email: This option opens a keyboard to enter an email address.
If Numeric is selected in the Mode property, then the following options are made
available:
l default: This is the default selection. If you leave this option unchanged, you can enter only Real
positive values ( 0-9).
l Signed Number: This option allows you to enter a positive or negative sign at the beginning of the
number.
l Decimal Number: This option allows you to enter a decimal point to enter fractional values.
l Signed Decimal Number: This option allows you to enter fractional values and negative numbers.
If Password is selected in the Mode property, then the following options are made
available:
l default: This is the default selection. If you leave this option unchanged, the characters you enter are
masked.
l Visible Password: The password characters you enter are visible to you and not masked.
Type
Number
Read / Write
No
Yes
Platform Availability
27.5.2 keyBoardType
You can use this property to select the type of keyboard that you want to display. The following are the
available keyboard types that you can select and their appearances on iPhone native client:
l NumbersAndPunctuation
l URL
l DigitPad
l PhonePad
l NamePhonePad
l EmailAddress
On Mobile Web and SPA platform, the available keyboard types are as follows:
String
Read / Write
No
Yes
Platform Availability
l iPhone
l iPad
l windows phone/windows kiosk
l Mobile Web ( Advanced)
l SPA(iPhone/Android/BlackBerry/Windows NTH)/Playbook
27.5.3 Type
You can choose to change the TextBox to a search box by selecting search.
Auto Save
Specifies if the text that is entered in the search box must be saved automatically.
Default: false (the checkbox is not selected and the entered text is not saved automatically)
To save the text automatically, set the value to true (select the checkbox).
Type
String
Read / Write
No
Yes
Platform Availability
l Browser
l Camera
l Hz Image Strip
l ImageGallery
l Map
l ObjectSelector3D
l Phone
l PickerView
l SegmentedUI
l Switch
l SignatureCapture
l Video
l Charts2D3D
l App Menu
29. Browser
You can use a Browser widget to display HTML content in the context of your application without navigating
away from the application or opening the native browser from your application.The HTML content can be
either static or obtained from a URL.
Browser widget provides you with an option to set Basic Properties, Layout Properties, Events, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
detectTelNumber containerHeight enableOverviewMode
enableZoom containerHeightReference showProgressIndicator
htmlString containerWeight useWideViewport
id margin zoomDensity
info marginInPixel
isVisible
requestURLConfig
screenLevelWidget
Events Methods
handleRequest canGoBack
onFailure canGoForward
onSuccess clearHistory
scrollingEvents goBack
goForward
loadData
reload
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
The following is the appearance of the Browser widget on various platforms with an external URL:
Platform Appearance
Android
BlackBerry
Platform Appearance
iPhone
1. From the IDE, drag and drop the Browser widget onto a form (occupies the complete available width).
Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the Browser widget in the horizontal direction, place an HBox on the
form and drag and drop the Browser widget inside the HBox and resize accordingly.
b. If you want to resize the Browser widget in the vertical direction, place an HBox on the
form and place a VBox inside the HBox; and drag and drop the Browser widget inside the
VBox and resize accordingly.
2. Use the requestURLConfig property to specify the HTML content (static HTML content or a URL).
3. (Optional) If you choose to display HTML content from a URL, specify onfailure and onsuccess
Events.
4. (Optional) You can choose to display a loading screen while the content is being loaded from a URL.
For more information about the loading screen, see the Windows Library section of the Kony API
Reference Guide.
5. (Optional) On iPhone platform, you can move back and forward through the web page history by using
the Browser Methods.
Important Considerations
l On iOS and Android platforms, when the Browser widget is set as non-screen level widget and you
keep some widgets before browser and after browser then double scrolling issue will be seen which is
native iOS issue. We recommend you to use browser widget as screen level widget and move other
widgets to header or footer of the form.
l The Browser widget, unlike other widgets, is considered to be "heavy" widget as far as memory and
performance is considered.
l The Browser widget uses a lot of initial RAM. The RAM usage grows in proportion to the number of
images and static text rendered.
l If there are multiple instances of the Browser widget in the same application, there may be issues
related to sharing of information. For example, cookies etc.
l You must not place multiple Browser widgets in a screen. As a guideline, you must not have more than
two Browser widgets in an application.
l You must not use the Browser widget as a RichText widget. It should only be used to display large
HTML content.
l You must avoid using the Browser widget to create an application which looks and behaves like a mini
web browser. Users normally expect to use the native browser to browse web content. Hence,
replicating this functionality within your application is not recommended.
l On BlackBerry device placing widgets below the browser widget can lead to focus issues especially
when using the trackpad or the trackball.
l On BlackBerry platform, when a popup screen is displayed over the browser widget, then the browser
widget does not appear until the popup is closed.
l Server side Mobile Web platform does not support Browser widget in startup form.
l On SPA platform, <script> tag is not supported.
l On SPA platform, to get a formatted bullet list in the browser, add the below css before the browser
content.
//For example
<style>#frmMain_browserMain> ul, li{list-style-type: initial; list-st
yle-position: inside; list-style-image: initial;}</style>
l detectTelNumber
l enableZoom
l htmlString
l id
l info
l isVisible
l requestURLConfig
l screenLevelWidget
29.1.1 detectTelNumber
Specifies if the Browser widget must support the detection of phone numbers in the web page and display the
phone numbers as clickable Phone links. If you click the Phone link, the Phone application launches and dials
the number.
Default: true
If set to false, the Browser does not detect the Phone numbers.
If set to true, the Browser detects the phone numbers and displays them as links on the Phone.
Syntax
JavaScript: detectTelNumber
Lua: detecttelnumber
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango), BlackBerry, and BlackBerry 10 platform.
Note: On BlackBerry platform (7 and below), the default value is set based on the device constraints.
29.1.2 enableZoom
Specifies if Zoom (ability to change the scale of the view area) must be enabled.
Default: false
Default: false (the checkbox is not selected and Zoom is not enabled)
Syntax
JavaScript: enableZoom
Lua: enablezoom
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
29.1.3 htmlString
Syntax
JavaScript: htmlString
Lua: htmlstring
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
No
Platform Availability
29.1.4 id
id is a unique identifier of Browser widget consisting of alpha numeric characters. Every Browser should have
a unique id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
29.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
29.1.6 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can also set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
29.1.7 requestURLConfig
Specifies the configurations for the requested URL in key-value pairs as a JavaScript object or Lua table.
The following are the keys that are accepted in this object.
l URL - Mandatory
Specifies the initial URL that must be requested from the server. The URL must begin with http:// .
l requestMethod - Optional
Specifies the HTTP method to use for requesting the initial URL. You can choose either:
l BROWSER_REQUEST_METHOD_GET (Default)
l BROWSER_REQUEST_METHOD_POST
l requestData - Optional
Specifies the key-value pairs that must be sent to the initial URL. It accepts an array of array. For
example,
[["key1","value1"],["key2","value2"],.....,["keyn", "valuen"]]
Syntax
JavaScript: requestURLConfig
Lua: requesturlconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
29.1.8 screenLevelWidget
Specifies whether the widget should occupy the whole container or not when your Browser widget has a large
HTML content to display. You must set the value to true for your Browser widget occupy the complete Form
and results in a good user experience.
If set to false, a scroll bar appears on the Browser widget and the Form resulting in a bad user experience
while scrolling.
Note: You must not place more than one Browser widget as a screen level widget inside a Form. Also, if you
choose to make a Browser widget a Screen Level Widget, you must place only the Browser widget in the
Form and must not place any other widgets in the Form.
Note: Do not set the screen level widget property to true for more than one widget in the form. If you have
multiple widgets with this property set as true, there may be issues with how information is displayed along
with some scrolling issues.
Default: false
If set to false, the widget does not occupy the whole container.
l Placing any widgets below the Browser widget on a form is not advised as this leads to double scrolling
issues. Use Browser widget as screen level widget and place the rest of the widgets as part of headers
and footers.
l In order to control the height of the Browser widget, place browser widget as screen level widget inside
the ScrollBox and control the height of the ScrollBox.
On iPhone, Android, and Windows platforms, if this property is set to true, the following are applicable:
iPhone
When a browser widget is used on the form, make sure that all other widgets are part of header
or footer of the form.
Android
Only the widgets placed above the Browser widget (which is a screen level widget) are visible. The
widgets placed below the Browser widget are not visible when rendered.
Windows
The widgets placed above and below the Browser widget (which is a screen level widget) are
not visible when rendered.
Note: If you configure Application level Header and Footer, they will be visible even if the browser is
a screen level widget.
Syntax
JavaScript: screenLevelWidget
Lua: screenlevelwidget
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, and SPA
l containerHeight
l containerHeightReference
l containerWeight
l margin
l marginInPixel
29.2.1 containerHeight
Specifies the available height of the container in terms of percentage. The percentage is with reference to the
value of containerHeightReference property.
Note: In Windows Phone platform, when screenLevelWidget property is set to false, the Browser widget
occupies 500 px. When screenLevelWidget property is set to true it occupies form height. There is no
change in Windows Tablet and Windows Kiosk platforms.
Default: If not configured, the value may vary depending on the platforms.
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
No
Platform availability
Available on all platforms except on all Server side Mobile Web platforms.
29.2.2 containerHeightReference
This property is enabled when you set the containerHeight. The widget height percentage is calculated based
on the following options.
Default: CONTAINER_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
29.2.3 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
29.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
29.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
l enableOverviewMode
l showProgressIndicator
l useWideViewport
l zoomDensity
Important Considerations:
l The enableOverviewMode and zoomDensity properties are supported only from API level 7 onwards .
The minSDK and target SDK of an application should be 2.1 or above.
l When useWideViewport is set to true, enableOverviewMode and zoomDensity properties are set to
browser widget, then enableOverviewMode takes precedence over zoomDensity property.
l screenLevel browser widget should be directly placed inside a form only then the enableOverviewMode
property will work.
l zoomDensity property is supported only upto Android version 4.3. From Android 4.4 onwards the
desired functionality can be achieved by adjusting the 'width' and 'initial-scale' attributes of page meta
viewport tag or enable “enableOverviewMode” property.
l ZoomDensity property may not be respected in android OS version 4.2.2.
l Refer http://developer.android.com/guide/webapps/targeting.html for information on designing web
pages for Android devices.
l The properties encodeUrlForBrowser, encodeNetAPI, encodeImageURL, and encodeOpenURL are
supported only on iOS platform. These properties are not exposed by IDE. You have to set these
properties in info.plist, using Xcode. By default these properties are set to true. If you do not want
encoding, you can set these properties to false.
29.3.1 enableOverviewMode
Specifies whether the browser should load pages in overview mode. For example, zoom out the content to fit
in the screen width.
Note: To use this property, you must set useWideViewport property and screenLevelWidget property to
true, else the behavior is undefined.
Default: false
Syntax
JavaScript: enableOverviewMode
Type
JavaScript: Boolean
Read / Write
JavaScript Example
frm.browser.enableOverviewMode = true;
No
Platform availability
29.3.2 showProgressIndicator
Specifies if the progress indicator must be displayed before loading the URL or executing an event.
If you do not want the progress indicator to be displayed, set the value to false.
Syntax
JavaScript: showProgressIndicator
Type
JavaScript: Boolean
Read / Write
JavaScript Example
frm.browser.showProgressIndicator = false;
No
Platform Availability
l iOS
l Android/ Android Tablet
29.3.3 useWideViewport
Specifies whether the browser should enable support for the "viewport" HTML meta tag or should use the wide
viewport. If this property is set to true, it loads the browser with the attributes defined in the meta tag of the
webpage. It scales the web page as defined in the html.
Default: false
Syntax
JavaScript: useWideViewport
Type
JavaScript: Boolean
Read / Write
JavaScript Example
frm.browser.useWideViewport = true;
No
Platform Availability
29.3.4 zoomDensity
Specifies the default zoom density of the page. Following are the available options:
JavaScript: zoomDensity
Type
JavaScript: Number
Read / Write
JavaScript Example
frm.browser.zoomDensity = 0;
No
Platform Availability
l handleRequest
l onFailure
l onSuccess
l scrollingEvents
29.4.1 handleRequest
An event callback which gets invoked by the platform before browser widget navigates to a new URL. This is
useful in scenarios where the developer wants to keep track of the URLs that the browser field navigates to.
For example, in a payment flow (that is, being executed inside a browser widget) on successful redirection to
a payment confirmation page the developer would like to take the user to a new native form.
Note: On iOS platform, whenever handleRequest is set to browser and request comes to browser widget to
load the url or html, then before loading the content, handle request is called. Also, whenever a user selects
any hyperlink then also handleRequest is called.
The return value from this function determines how the browser widget handles the original request. If a false
value is returned, then the browser widget continues navigation to the original URL and if the true value is
returned then the developer has to handle the request.
Syntax
Input Parameters
eventobject[widgetid] - Optional
A unique Id that identifies the browser widget.
params[Object] - Optional
An object that identifies the url parameters as key-values pair.
queryParams[Object] - Optional
Specifies the dictionary containing the query parameters passed to the URL as key,
values in the dictionary.
Specifies the request method type. Following are the available options:
l Constants.BROWSER_REQUEST_METHOD_GET
l Constants.BROWSER_REQUEST_METHOD_POST
Read / Write
Yes - (Write)
JavaScript Example
frmobj.brw1.handleRequest = handleRequestCallback
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
29.4.2 onFailure
An event callback which gets invoked by the platform when the given request URL is failed to load the data.
This event is called only for the given request URL, but not for the subsequent web navigation request
failures.
This event is also not called when htmlString is set to the web widget.
Syntax
JavaScript: onFailure
Lua: onfailure
Read / Write
JavaScript Example
For more information about defining an action sequence for this event, see Event Editor in the Kony Studio
User Guide.
Platform Availability
Available on all platforms except Windows Kiosk, Desktop Web, on all Server side Mobile Web, and
SPA.
29.4.3 onSuccess
An event callback which gets invoked by the platform when the given request URL is successful in loading
the data. This event is called only for the given request URL, but not for the subsequent web navigation
requests.
This event is also not called when htmlString is set to the web widget.
Note: This event gets called whenever the URL is loaded, or we navigate from one URL to another, or
browser URL internally redirects to another URL. This event is also called whenever the content is loaded,
when a URL contains any third party contents using iframe.
Syntax
JavaScript: onSuccess
Lua: onsuccessilure
Read / Write
JavaScript Example
For more information about defining an action sequence for this event, see Event Editor in the Kony Studio
User Guide.
Platform Availability
Available on all platforms except Desktop Web, on all Server side Mobile Web, and SPA.
29.4.4 scrollingEvents
Specifies the scrolling events which gets called when scrolling reaches beginning of the widget or end of the
widget.
onReachingBegining: Gets called when scrolling reaches the beginning of the Browse
widget.
Signature
onReachingEnd: Gets called when scrolling reaches the end of the Browse widget.
Signature
Input Parameters
scrollDirection - Mandatory
Specifies the direction in which the scroll box must scroll. Following are the available options:
Note: To set the value through code, prefix the option with constants. such as
constants.<option> .
Type
JavaScript: JSObject
Read / Write
JavaScript Example
//The below is the callback function for onReachingEnd event which comes u
nder scrollingEvents.
function onReachingEndCallBack(webwidget, scrollDirection)
{
alert("onReachingEnd event triggered");
}
requestURLConfig:requestUrlConf, scrollingEvents:{onReachingBegining:onRea
chingBeginingCallBCk, onReachingEnd: onReachingEndCallBck}};
var webLayout = {containerWeight:100};
No
Platform Availability
l canGoBack
l canGoForward
l clearHistory
l goBack
l goForward
l loadData
l reload
29.5.1 canGoBack
This method specifies whether the browser can navigate back into history. If the browser cache is empty then
this method returns false and the goBack method has no effect.
Signature
JavaScript: <widgetid>.canGoBack()
Lua: webwidget.cangoback(widgetref)
Input Parameters
Return Values
status [Boolean]
true - if the browser cache is not empty.
JavaScript Example
Platform Availability
Available on all platforms except SPA, Desktop Web, and on all Server side Mobile Web
29.5.2 canGoForward
This method specifies whether the browser can navigate forward into history. If the browser cache is empty
then this method returns false and goForward method has no effect.
Signature
JavaScript: <widgetid>.canGoForward()
Lua: webwidget.cangoforward(widgetref)
Input Parameters
Return Values
status [Boolean]
true - if the browser cache is not empty.
JavaScript Example
Platform Availability
Available on all platforms except SPA, Desktop Web, and on all Server side Mobile Web
29.5.3 clearHistory
Signature
JavaScript: <widgetid>.clearHistory()
Lua: webwidget.clearhistory(widgetref)
Input Parameters
Return Values
None
JavaScript Example
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, Desktop Web, BlackBerry 10, and
iPhone
29.5.4 goBack
This method provides you with the ability to navigate one step back in the browser history. If the history stack
is empty then this method has no effect.
Note: This method can be used only when canGoBack returns true.
Signature
JavaScript: <widgetid>.goBack()
Lua: webwidget.goback(widgetref)
Input Parameters
Return Values
None
JavaScript Example
browser.goBack()
Platform Availability
Available on all platforms except SPA, Desktop Web, and on all Server side Mobile Web
29.5.5 goForward
This method provides you with the ability to navigate one step forward in the browser history. If there are no
visited links in the history stack, then this method has no effect.
Note: This method can be used only when canGoForward returns true.
Signature
JavaScript: <widgetid>.goForward()
Lua: webwidget.goforward(widgetref)
Input Parameters
Return Values
None
JavaScript Example
Platform Availability
Available on all platforms except SPA, Desktop Web, and Server side Mobile Web
29.5.6 loadData
This method enables you to load the data into the Browser with the provided configuration.
Signature
Input Parameters
Note: On Android platform, only string is accepted. The string should be a base64 encoded
image.
o mimeType [String] [Optional]: Specifies the mime type of the data. the
default mime type is assumed as "text/html". For example,
application/pdf, application/vnd.ms-powerpoint
o encoding [String] [Optional]: Specifies the encoding to be used. The
default encoding is UTF-8. For example, UTF-8 or UTF-16.
o baseURL [String] [Optional]: The base URL for the content. The value is
string specifying the file path.
Return Values
None
Exceptions
JavaScript Example
browserWidget.loadData(data,config);
Platform Availability
1. This method should be called on the Browser widget from the post show of the form.
2. In Android platform, data parameter of the loadData method accepts only a string parameter. All other
parameter types are ignored. Following are the allowed formats for data parameter:
l HTML content string
l base64 image string
3. On iPhone OS version 2.2.1 supports the following documents types:
l Excel (.xls)
l PDF (.pdf)
l PowerPoint (.ppt)
l Word (.doc)
Note: The document formats Excel, PowerPoint, and Word must be saved using Microsoft Office 97 or
newer formats.
29.5.7 reload
This method provides you with the ability to reload the current web page.
Signature
JavaScript: <widgetid>.reload()
Lua: webwidget.reload(widgetref)
Input Parameters
Return Values
None
JavaScript Example
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web
l masterData
29.6.1 masterData
Specifies the content of the browser. The content can be static HTML or a URL.
Depending upon your requirement, you can either choose to enter the HTML content in the Content field or
select the URL option to specify an initial URL.
If you select the URL option, the following properties are made available:
URL
Specifies the initial URL that must be requested from the server. The URL must begin with http:// .
Method
Specifies the HTTP method to use for requesting the initial URL. You can choose either the get or post
methods.
Default: get
Query Data
Specifies the key-value pairs that must be sent to the initial URL.
Type
String
Read / Write
//To specify a URL for a browser widget with ID brws1 and in Form with ID
frm1, enter the following:
frm1.brws1.url="http://www.kony.com"
//To specify static HTML content for a browser widget with ID brws1 and in
Form with ID frm1, enter the following:
frm1.brws1.htmlstring="<html><body> Text with HTML tags </body></html>
Yes
Platform Availability
30. Camera
A Camera widget appears as a button in a form. If you select the Camera widget, the phone camera is invoked
to capture an image (which you can choose to accept or discard) and is stored as a PNG (Portable Network
Graphics) image by default (JPEG in BlackBerry platform) with the original size.
Note: The Camera widget is not supported on all Server side Mobile Web, SPA, and Desktop Web
platforms.
The following are few examples where you can use a Camera widget:
Platform Specific
Basic Properties Layout Properties
Properties
base64 containerWeight accessMode
compressionLevel contentAlignment cameraOptions
focusSkin hExpand captureOrientation
id margin enableOverlay
info marginInPixel enableZoom
isVisible padding enablePhotoCropFeature
maxSideOfTheImage paddingInPixel hoverSkin
rawBytes vExpand imageFormat
scaleFactor widgetAlignment nativeUserInterface
skin overlayConfig
text toolTip
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
The appearance of the camera widget with a text "Camera view" on various platforms is as follows:
Platform Appearance
Android
BlackBerry
iPhone
Platform Appearance
Windows
1. From the IDE, drag and drop the camera widget onto a form (occupies the complete available width).
Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize a camera widget in the horizontal direction, place an HBox on the
form and drag and drop the camera inside the HBox and resize accordingly.
b. If you want to resize a camera widget in the vertical direction, place an HBox on the form
and place a VBox inside the HBox; and drag and drop the camera widget inside the VBox
and resize accordingly.
2. Add text in the text property (for example, Take a Snap) for the camera widget.
Note: If you do not add the text in the text property, the camera widget will not be visible when
rendered.
3. (Optional) On iPhone and Android platforms, you can choose to save the captured image in JPEG
(Joint Photographic Experts Group) format by using the imageFormat property.
4. (Optional) On iPhone and Android platforms, you can customize the native camera view (by overlaying
forms on the native camera) by using the overlayConfig property.
5. (Optional) On iPhone, use the nativeUserInterface property to specify a customized interface.
6. After the camera is launched and an image is captured, the captured image is in the form of rawbytes.
The rawbytes of the captured image are available to an application until the application closes or until
the rawbytes are manually deleted.
(Optional) On iPhone platform, you can choose the accessMode property to specify if the rawbytes of
the captured image must be stored on the disk or in-memory.
If you want to store the rawbytes of the captured image on the device permanently, use the ds.save
API. To retrieve the rawbytes, use the ds.read API. For more information on ds.save and ds.read APIs,
see the Kony API Reference Guide.
Note: For optimization, the raw bytes property can be read only once. Once it is read, the platform releases
the handle.
The camera image handle is provided to the action handler and if the action handler does not store the image
handle, the image cannot be retrieved from the widget (the camera widget does not have the
getImageHandle method).
Pitfalls
l If you delete the rawbytes using the releaseRawBytes method, you will not be able to access the
captured image.
l On iPhone, the size of the captured image varies from device to device and is not the same. You must
take this factor into consideration when you are working with the image.
To have a consistent size of the captured image across all iPhone devices, you can use the
maxSideOfTheImage property to specify width and height of the captured image.
Important Considerations
The following are the important considerations of the camera widget across all platforms and individual
platforms:
l You can down scale a captured image (using maxSideOfTheImage and the scaleFactor
properties) but cannot up scale a captured image.
l The click events on camera Overlay form works only if hideControlBar property is set to true.
l On iOS devices, due to technical limitation, avoid overlayForm option when nativeUserInterface
is set to true.
l Using custom controls (like Tap anywhere) is not allowed with hideControlBar property is set to
true.
l For overlay forms that require orientation works only if hideControlBar property is set to true.
l Kony popup added to any of the overlay form widget must be anchored.
l cameraOptions should not be modified in camera preview mode.
l Only pre-show and post show events of the overlay form are respected.
l Flash mode always on (constants.FLASH_MODE_ALWAYS_ON) is not supported. If set, it
will change to Flash mode as on (constants.FLASH_MODE_ON).
l BlackBerry: The following are the important considerations:
l Camera OverlayForm , displayOrientation is not respected in devices with OS versions < 3.0 ,
by default OverayForm is shown in Portrait mode.
l The picture captured orientation is not respected in OS versions < 3.0, by default the picture is
captured in Landscape mode.
l base64
l compressionLevel
l focusSkin
l id
l info
l isVisible
l maxSideOfTheImage
l rawBytes
l scaleFactor
l skin
l text
30.1.1 base64
If the image source is a URL, and if the image is not downloaded, or if it encounters an error while
downloading, null/nil is returned.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: base64
Lua: base64
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.1.2 compressionLevel
Specifies the compression level or picture quality with which the captured image must be stored. You can
specify the compression level value between 0 (best picture quality) and 100 (low picture quality).
Note: On Android platform, compressionLevel property is applicable only when you set enableOverlay as
true.
Syntax
JavaScript: compressionLevel
Lua: compressionlevel
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango), Windows Kiosk, and on all Server side
Mobile Web, SPA, and Desktop Web platforms
30.1.3 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, BlackBerry 10, and Desktop Web
platforms
30.1.4 id
id is a unique identifier of Camera consisting of alpha numeric characters. Every Camera should have a
unique id within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
//Reading id of Camera.
alert("Camera id::"+camera1.id);
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.1.6 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms.
30.1.7 maxSideOfTheImage
Specifies the width of the camera picture/image. It is used to set the resolution (width * height) of the camera
picture. On Android platform, this property is applicable only when "enableOverlay" property is set to true. For
example, if maxSideOfTheImage = 1600, if the device has exact matching resolution (in width ie. 1600*1200),
then 1600 * 1200 resolution is used to set the camera picture size.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: maxSideOfTheImage
Lua: maxsideoftheimage
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
var camPSP={};
No
Platform Availability
Available on all platforms except Windows Phone (Mango), Windows Kiosk, Server side Mobile Web,
SPA, and Desktop Web platforms
30.1.8 rawBytes
Specifies the rawbytes representing an Image (usually the image captured from the camera) that can be used
as a background for the Camera. You cannot assign rawBytes directly to a button widget. The rawBytes has
to be assigned to an Image widget or Button widget that has image skin.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: rawBytes
Lua: rawbytes
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.1.9 scaleFactor
Specifies the ratio by which the captured image is reduced. You can set the scale factor between 10 and 100.
If you set the scale factor as 100, no reduction takes place and the actual image is returned. If you set the
value as 10, an image which is reduced to 10% of the actual captured image is returned.
Note: On Android platform, scaleFactor property is applicable only when you set enableOverlay as true.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: scaleFactor
Lua: scalefactor
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango), Windows Kiosk, Server side Mobile Web,
SPA, and Desktop Web platforms
30.1.10 skin
Specifies the look and feel of the Camera when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, BlackBerry 10, and Desktop Web
platforms.
30.1.11 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
30.2.1 containerWeight
Specifies the percentage of width that should allocated by its parent widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
weight except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.2.2 contentAlignment
Specifies the alignment of the text on the Camera with respect to its boundaries. A default value CONTENT_
ALIGN_CENTER is assigned for all platforms. To choose another alignment, click the drop-down arrow and
select the desired alignment. However, to change the default value on a particular platform, select the button
next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_CENTER (the default value for all platforms is center; content is aligned at the
center of the RichText )
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the Camera.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the Camera.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the Camera.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the Camera.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the Camera.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the Camera.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the Camera.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
Camera.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the Camera.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, SPA, and Desktop Web platforms
30.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, SPA, and Desktop Web platforms
30.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
30.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, BlackBerry 10, SPA, and Desktop Web
platforms
30.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
30.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Server side Mobile Web does not support the Expand property. This is because a widget in a Mobile
Web cannot expand or contract based on the neighboring widget (default behavior of a widget in a Mobile
Web).
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT - (BlackBerry 10 supports this option)
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
l accessMode
l cameraOptions
l captureOrientation
l enableOverlay
l enableZoom
l enablePhotoCropFeature
l hoverSkin
l imageFormat
l nativeUserInterface
l overlayConfig
l toolTip
30.3.1 accessMode
Specifies how the captured image must be stored. This property is enabled when the launchMode is
overlayform for Android and Windows Phone.
Note: On Android Platform, this property is respected only if the enableOverlay is set to true and in
overlayConfig > Android> overlayForm is set to a form name.
JavaScript: accessMode
Lua: accessmode
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
l Windows Tablet
30.3.2 cameraOptions
l flashMode : Enables you to control the flash on the device when the camera is turned on.
Note: Devices may have different flash capabilities that are dependent on the camera driver.
Default : constants.FLASH_MODE_AUTO
Default : false
Note: For iOS < 7.0, when hideControlBar is set to true, there will be a blank space (black or white
color) in place of camera control bar in iPhone device. The space of the control bar depends on the
device model (iPhone 5 device has 96px and iPhone 4 has 54 px). It is recommended to note this
point while designing the overlay form for the camera.
l captureButtonSkin : Specifies the skin for a captured button. This option is applicable on Android
platform only and is respected only when hideControlBar is set to true.
l captureButtonText : Specifies the text for a captured button. This option is applicable on Android
platform only and is respected only when hideControlBar is set to true.
Syntax
JavaScript: cameraOptions
Type
JavaScript: JSObject
Read / Write
JavaScript Example
No
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Tablet
30.3.3 captureOrientation
Note: This property works for complete image and not for cropped image. Thus it is considered only when
referenceImageToCrop is not provided. In cases, where referenceImageToCrop is provided, this property is
ignored.
Note: For Windows Phone 8 and Windows 8.1, irrespective of the orientation, if the image has to be appear
as it was capture, set the displayOrientation as FORM_DISPLAY_ORIENTATION_BOTH. If you set
displayOrientation as FORM_DISPLAY_ORIENTATION_PORTRAIT and the image is captured in
landscape mode, then the captured image is tilted by 90 degrees when the device is rotated.
Default: CAMERA_CAPTURE_ORIENTATION_DEFAULT
JavaScript: accessMode
Lua: accessmode
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
30.3.4 enableOverlay
The camera is launched with capability of over-lay a Form UI over the camera view.
Default : false
Syntax
JavaScript: enableOverlay
Lua: enableoverlay
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
30.3.5 enableZoom
Set this property as true to enable pinch to zoom of camera preview in overlay mode. This property is
supported only when enableOverlay property is set to true.
Note: This property works only on devices with OS 2.2.x and above, which support camera zooming . When
the camera is zoomed, the actual picture size may be smaller than the picture size setting as per Native
Android Documentation.
Default : false
Syntax
JavaScript: enableZoom
Type
JavaScript: Boolean
Read / Write
JavaScript Example
frm.camera1.enableZoom = true;
Yes
Platform Availability
l Android
l Android Tablet
30.3.6 enablePhotoCropFeature
Default: false
Syntax
JavaScript: enablePhotoCropFeature
Lua: enablephotocropfeature
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
30.3.7 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Yes
Availability on platforms
30.3.8 imageFormat
Specifies if the image must be stored as a PNG (Portable Network Graphics) or a JPEG (Joint Photographic
Experts Group) image.
Default: CAMERA_IMAGE_FORMAT_PNG
l CAMERA_IMAGE_FORMAT_PNG : When you select this option the image is always stored as PNG
format.
l CAMERA_IMAGE_FORMAT_JPEG : When you select this option the image is always stored as
JPEG format.
Syntax
JavaScript: imageFormat
Lua: imageformat
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
30.3.9 nativeUserInterface
Specifies if the camera must have the native interface on camera view (an interface with the default platform
controls for camera) or the user interface with custom options.
Default: true
Note: On iOS devices, due to technical limitation, avoid overlayForm option when nativeUserInterface is
set to true.
Syntax
JavaScript: nativeUserInterface
Lua: nativeuserinterface
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
30.3.10 overlayConfig
The following are the configurable properties applicable to iOS, Windows Phone, and Android platforms:
l overlayForm : Specifies the reference of the form to be rendered over the camera view. When this
option is set, the captureOrientation property is not respected.
Note: On iOS devices, due to technical limitation, avoid overlayForm option when nativeUserInterface is
set to true.
Default : None
l referenceImageToCrop : Specifies the reference of the Image widget in the overlayForm which
guides the camera to crop the captured image to the referenceImage dimensions.
Default : None
l tapAnywhere : Specifies to capture an image with a tap on the camera overlay view. This option is
applicable to Windows Phone and Android platforms only.
Default : false
l captureButtonSkin : Specifies the skin for a captured button. This option is applicable to Android
platform only.
l captureButtonText : Specifies the text for a captured button. This option is applicable to Android
platform only.
Note: For Windows Tablet platform, the call back event is executed only when you come back to the calling
form by selecting the Back button in app menu in Form overlay view.
Syntax
JavaScript: overlayConfig
Lua: overlayconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Tablet
30.3.11 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l onCapture
l onCaptureFailed
l onImageSaveFailed
30.4.1 onCapture
Signature
JavaScript: onCapture
Lua: oncapture
Read / Write
JavaScript Example
//The below function is the callback for onCapture event of the Camera wid
get.
function onCapturCalBck(camera)
{
//Write logic here
}
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, SPA, and Desktop Web platforms
30.4.2 onCaptureFailed
An event callback is invoked when the user has tapped on Don't Allow over permission alert and also when
camera privacy is turned off under iPhone settings. If the user taps on Allow for the very first time it will
immediately open the camera screen. Camera screen will not be shown until the user has set the permission.
Callback will be invoked asynchronously when user selects Don't Allow over permission alert.
The camera permission alert shows up once in app lifecycle. Upgrading or deleting or reinstalling the app will
not trigger the alert, if it has already been shown.
Signature
JavaScript: onCaptureFailed
Read / Write
JavaScript Example
//The below function is the callback for onCaptureFailed event of the Came
ra widget.
function onCaptureFailedCalBck(camera)
{
//Write logic here
}
No
Platform Availability
30.4.3 onImageSaveFailed
An event callback is invoked when the user has performed some action over permission alert and also when
image cannot be saved to photo album or due to data save error.
Signature
JavaScript: onImageSaveFailed
Read / Write
JavaScript Example
No
Platform Availability
l closeCamera
l releaseRawBytes
l takePicture
30.5.1 closeCamera
This method allows you to close the camera. But on Andoid platform, this method is applicable only when an
overlay form is enabled and is ignored when overlayForm is disabled.
Signature
JavaScript: closeCamera
Input Parameters
None
Return Values
None
Error Codes
No error codes
JavaScript Example
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l Windows Phone (Mango)
30.5.2 releaseRawBytes
This method allows you to delete the rawbytes for the image captured from the camera.
If you use this method, the captured image is deleted from the device irrespective of it being on the disk or in-
memory.
Note: If you store the rawbytes of the captured image in some location on the device by using the ds.save
API; and you call this method, the rawbytes are deleted from the disk or in-memory, but the image stored in
the specific location remains intact (you must delete the stored image manually).
Signature
JavaScript: releaseRawBytes(rawbytes)
Lua: releaserawbytes(rawbytes)
Input Parameters
Return Values
None
Error Codes
No error codes
JavaScript Example
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l Windows Phone (Mango)
30.5.3 takePicture
This method allows you to capture the picture when the camera is in preview mode. But in Android platform,
this method is applicable only when an overlay form is enabled and is ignored when overlayForm is disabled.
Signature
JavaScript: takePicture
Input Parameters
None
Return Values
None
Error Codes
No error codes
JavaScript Example
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l Windows Phone (Mango)
Specifies if the rawbytes of the captured image must be stored on the disk or in-memory.
Default: true (the checkbox is selected and the rawbytes of the captured image is stored on the disk)
If you leave the default option (true) unchanged, the rawbytes is the handle to the image stored on the disk.
If you do not want the captured image to be stored on the disk and want to store the rawbytes in in-memory
(For example, for a Financial Application you might not prefer to store the rawbytes on the disk), change the
value to false (clear the checkbox).
Note: If your application uses the rawbytes for a very short time, we recommend that you set the value to
false and delete the rawbytes after its purpose is served by using the releaserawbytes method.
If you set the value to false, the rawbytes is the handle to the actual image data.
Note: The rawbytes of the captured image are available to an application until the application closes or until
the rawbytes are manually deleted. For a good user experience, we recommend that you delete the
rawbytes of the captured image after its purpose is served.
To delete the rawbytes of the captured image from the disk or in-memory use the releaserawbytes method.
If you want to store the rawbytes of the captured image on the device permanently, use the ds.save API. To
retrieve the rawbytes, use the ds.read API. For more information on ds.save and ds.read APIs, see the
Kony API Reference Guide.
Type
Boolean
Read / Write
No
Yes
Platform Availability
l iPad
l iPhone
l Windows Phone/Windows Kiosk - This property is not supported on Kiosk .
30.6.2 mode
If you select the Mode as native, the native camera application is launched for image capture.
If you select the Mode as overlay, a form is overlaid over the camera preview.
Note: You can use the overlay form when you are developing a Remote Deposit Capture application (a
banking application using which you can deposit a bank check remotely without going to a bank).
If you select the Mode as overlay, the following properties are enabled:
Specifies the form that must be overlaid on the camera preview. All the forms that are available are listed
in the drop-down. You can select the desired form from the list.
Note: If you select the Mode as overlay and do not specify an overlay form, the camera widget does
not appear when rendered.
Image Widget
Specifies the image widget (which is already available in the overlay form) that must be used as
the overlay on the camera. Based on the image widget, the captured image is cropped (only the
portion of the captured image which is within the image widget is saved).
If you want to crop the captured image, select the widget ID that you want to use as a reference
for cropping the image from the drop-down list.
Specifies if the image must be captured when there is a tap on the camera preview screen.
Default: false (the image is not captured if there is a tap on the camera preview screen. The image is
captured with the Capture Button)
If you want to be able to capture an image by tapping the camera preview screen, select true.
Note: On iPhone platform, to enable the Tap Anywhere feature, go to Project Properties > Native
App> iPhone/iPad and set the camera Settings to true.
Image Type
Specifies if the image must be stored as a PNG (Portable Network Graphics) or JPEG (Joint
Photographic Experts Group) image. Click here for more information about this property.
Specifies how the captured image must be stored. You can select one of the following options:
Public
This is the default selection value. If you leave the selection unchanged, the captured image is
stored on the device and is visible to all the applications on the device (For example, Phone
Image Gallery).
Private
If you select this option, the captured image will not be visible to any other application on the
device. The captured image will remain private to the application (any application that is using
the camera widget).
In Memory
If you select this option, the captured camera image is stored in-memory and not written to the
disk. The in-memory image can be accessed through the rawbytes property or the base64
property. When you access this image for the first time using either of these properties, the
reference to in-memory bytes is removed from the camera widget.
Note: When you set the Access Mode as In Memory, ensure to call releaserawbytes method to
free the memory of the rawbytes.
Specifies the size of the image to be captured. You can select one of the following options:
thumbnail
This is the default value. The resolution of the image is low and occupies less memory.
cameradefault
The following images illustrate the view mode of a camera on an Android device with and without a
customized overlay form:
Type
String
Read / Write
No
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l Windows Phone/Windows Kiosk - Overlay property is supported only on mango.
31. HorizontalImageStrip
HorizontalImageStrip also called as Hz Image Strip displays a list of images which are aligned side-by-side in
the horizontal direction. You can scroll through the Hz Image Strip to view the next or previous set of images.
You can use an Hz Image Strip to display a set of images to give an idea to the user about the available
products or a location (for example, in a Travel Application, you can add images of popular tourist destinations
or add images of the different suites available in a hotel).
Hz Image Strip widget provides you with an option to set Basic Properties, Layout Properties, Platform
Specific Properties, Events, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
arrowConfig containerWeight hoverSkin
data imageScaleMode toolTip
focusSkin margin
id marginInPixel
imageWhenFailed padding
imagewhileDownloading paddingInPixel
info referenceHeight
isVisible referenceWidth
selectedIndex widgetAlignment
selectedItem
showArrows
showScrollbars
skin
spaceBetweenImages
viewConfig
viewType
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
function onSelectionCallBack(hIS)
{
//Write your logic here.
}
For backward compatibility with support for all deprecated properties and behaviors, use the constructor
kony.ui.HorzontalImageStrip .
1. From the IDE, drag and drop the Hz Image Strip onto a Form (occupies the complete available width).
Or, based on your requirements, you can choose to perform any of the following options:
a. If you want to resize the Hz Image Strip in the horizontal direction, place an HBox on the Form
and drag and drop the Hz Image Strip inside the HBox and resize accordingly.
b. If you want to resize the Hz Image Strip in the vertical direction, place an HBox on the Form and
place a VBox inside the HBox; and drag and drop the Hz Image Strip inside the VBox and resize
accordingly.
2. Specify the images (local or remote) that must be displayed using the data property.
Note: For a good user experience, you must add images of the same width and height.
Note: To specify local images, you must add the PNG or JPEG files (the file names must follow a particular
naming convention) to the resources folder of the Application. For more information on how to add these
files, see the Working with Resources section of the Kony Studio User Guide.
3. (Optional) If you are specifying remote images, you can use the following properties as per your
requirement:
l imageWhenFailed: Specifies the image to indicate that the image (that is being downloaded) is
not available.
l imageWhileDownloading: Specifies the image to indicate that the download is taking place over
a network connection.
4. Specify the desired spaceBetweenImagespace.
5. Specify the onSelection event.
Customizing Appearance
You can customize the appearance of the Hz Image Strip by using the following properties:
Important Considerations:
l For a good user experience, you must add images of the same width and height.
l You can scroll through one or more images at a time (platform dependent).
l If you reach the end of an image strip and if there are additional images, a network call is placed to get
the additional images.
l In Android platform, images are displayed from the middle of the widget.
l For Symbian, HzImageStrip always uses an image size of 64x64 pixels.
l arrowConfig
l data
l focusSkin
l id
l imageWhenFailed
l imageWhileDownloading
l info
l isVisible
l selectedIndex
l selectedItem
l showArrows
l showScrollbars
l skin
l spaceBetweenImages
l viewConfig
l viewType
31.1.1 arrowConfig
Specifies the configurable arrow properties of the HorizontalImageStrip. This property is available only when
showArrows is set to true.
Note: The options leftArrowFocusImage and rightArrowFocusImage are not supported in BlackBerry,
Mobile Web, and SPA platforms.
Syntax
JavaScript: arrowConfig
Lua: arrowconfig
Type
JavaScript: JSObject
Lua: UserData
Read / Write
No
JavaScript Example
Yes
Platform Availability
31.1.2 data
Specifies the JSObject which represents the images to be rendered in horizontal image strip.
Syntax
JavaScript: data
Lua: data
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
31.1.3 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms
31.1.4 id
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
31.1.5 imageWhenFailed
Specifies the image to be displayed when the remote resource is not available. This image is taken from the
resources folder.
Syntax
JavaScript: imageWhenFailed
Lua: imagewhenfailed
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and Windows Kiosk platforms
31.1.6 imageWhileDownloading
Specifies the image to be displayed when the remote source is still being downloaded. This image is taken
from the resources folder.
Syntax
JavaScript: imageWhileDownloading
Lua: imagewhiledownloading
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and Windows Kiosk platforms
31.1.7 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//Defining the properties for Horizontal Image strip with info property.
var hISBasic={id:"hIS", skin:"hISkn", focusSkin:"hISknFocus", isVisible:tr
ue, selectedIndex:1, imageWhileDownloading:"img.png", imageWhenFailed:"img
3.png", spaceBetweenImages:20, data:[[{"imagekey":"image1.png"}, {"imageke
y":"image2.png"}, "imagekey"]], viewType:constants.HORIZONTAL_IMAGESTRIP_V
IEW_TYPE_COVERFLOW, showArrows:true, showScrollbars:true};
var hISLayout={padding:[5,5,5,5], paddingInPixel:true, referenceWidth:100,
referenceHeight:100, imageScaleMode:constants.IMAGE_SCALE_MODE_FIT_TO_DIME
NSIONS, containerWeight:100};
var hISPSP={};
No
Platform Availability
31.1.8 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can also set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
31.1.9 selectedIndex
Indicates the currently selected row in the HorizontalImageStrip. The index is with respect to the order in
which data is set with data property. Programmatically setting the selected Index will not make any visible
differences in the row, however it will bring the row at the index into the view able area on the screen. Setting it
to null/nil clears the selection state.In JavaScript the Index is '0' based and in Lua it is '1' based.
Note: If data contains the sections then the selectedIndex indicates the selected row index within the
section.
Syntax
JavaScript: selectedIndex
Lua: selectedindex
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
31.1.10 selectedItem
Returns the selected data object (input array) corresponding to the selected image of the
HorizontalImageStrip. If no image is selected, null/nil is returned.
Syntax
JavaScript: selectedItem
Lua: selecteditem
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
31.1.11 showArrows
Specifies the arrow images must be displayed on the left and right edges of the HorizontalImageStrip.
Default: false
Syntax
JavaScript: showArrows
Lua: showarrows
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
31.1.12 showScrollbars
Syntax
JavaScript: showScrollbars
Lua: showscrollbars
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
31.1.13 skin
Specifies the look and feel of the HorizontalImageStrip when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
31.1.14 spaceBetweenImages
Specifies the space between the images in the horizontal image strip.
Syntax
JavaScript: spaceBetweenImages
Lua: spacebetweenimages
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
31.1.15 viewConfig
Specifies the view configuration properties for various view types in the horizontal image strip. Following are
the available view types:
l projectionAngle [Number]: Specifies the angle in degrees between a row except at center and at
z-axis. When the projection angle is 0, all the rows are aligned along z-axis one behind the other.
When previewed, it only shows one row at center. When projection angle is 90, all the rows are
aligned along x-axis side by side. If the value entered is negative then the resultant angle is 90 +
entered value. For example, if projection angle is -30 then resultant projection angle is 90 - 30 =
60 degrees. It accepts a range between -90 and +90 only. (Available on Android only)
l imageItemRotationAngle [Number]: Specifies the angle in degrees of rotation of each row along
its own y-axis. It accepts a range between 0 and 360. (Available only on android)
l isCircular [Boolean]: When set to true, it specifies the widget to scroll endlessly (repeating the
first row after you reach the last row) and when set to false, it stops scrolling after you reach the
last row. (Available only on android)
l HORIZONTAL_IMAGESTRIP_VIEW_TYPE_ SLOTVIEW : This property accepts a JSObject with
the below key-value pairs:
l flingVelocity: Accepts a number (in density independent pixels) representing the velocity at
which user flings the imagestrip in order to activate auto-flipping the images. Not mandatory
(Available only on android)
l flipInterval: Accepts a number in milliseconds representing the time interval to wait before
flipping to the next image. This is applicable when auto-flipping is activated when user flings.
(Available only on android)
l scrollDistance: Accepts a number (in density independent pixel) representing the touch scroll
distance to travel to consider for navigation between images. Not mandatory (Available only on
android)
l HORIZONTAL_IMAGESTRIP_VIEW_TYPE_STRIPVIEW : This property accepts a JSObject with
the below key-value pairs:
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
Yes
Platform Availability
Available on all platforms except Server side Mobile Web and BlackBerry 10 platforms
31.1.16 viewType
Default: HORIZONTAL_IMAGESTRIP_VIEW_TYPE_STRIPVIEW
The below table shows the list of view types and their availability in different platforms:
BlackBerry /J2ME/
Windows BlackBerry
viewType iPhone Android Windows
Phone/SPA Kiosk 10
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
STRIPVIEW
Yes Yes Yes Yes Yes
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
SLOTVIEW
Yes Yes Yes No Yes
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
LINEAR
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
ROTARY
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
INVERTED_ROTARY
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
CYLINDRICAL
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
INVERTED_CYLINDRICAL
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
COVERFLOW
Yes Yes No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
COVERFLOW2
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
STACK
Yes No No No No
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_
PAGEVIEW
No No Yes Yes No
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
//Defining the properties for Horizontal Image strip with viewType as COVE
RFLOW.
var hISBasic={id:"hIS", skin:"hISkn", focusSkin:"hISknFocus", isVisible:tr
ue, selectedIndex:1, imageWhileDownloading:"img.png", imageWhenFailed:"img
3.png", spaceBetweenImages:20, data:[[{"imagekey":"image1.png"}, {"imageke
y":"image2.png"}, "imagekey"]], viewType:constants.HORIZONTAL_IMAGESTRIP_V
IEW_TYPE_COVERFLOW, showArrows:true, showScrollbars:true};
var hISLayout={padding:[5,5,5,5], margin:[5,5,5,5], paddingInPixel:true,
Yes
Platform Availability
l containerWeight
l imageScaleMode
l margin
l marginInPixel
l padding
l paddingInPixel
l referenceHeight
l referenceWidth
l widgetAlignment
31.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Note: If you want to restrict the width of the image, then choose the appropriate container weight. It
becomes developer responsibility to serve the right kind of images as per device screen form factors.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
31.2.2 imageScaleMode
A value of the this property specifies how the rendered image's width and height are identified if those of the
source image varies from the Image widget itself. Image Widget represents the underlying native widget
which renders (and applies alignment to) the Source Image.
Default: IMAGE_SCALE_MODE_MAINTAIN_ASPECT_RATIO
The image aspect ratio is the width (x) of the image compared to its height (y). A square image has a ratio of
1:1, but a non-square (rectangular) image does not have the same height and width. It is commonly expressed
as two numbers separated by a colon, as in 16:9.
Before rendering the Image first the width and height of the Image widget is calculated. The width and height
are driven by the container weight that has been specified or referenceWidth and referenceHeight whichever
are applicable. Now the Source Image is scaled or cropped as per the ImageScale modes set in the property.
Note: For dynamic images (loaded from a remote server), specifying a referenceWidth / referenceHeight
avoids unnecessary screen re-layouts.
l If the source image size is less than the ImageWidget size then source image is rendered as is.
The ImageWidget is aligned as per the widget alignment rules.
l If the source image is size is greater than the ImageWidget size then the source image is
resized to the ImageWidget dimensions while maintaining the aspect ratio.
l Height is derived from reference height specified, if reference height is specified. If not
the actual Image height is taken.
l IMAGE_SCALE_MODE_CROP: This scale mode preserves the original size of the Source Image. In
case,
l If the source image size is less than the ImageWidget size then source image is rendered as is.
l If the source image is size is greater than the ImageWidget size then the source image is
cropped or clipped to fit the ImageWidget.
Note: referenceWidth and referenceHeight are not mandatory for this scalemode. This mode is not
supported on Mobile Web and SPA. they will render the sourceImage as its actual size.
l If the source image size is less than the ImageWidget size then source image is stretched to
the ImageWidget dimensions (height and width).
l If the source image is size is greater than the ImageWidget size then the source image is
squeezed to fill the ImageWidget dimensions (height and width).
Note: referenceWidth and referenceHeight are mandatory for this scalemode. Not specifying the
referenceWidth / referenceHeight will lead to undefined behaviour.
Note: If the reference image is bigger than container weight, Mobile Web and SPA platforms may not be
able to adhere to the container weight but will spill over.
Syntax
JavaScript: imageScaleMode
Lua: imagescalemode
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms, but the option IMAGE_SCALE_MODE_CROP is not supported on Desktop
Web.
31.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
31.2.4 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
31.2.5 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10.
31.2.6 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
var hISPSP={};
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
31.2.7 referenceHeight
It is the reference image height in pixels. The source image height is resized to fill the widget dimensions. The
image aspect ratio is not preserved. The referenceHeight is respected only when the imageScaleMode
property is set to IMAGE_SCALE_MODE_FIT_TO_DIMENSIONS. The pixels are device independent
pixels specified against 163 dpi.
For example, HzImage widget dimensions are 200 x 100 (height and width respectively ) and your image is
300 x 200 px, then you have to specify referenceHeight as 200 and referenceWidth as 100. The image is
resized to fit in the widget by reducing the height and width.
Syntax
JavaScript: referenceHeight
Lua: referenceheight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
var hISBasic={id:"hIS",skin:"hISkn",focusSkin:"hISknFocus",isVisible:true,
selectedIndex:1, imageWhileDownloading:"img.png", imageWhenFailed:"img3.pn
g", spaceBetweenImages:20, data:[[{"imagekey":"image1.png"}, {"imagekey":"
image2.png"}, "imagekey"]], viewType:constants.HORIZONTAL_IMAGESTRIP_VIEW_
TYPE_COVERFLOW, showArrows:true, showScrollbars:true};
var hISLayout={padding:[5,5,5,5], margin:[5,5,5,5], referenceWidth:100, re
ferenceHeight:100, imageScaleMode:constants.IMAGE_SCALE_MODE_FIT_TO_DIMENS
IONS, containerWeight:100};
var hISPSP={};
Yes
Platform Availability
31.2.8 referenceWidth
It is the reference image width in pixels.The source image width is resized to fill the widget dimensions. The
image aspect ratio is not preserved. The referenceWidth is respected only when the imageScaleMode
property is set to IMAGE_SCALE_MODE_FIT_TO_DIMENSIONS. The pixels are device independent
pixels specified against 163 dpi.
For example, HzImage widget dimensions are 200 x 100 (height and width respectively ) and your image is
300 x 200 px, then you have to specify referenceHeight as 200 and referenceWidth as 100. The image is
resized to fit in the widget by reducing the height and width.
Syntax
JavaScript: referenceWidth
Lua: referencewidth
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
31.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l hoverSkin
l toolTip
31.3.1 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
Yes
JavaScript Example
Yes
Availability on platforms
31.3.2 toolTip
Specifies the hint text when the cursor hovers over a widget, without clicking it. The text entered in the tooltip
appears as a small box when the cursor hovers over a widget.
Syntax
JavaScript: toolTip
Lua: tooltip
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
l onSelection
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
31.4.1 onSelection
An event callback that is invoked by the platform when an Image is selected in HorizontalImageStrip.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
function onSelectionCallBack(hIS)
{
//Write your logic here.
}
Yes
Platform Availability
31.4.2 preOnclickJS
This event allows the developer to execute custom javascript function when the HorizontalImageStrip is
invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
31.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the
HorizontalImageStrip is invoked. This is applicable only for Mobile Web channel.The function must exist in a
javascript file under project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
Yes
Platform Availability
l addAll
l addDataAt
l removeAll
l removeAt
l setData
l setDataAt
31.5.1 addAll
This method allows you to add new images to the HorizontalImageStrip. The new images are appended to the
existing images. If the Hz Image Strip has no images, the new images are placed in the HorizontalImageStrip.
Signature
JavaScript: addAll(array_of_data,image_url_property)
Input Parameters
Return Values
None
JavaScript Example
//Adding new new images to the Horizontal Image strip by addAll method, We
can use external URL images or the images inside resources folder.
hIS.addAll( [{ imageurl: "http://chromeactions.com/i/3d-like-box.png" },
{ imageurl: "http://www.unlockiphoneinstantly.com/wp-content/themes
/unlockiphone/images/check-box.jpg" }],"imageurl"
);
Error Codes
No error codes
Platform Availability
31.5.2 addDataAt
Allows you to add/insert a new image at a given index. In case the index is not valid and not falling in range 0
<= index <= N, where N is the total number of records image is added at the end of the horizontal Image strip.
Signature
Input Parameters
Return Values
None
JavaScript Example
Error Codes
No error codes
Platform Availability
31.5.3 removeAll
Signature
JavaScript: removeAll()
Lua: imagestrip.removeAll(widgetid)
Input Parameters
Return Values
None
JavaScript Example
//Removing all the images inside the Horizontal Image strip using removeAll
method.
hIS.removeAll();
Error Codes
No error codes
Platform Availability
31.5.4 removeAt
Removes the image at the given index in the HorizontalImageStrip. In JavaScript the Index is '0' based and in
Lua it is '1' based.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
JavaScript: removeAt(index)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
No error codes
Platform Availability
31.5.5 setData
Allows you to set new images to the Hz Image Strip. The existing images will be replaced with the new
images.
Signature
JavaScript: setData(array_of_data,image_url_property)
Input Parameters
Return Values
None
JavaScript Example
//Replacing existing images with the new images using setData method,We can
use external URL images or the images inside resources folder.
hIS.setData([{ imageurl: "http://chromeactions.com/i/3d-like-box.png" },
{ imageurl: "http://chromeactions.com/i/3d-like-box.png1" },
{ imageurl: "http://www.unlockiphoneinstantly.com/wp-content/themes
/unlockiphone/images/check-box.jpg" },
{ imageurl: "http://chromeactions.com/i/3d-like-box.png1" },
{ imageurl: "image2.png"}],"imageurl"
);
Error Codes
No error codes
Platform Availability
31.5.6 setDataAt
Allows you to set a new image at a given index. The existing image at that index will be replaced with the new
image. In case the index is not valid and not falling in range 0 <= index <= N, where N is the total number of
records then the operation is ignored.
Signature
Input Parameters
Return Values
None
JavaScript Example
Error Codes
No error codes
Platform Availability
l frameHeight
l height
l viewConfig
l width
31.6.1 frameHeight
Specifies the height of the Hz Image Strip in pixels. The height of the images in the Hz Image Strip will not
exceed the height specified in this property.
Default: 100 (the height of the Hz Image Strip is set to 100 pixels)
To change the default height, enter the desired height in this property.
Type
Number
Read / Write
No
Yes
Platform Availability
31.6.2 height
Note: If the height of the image exceeds the height of the Hz Image Strip, the image size is scaled to fit the
HzImagestrip.
Type
Number
No
Yes
Platform Availability
31.6.3 viewConfig
Note: The two options coverflowAngle and coverflowDepth are deprecated. The option coverflowAngle is
mapped to imageItemRotationAngle.
Specifies the view configuration properties for various view types in the horizontal image strip. Following are
the available view types:
l coverflowAngle: Accepts a number representing the angle at which the non-focused images are
rendered. (Available only on android)
l coverflowDepth: Accepts a number (in density independent pixel) representing the depth at
which the non-focused images should be rendered. (Available only on android)
l HORIZONTAL_IMAGESTRIP_VIEW_TYPE_ SLOTVIEW : This property accepts a JSObject with
the below key-value pairs:
l flingVelocity: Accepts a number (in density independent pixels) representing the velocity at
which user flings the imagestrip in order to activate auto-flipping the images. Not mandatory
(Available only on android)
l flipInterval: Accepts a number in milliseconds representing the time interval to wait before
flipping to the next image. This is applicable when auto-flipping is activated when user flings.
(Available only on android)
l scrollDistance: Accepts a number (in density independent pixel) representing the touch scroll
distance to travel to consider for navigation between images. Not mandatory (Available only on
android)
l HORIZONTAL_IMAGESTRIP_VIEW_TYPE_STRIPVIEW : This property accepts a JSObject with
the below key-value pairs:
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
Yes
Platform Availability
31.6.4 width
Type
Number
No
Yes
Platform Availability
32. ImageGallery
ImageGallery represents a set of images adjacent to each other. If the images exceed the row size, they are
pushed to the next line.
ImageGallery provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, Events, and Methods.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
For backward compatibility with support for all deprecated properties and behaviors, use the constructor
kony.ui.ImageGallery.
1. From the IDE, drag and drop the ImageGallery onto a Form (occupies the complete available width).
2. Specify the images (local or remote) that must be displayed using the data property.
Note: To specify local images, you must add the PNG or JPEG files (the file names must follow a particular
naming convention) to the resources folder of the Application. For more information on how to add these
files, see the Working with Resources section of the Kony Studio User Guide.
3. (Optional) If you are specifying remote images, you can use the following properties as per your
requirement:
l imageWhenFailed: Specifies the image to indicate that the image (that is being downloaded) is
not available.
l imageWhileDownloading: Specifies the image to indicate that the download is taking place over
a network connection.
4. Specify the desired spaceBetweenImages.
5. Specify the onSelection event.
Customizing Appearance
You can customize the appearance of the Image Gallery by using the following properties:
l imageScaleMode: Specifies the scale mode for all the images in the ImageGallery.
l referenceHeight: Specifies the reference height of the ImageGallery in pixels.
l referenceWidth: Specifies the reference width of the ImageGallery in pixels.
l margin: Defines the space around a widget.
l skin: Specify the skin to be applied to the images in the Image Gallery.
l focusSkin: Specify the skin to be applied to the individual image in the ImageGallery when in focus.
Important Considerations:
l data
l focusSkin
l id
l imageWhenFailed
l imageWhileDownloading
l info
l isVisible
l selectedIndex
l selectedItem
l skin
l spaceBetweenImages
32.1.1 data
Represents the JSObject to represent the images to be rendered in ImageGallery. The format of the JSObject
consists of an array of two elements:
Syntax
JavaScript: data
Lua: data
Type
JavaScript: Array
Lua: Table
Read / Write
Yes
Platform Availability
32.1.2 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
32.1.3 id
id is a unique identifier of ImageGallery consisting of alpha numeric characters. Every ImageGallery should
have a unique id within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
32.1.4 imageWhenFailed
Specifies the image to be displayed when the remote resource is not available. This image is taken from the
resources folder.
Syntax
JavaScript: imageWhenFailed
Lua: imagewhenfailed
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, BlackBerry 10, and Windows Kiosk
platforms
32.1.5 imageWhileDownloading
Specifies the image to be displayed when the remote source is still being downloaded. This image is taken
from the resources folder.
Syntax
JavaScript: imageWhileDownloading
Lua: imagewhiledownloading
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, BlackBerry 10, and Windows Kiosk
platforms
32.1.6 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
32.1.7 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
32.1.8 selectedIndex
Indicates the currently selected image in the ImageGallery. The index is with respect to the order in which
data is set with data property. Programmatically setting the selectedIndex will not make any visible
differences in the row, however it will bring the row at the index into the view able area on the screen. Setting it
to null/nil clears the selection state.
Note: If data contains the sections then the selectedIndex indicates the selected row index within the
section.
Syntax
JavaScript: selectedIndex
Lua: selectedindex
Type
JavaScript: Number
Lua: Number
Read / Write
Note: On Windows Phone (Mango) platform, you cannot write data to this property.
JavaScript Example
//getSelectedIndex
alert("Selected Index : "+imgGallery.selectedIndex);
No
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10
32.1.9 selectedItem
Returns the selected data object (input array) corresponding to the selected image of the ImageGallery. If no
image is selected, null/nil is returned.
Syntax
JavaScript: selectedItem
Lua: selecteditem
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//getSelectedItem
alert("selected Item : "+imgGallery.selectedItem);
No
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10
32.1.10 skin
Specifies the look and feel of the ImageGallery when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic) and BlackBerry 10
32.1.11 spaceBetweenImages
Syntax
JavaScript: spaceBetweenImages
Lua: spacebetweenimages
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic), BlackBerry 10, and Windows Mango
platforms.
l containerWeight
l imageScaleMode
l margin
l marginInPixel
l referenceHeight
l referenceWidth
32.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
32.2.2 imageScaleMode
A value of the this property specifies how the rendered image's width and height are identified if those of the
source image varies from the Image widget itself. Image Widget represents the underlying native widget
which renders (and applies alignment to) the Source Image.
Default: IMAGE_SCALE_MODE_MAINTAIN_ASPECT_RATIO
The image aspect ratio is the width (x) of the image compared to its height (y). A square image has a ratio of
1:1, but a non-square (rectangular) image does not have the same height and width. It is commonly expressed
as two numbers separated by a colon, as in 16:9.
Before rendering the Image first the width and height of the Image widget is calculated. The width and height
are driven by the container weight that has been specified or referenceWidth and referenceHeight whichever
are applicable. Now the Source Image is scaled or cropped as per the ImageScale modes set in the property.
Note: For dynamic images (loaded from a remote server), specifying a referenceWidth / referenceHeight
avoids unnecessary screen re-layouts.
l If the source image size is less than the ImageWidget size then source image is rendered as is.
The ImageWidget is aligned as per the widget alignment rules.
l If the source image is size is greater than the ImageWidget size then the source image is
resized to the ImageWidget dimensions while maintaining the aspect ratio.
l Height is derived from reference height specified, if reference height is specified. If not
the actual Image height is taken.
l IMAGE_SCALE_MODE_CROP: This scale mode preserves the original size of the Source Image. In
case,
l If the source image size is less than the ImageWidget size then source image is rendered as is.
l If the source image is size is greater than the ImageWidget size then the source image is
cropped or clipped to fit the ImageWidget.
Note: referenceWidth and referenceHeight are not mandatory for this scalemode. This mode is not
supported on Mobile Web and SPA. they will render the sourceImage as its actual size.
l If the source image size is less than the ImageWidget size then source image is stretched to
the ImageWidget dimensions (height and width).
l If the source image is size is greater than the ImageWidget size then the source image is
squeezed to fill the ImageWidget dimensions (height and width).
Note: referenceWidth and referenceHeight are mandatory for this scalemode. Not specifying the
referenceWidth / referenceHeight will lead to undefined behaviour.
Note: If the reference image is bigger than container weight, Mobile Web and SPA platforms may not be
able to adhere to the container weight but will spill over.
Syntax
JavaScript: imageScaleMode
Lua: imagescalemode
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
32.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
32.2.4 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
32.2.5 referenceHeight
It is the reference image height in pixels. The source image height is resized to fill the widget dimensions. The
image aspect ratio is not preserved. The referenceHeight is respected only when the imageScaleMode
property is set to IMAGE_SCALE_MODE_FIT_TO_DIMENSIONS. The pixels are device independent
pixels specified against 163 dpi.
For example, HzImage widget dimensions are 200 x 100 (height and width respectively ) and your image is
300 x 200 px, then you have to specify referenceHeight as 200 and referenceWidth as 100. The image is
resized to fit in the widget by reducing the height and width.
Syntax
JavaScript: referenceHeight
Lua: referenceheight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
32.2.6 referenceWidth
It is the reference image width in pixels. The source image width is resized to fill the widget dimensions. The
image aspect ratio is not preserved. The referenceWidth is respected only when the imageScaleMode
property is set to IMAGE_SCALE_MODE_FIT_TO_DIMENSIONS. The pixels are device independent
pixels specified against 163 dpi.
For example, HzImage widget dimensions are 200 x 100 (height and width respectively ) and your image is
300 x 200 px, then you have to specify referenceHeight as 200 and referenceWidth as 100. The image is
resized to fit in the widget by reducing the height and width.
Syntax
JavaScript: referenceWidth
Lua: referencewidth
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l hoverSkin
l itemsPerRow
l navigationBarPosition
l noofRowsPerPage
l viewType
l viewConfig
32.3.1 hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the widget.
Syntax
JavaScript: hoverSkin
Lua: hoverskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Availability on platforms
32.3.2 itemsPerRow
Syntax
JavaScript: itemsPerRow
Lua: itemsperrow
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
This property is available only on Server side Mobile Web (advanced) platform.
32.3.3 navigationBarPosition
Specifies the position of the navigation bar for the ImageGallery. The pageview indicator either appears on the
top or bottom of the ImageGallery.
Syntax
JavaScript: navigationBarPosition
Lua: navigationbarposition
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
This property is available only on Server side Mobile Web (advanced) platform.
32.3.4 noofRowsPerPage
Syntax
JavaScript: noofRowsPerPage
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
32.3.5 viewType
Specifies the appearance of the Image Gallery as Default view or Page view.
Default: IMAGE_GALLERY_VIEW_TYPE_DEFAULT
Syntax
JavaScript: viewType
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Availability on platforms
32.3.6 viewConfig
Specifies the view configuration parameters when the viewType is set as IMAGE_GALLERY_VIEW_TYPE_
PAGEVIEW for Desktop Web platform.
Type
JavaScript: JSObject
Read / Write
JavaScript Example
Yes
Availability on platforms
l onSelection
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
32.4.1 onSelection
An event callback that is invoked by the platform when an Image is selected in ImageGallery.
Signature
JavaScript: onSelection
Lua: onselection
Read / Write
JavaScript Example
Yes
Platform Availability
32.4.2 preOnclickJS
This event allows the developer to execute custom javascript function when the ImageGallery is invoked.
This is applicable only for Mobile Web channel. The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
32.4.3 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the
ImageGallery is invoked. This is applicable only for Mobile Web channel.The function must exist in a
javascript file under project>module>js folder.
Type
String
Read / Write
JavaScript Example
Yes
Platform Availability
l addAll
l addDataAt
l removeAll
l removeAt
l setData
l setDataAt
32.5.1 addAll
This method allows you to add new images to the ImageGallery. The new images are appended to the existing
images. If the ImageGallery has no images, the new images are placed in the ImageGallery.
Signature
JavaScript: addAll(array_of_data)
Note: There is no need for the second parameter (image_url_property) as this API assumes
the same image_url_property i.e set while setting the data using the setData. setData is a
must to be called before calling any of the add, addAt Apis.
JavaScript: addAll(array_of_data,image_url_property)
Input Parameters
Return Values
None
JavaScript Example
//Adding new new images to the Image Gallery by addAll method,We can use e
xternal URL images or the images inside resources folder
imgGallery.addAll(
[{ imageurl: "http://chromeactions.com/i/3d-like-box.png"
},
{ imageurl: "http://www.unlockiphoneinstantly.com/wp-con
tent/themes/unlockiphone/images/check-box.jpg" }],
"imageurl"
);
Exceptions
WidgetError
Platform Availability
32.5.2 addDataAt
Allows you to add/insert a new image at a given index. In case the index is not valid and not falling in range 0
<= index <= N, where N is the total number of records image is added at the end of the ImageGallery.
Signature
Input Parameters
Return Values
None
Platform Availability
32.5.3 removeAll
Signature
JavaScript: removeAll()
Lua: gallery.removeAll(widgetid)
Input Parameters
Return Values
None
JavaScript Example
Platform Availability
32.5.4 removeAt
Removes the image at the given index in the ImageGallery. In JavaScript, the Index is '0' based and in Lua, it
is '1' based.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
JavaScript: removeAt(index)
Input Parameters
Return Values
None
JavaScript Example
Platform Availability
32.5.5 setData
Allows you to set new images to the ImageGallery. The existing images will be replaced with the new images.
Signature
JavaScript: setData(array_of_data)
Note: There is no need for the second parameter (image_url_property) as this API assumes
the same image_url_property i.e set while setting the data using the setData. setData is a
must to be called before calling any of the add, addAt Apis.
Input Parameters
Return Values
None
JavaScript Example
//Replacing existing images with the new images by setData method,We can u
se external URL images or the images inside resources folder
imgGallery.setData([{ imageurl: "http://chromeactions.com/i/3d-like-box.pn
g" },
{ imageurl: "http://chromeactions.com/i/3d-like-
box.png1" },
{ imageurl: "http://www.unlockiphoneinstantly.com/wp-c
ontent/themes/unlockiphone/images/check-box.jpg" },
{ imageurl: "http://chromeactions.com/i/3d-like-box.pn
g1" },
{ imageurl: "image2.png"}],
"imageurl"
);
Platform Availability
32.5.6 setDataAt
Allows you to set a new image at a given index. The existing image at that index will be replaced with the new
image. In case the index is not valid and not falling in range 0 <= index <= N, where N is the total number of
records then the operation is ignored.
Signature
Input Parameters
Return Values
None
JavaScript Example
Platform Availability
l frameHeight
l height
l width
l showItemCount
32.6.1 frameHeight
Specifies the height of the ImageGallery in pixels. The height of the images in the ImageGallery will not
exceed the height specified in this property.
To change the default height, enter the desired height in this property.
Type
Number
Read / Write
No
Yes
Platform Availability
32.6.2 height
Note: If the height of the image exceeds the height of the ImageGallery, the image size is scaled to fit the
ImageGallery .
Type
Number
No
Yes
Platform Availability
32.6.3 width
Type
Number
No
Yes
Platform Availability
32.6.4 showItemCount
For example, {1,10,100} indicates that the current record start is 1, the set ends at 10, and that there are 100
records.
Default: true
Type
Boolean
Read / Write
Yes
Yes
Platform Availability
33. Map
A Map widget provides you the capability to display pre-defined locations (latitude and longitude) on an
onscreen map. Platforms like BlackBerry (above JDE 4.5), iPhone (above 3.0), and Android provide a native
map widget that can be displayed as part of the application.
On platforms where a native map widget is not available, the Kony Map widget integrates with Google Maps
and displays the static image with zoom and pan controls. You can customize the map view if you do not want
to use the default view.
Note: The platforms Mobile Web (basic), Mobile Web (BJS) and Non-Touch HTML devices supports only
static maps.
The Map widget renders a map using the mapping service provided by the platform. The following table shows
the list of platforms and the available mapping services:
The Map widget provides you with an option to set Basic Properties, Layout Properties, Platform Specific
Properties, Events, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
calloutTemplate containerHeight address
calloutWidth containerHeightReference mapHeight
defaultPinImage containerWeight mapSource
id margin mapWidth
info marginInPixel mode
isVisible navControlsImageConfig
locationData showCurrentLocation
mapKey showZoomControl
provider zoomlevel
screenLevelWidget
widgetDataMapForCallout
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
The appearance of the Map widget with a defined locationData on various platforms is as follows:
Platform Appearance
Android
BlackBerry
Platform Appearance
iPhone
Platform Appearance
1. Drag and drop the map widget onto a form (occupies the complete available width). Or, based on your
requirements, you can choose to resize a map widget in the horizontal direction by placing a Box on the
form and by dragging and dropping the map widget inside the Box and resizing accordingly.
2. On Android, BlackBerry, configure the mapKey for your application:
Note: You do not have to configure map keys for Windows and Mobile Web platforms.
Note: On Android and Mobile Web platforms you can choose to specify the address property instead
of the locationData property.
4. (Optional) Specify a defaultPinImage to indicate a location for all platforms or for specific platforms.
5. (Optional) Specify a zoomlevel (applicable on iPhone, Android, and BlackBerry).
6. (Optional) On Android and Mobile Web platforms, change the viewing mode as per your requirements.
7. (Optional) On Mobile Web platforms, change the mapSource , mapHeight and mapWidth.
8. (Optional) Define an onSelection event.
There are three ways to interact with a Map widget. They are as follows:
l Pan
l Zoom
l Location selection
Pan
It is the ability to move (left, right, up, or down) around a region on the map.
On iPhone, Android, and Windows platforms, you can swipe (left, right, up, or down) to move around a region
on the map.
On BlackBerry Touch and Non-touch devices, you can swipe (left, right, up, or down) and use the trackball (or
trackpad) respectively to move around a region on the map.
Zoom
It is the ability to magnify a region on the map to show additional details of that region. If you zoom-in, the
region is magnified and additional details are displayed. If you zoom out, the field of vision of the map is
increased.
On iPhone, Android, and Windows platforms, you can poke to zoom-in and pinch to zoom out.
On BlackBerry Touch and Non-touch devices, you can use the "+" and "-" search glass icons and "i" and "o"
keys respectively to zoom-in and zoom out of a region on the map.
The following image illustrates the BlackBerry "+" and "-" search glass icons:
Location Selection
You can get additional details of a location by clicking a plotted point on the map. If you click a plotted point, a
popup containing the name and description of the plotted point is displayed.
Note: You can specify the coordinates that must be plotted on the Map using the locationData property.
If you want additional information related to that location (for example, directions to that location), you can
click the popup and trigger an onSelection event.
Note: The onSelection event is triggered only if you click the location popup.
Important Considerations
Note: Preview of map widget is not supported on SPA and Desktop Web platforms.
On BlackBerry platform (Version 4.1 and above), you must ensure the following:
l There is no focusable widget above the Map widget. This is because, on non-touch devices, when the
map widget is in focus, you will not be able to move the focus away from the map (this is done to
ensure that the trackball movements will result in panning of the map).
l The Map widget should be the last widget on the form. You must ensure this for a good user
experience.
l To test the Map widget on any Blackberry emulator execute the following steps:
Note: : Make sure the BlackBerry simulator is not running before starting the MDS. Ignore Step 3 - if
you are not using proxy.
3. If you are using a proxy - add the following lines under [HTTP HANDLER] section:
application.handler.http.proxyEnabled=true
application.handler.http.proxyHost=proxy.server.com
application.handler.http.proxyPort=80
4. Find and replace the string localhost in the same file rimpublic.property with your system ip-
address [use ipconfig in your command prompt to find your system ip-address].
5. Save the file.
6. Start MDS.
4. Go to Mange Connections.
5. Uncheck Wi-Fi and switch it On back.
Android Limitations
In Android Platform, if Map widget V1 is not dragged into any of the forms built through IDE but only created
dynamically through hand code, you can follow any of the procedures mentioned below:
Procedure1:
1. From the Applications View, right-click on the project and select Properties.
2. Select Native App tab and select Android.
3. Under Manifest Properties, select Tags tab.
4. Add the below line of code in Child tag entries under <application> tag:.
<uses-library android:name="com.google.android.maps"></uses-library>
Procedure2: (works only with Kony Studio IDE plugin version IDE GA-V5.0.10 )
1. From the Applications View, right-click on the project and select Properties.
2. Under Application tab, add map key in Android map widget key textbox.
In Android Platform, if the developer wants to use Map widget V2, follow the below steps:
1. From the Applications View, right-click on the project and select Properties.
2. Select Native App tab and select Android.
3. Under Manifest Properties, select Tags tab.
4. Add the below line of code in Child tag entries under <application> tag:. If the developer provides
Google Map V2 key then Platform by default loads Google Map V2.
Click here to read more about Generating and Configuring Map API Keys.
Note: Google Map V2 does not work on emulator. On Android devices it works only with Android Version 2.2
and above. It requires OpenGL ES version 2 to load.
Note: On Android platform, Multiple Map Widgets in a single form is not supported for Google Map V1. It is
supported for Google Map V2.
Note: Clickable/Interactive widgets inside a Map callout template will become non-clickable when android
Map V2 version is used. This the limitation of native Android Map V2 callout. As callouts are displayed as
static image snapshot of callout template and only the entire callout is clickable. Map onSelection callback
is invoked when a callout is clicked.
BlackBerry 10 Limitations
1. From Kony Studio, you have to set the permission for access_location_service as true. To set
access_location_service, navigate to Application Properties > Native > BlackBerry10, select access_
location_services and click Add >.
2. Your device location service setting must be on. To set device location service in your device, navigate
to Device Settings > Location Services > turn on the location services.
3. Map is available for USA and Canada regions only. It will not work for Asia Pacific region.
4. Map works in BlackBerry 10 OS version 10.0.9.2709 and above.
5. If the network is slow then rendering of the map is not smooth. You may observe different fonts and
ODD UI.
6. For devices less than 10.1, developer specified or custom pin image is not displayed. Only BlackBerry
10 provided images can be displayed.
7. Rendering of Map may takes 2 to 3 minutes depending on your network. Sometimes it may take more
than 5 minutes also.
8. When a Map is loading we cannot display an alert messages.
9. Your application may crash when you perform any action while loading the Map.
10. Zoom level is decided by altitude. Hence user has to provide zoom level in terms of 1000. The default
zoomlevel is 10000.
11. Events associated with Map widget are not writable.
l calloutTemplate
l calloutWidth
l defaultPinImage
l id
l info
l isVisible
l locationData
l mapKey
l provider
l screenlevelwidget
l widgetDataMapForCallout
33.1.1 calloutTemplate
Accepts reference to a box widget which represents a UI template for a custom callout. The box template is
allowed to have only Label, Link, Richtext, Button and Image widgets.
Note: If template is not provided, it will fallback to the platform specific default callout for backward
compatibility. On iOS platform, onSelection event will not get fired for custom callout.
Syntax
JavaScript: calloutTemplate
Type
JavaScript: kony.ui.Box
Lua: UserData
Read / Write
Yes
Platform Availability
33.1.2 calloutWidth
Specifies the width of the callout on the map. It accepts a number between 1 to 100 in percentage relative to
the map widget width. For example, 100% value means, callout width should fill its map widget width. If the
value specified is less than 1 or more than 100, it should fallback to 80%.
Default: 80%
Syntax
JavaScript: calloutWidth
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
33.1.3 defaultPinImage
Note: For Static maps, the defaultPinImage is not supported in Server side Mobile Web platforms.
Note: On BlackBerry 10 platform, for better user experience the image must of the size 60x60 px.
Syntax
JavaScript: defaultPinImage
Lua: defaultpinimage
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
33.1.4 id
id is a unique identifier of Map consisting of alpha numeric characters. Every Map should have a unique id
within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
33.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
33.1.6 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
33.1.7 locationData
Note: The widget-data map for a template must be provided in the "widgetDataMapForCallout"
property. The sample format of the data is as follows: {dataId1:"", dataId2:"" dataId3:"",
template:boxRef2}
l color[String] [Optional]:Specifies the color for the popup. (Supported on Mobile Web and SPA)
l label [String] [Optional] : Specifies the text for the popup. (Supported on Mobile Web and SPA)
Syntax
JavaScript: locationData
Lua: locationdata
Type
JavaScript: Array. But on BlackBerry 10 platform, it is JSObject. The developer has to use jsonstringify
to access the value.
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
33.1.8 mapKey
The map key required to connect to the map provider service. Since we currently support only Google maps,
this property accepts google map key.
Note: There should be a separate map key needed for the android platform as per the android SDK map key
requirements, which is different from the map key requirements for static/dynamic JavaScript based google
map key.
Syntax
JavaScript: mapKey
Lua: mapkey
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
33.1.9 provider
Specifies the map data provider. For example, you can set the map provider as Google or Bing based on your
location and requirement.
Default: MAP_PROVIDER_GOOGLE
Syntax
JavaScript: provider
Lua: provider
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango) and BlackBerry 10 platforms
33.1.10 screenLevelWidget
Specifies whether the widget should occupy the whole container excluding space for headers and footers, if
any.
Default: true
If set to false, the map occupies the space as set in the IDE or layout properties.
If set to true, the map occupies the whole space on the container.
Syntax
JavaScript: screenLevelWidget
Lua: screenlevelwidget
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
33.1.11 widgetDataMapForCallout
Specifies the mapping between the widget identifiers and data identifiers. The map must contain all widget
data map referred across multiple templates, including the dynamic templates for each map location, if any. It
accepts the data as key-value pairs, where key is the widget identifier and value is the data identifier.
Note: On iOS platform, onSelection event will not get fired for custom callout.
Syntax
JavaScript: widgetDataMapForCallout
Lua: widgetdatamapforcallout
Type
JavaScript: JSObject
Lua: Table
Read / Write
Yes
Platform Availability
Available on all platforms except on Windows Tablet, BlackBerry 10, and Windows Kiosk platforms
l containerHeight
l containerHeightReference
l containerWeight
l margin
l marginInPixel
33.2.1 containerHeight
Specifies the available height of the container in terms of percentage. The percentage is with reference to the
value of containerHeightReference property.
Note: In Windows Phone platform, when screenLevelWidget property is set to false or true, the Map widget
occupies 500 px. But on Windows Tablet and Windows Kiosk platforms, when the value changed from
positive to negative value, there is no change and when changed from 0 to negative value, it takes default
height (500 px).
Default: If not configured, the value may vary depending on the platforms.
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform availability
Available on all platforms except on all Server side Mobile Web platforms.
33.2.2 containerHeightReference
This property is enabled when you set the containerHeight. The widget height percentage is calculated based
on the following options.
Default: CONTAINER_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web platforms.
33.2.3 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
No
Platform Availability
33.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
33.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
l address
l mapHeight
l mapSource
l mapWidth
l mode
l navControlsImageConfig
l showCurrentLocation
l showZoomControl
l zoomLevel
33.3.1 address
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: address
Lua: address
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//Defining the properties for Map with address:Kony Solutions, Inc., Tower
Lane, Foster City, CA, United States
var mapBasicConf = {id: "map1", provider:constants.MAP_PROVIDER_GOOGLE, ma
pKey:"0z5UtaSPUYj42f5qX0VAwmDGLX39Qxgbtcra0TA", defaultPinImage: "kmpin.pn
g", isVisible:true};
var mapLayoutConf={margin:[20,40,50,20], containerWeight:100};
var mapPSPConf={mapHeight:100};
No
Platform Availability
l Android/Android Tablet
l Server side Mobile Web (basic) - Location Pin marker is not supported.
l Server side Mobile Web (BJS) - Location Pin marker is not supported.
l Server side Mobile Web (advanced) - Address popup will not be displayed.
l SPA(iPhone/Android/BlackBerry/Windows NTH)
33.3.2 mapHeight
Specifies the Width of the map. Accepts the values based on 320 screen height.
Note: For the skin to be available in the list, you must add a skin for BlockedUI under Widget Skins.
Syntax
JavaScript: mapHeight
Lua: mapheight
Type
JavaScript: JSObject
Lua: UserData
Read / Write
No
JavaScript Example
"kmpin.png", isVisible:true};
var mapLayoutConf={margin:[20,40,50,20], containerWeight:100};
var mapPSPConf={mapHeight:100};
Yes
Platform Availability
33.3.3 mapSource
l MAP_SOURCE_NATIVE : If you select this option, the application uses the mapKey and provider
details to fetch the map.
The fetched map is interactive with an ability to zoom and pan.
Note: Polygon view on advanced Mobile Web platform is available only when the source is set to
non-native.
l MAP_SOURCE_NON_NATIVE : If you select this option, the application uses the map that is on the
device.
l MAP_SOURCE_STATIC : If you select this option, the application uses the mapKey and provider
properties to fetch the maps.
The fetched map is non-interactive. However, you can zoom and pan across the map.
Note: Mobile Web (basic), and Mobile Web (BJS) support only Google Static Maps as a source. Static
maps are directly requested from Google for a given latitude and longitude. Kony does not support any other
option because the size of the get request URL can be bigger than 256 characters leading to the request not
being served.
Syntax
JavaScript: mapSource
Lua: mapsource
Type
JavaScript: Number
Lua: Number
Read / Write
No
Yes
Platform Availability
33.3.4 mapWidth
Specifies the Width of the map. Accepts the values based on 320 screen width.
Syntax
JavaScript: mapWidth
Lua: mapwidth
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
33.3.5 mode
Default: MAP_VIEW_MODE_NORMAL
MAP_VIEW_MODE_TRAFFIC: Specifies the streets with different colors to indicate traffic information
on the map. The color green indicates low traffic, orange indicates medium traffic and red indicates heavy
traffic.
The following images illustrate the Normal Mode, Satellite Mode, and Street Mode.
The following images illustrate the Polygon Mode, Hybrid Modeand Traffic Mode.
Terrain Mode
The below table shows the list of map modes and their availability in respective platforms:
If you select the mode as polygon for Mobile Web, the location coordinates specified in the locationData
property are plotted as the vertices of a polygon and the area is shaded.
Syntax
JavaScript: mode
Lua: mode
Type
JavaScript: Number
Lua: Number
Read / Write
Yes - (Read and Write) (on Blackberry it is not accessible from code)
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android
l SPA(iPhone/Android/BlackBerry/Windows NTH)
l Server side MobileWeb (basic,BJS,Advanced)
l Windows Phone (Mango)
l Windows Kiosk
33.3.6 navControlsImageConfig
The images required to configure the zoom (in and out) and navigation ( left, right, top, and bottom) controls on
static map view.
l zoomIn
l zoomOut
l navLeft
l navRight
l navTop
l navBottom
Syntax
JavaScript: navControlsImageConfig
Lua: navcontrolsimageconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
No
JavaScript Example
//Defining the properties for Map with zoom and navigation control images.
The images should be in resources folder.
var mapBasicConf = {id: "map1", provider:constants.MAP_PROVIDER_GOOGLE, ma
pKey:"0z5UtaSPUYj42f5qX0VAwmDGLX39Qxgbtcra0TA", defaultPinImage: "kmpin.pn
g", isVisible:true};
var mapLayoutConf={margin:[20,40,50,20], containerWeight:100};
var mapPSPConf={navControlsImageConfig:{zoomIn:"a.png", zoomOut:"b.png", n
avLeft:"c.png", navRight:"d.png", navTop:"e.png", navBottom:"f.png" }};
Yes
Platform Availability
33.3.7 showCurrentLocation
Default: MAP_VIEW_SHOW_CURRENT_LOCATION_NONE
l MAP_VIEW_SHOW_CURRENT_LOCATION_NONE
l MAP_VIEW_SHOW_CURRENT_LOCATION_AS_PIN
l MAP_VIEW_SHOW_CURRENT_LOCATION_AS_CIRCLE
Syntax
JavaScript: showCurrentLocation
Lua: showcurrentlocation
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
//Defining the properties for Map to show the Current Location as pin.
var mapBasicConf = {id: "map1", provider:constants.MAP_PROVIDER_GOOGLE, ma
pKey:"0z5UtaSPUYj42f5qX0VAwmDGLX39Qxgbtcra0TA", defaultPinImage: "kmpin.pn
g", isVisible:true};
var mapLayoutConf={margin:[20,40,50,20], containerWeight:100};
var mapPSPConf={showCurrentLocation:constants.MAP_VIEW_SHOW_CURRENT_LOCATI
ON_AS_PIN};
Yes
Platform Availability
l iPhone
l iPad
33.3.8 showZoomControl
Default: true
Syntax
JavaScript: showZoomControl
Lua: showzoomcontrol
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
33.3.9 zoomLevel
Sets the zoom level for the current map view. The range varies from platform to platform.
Note: On BlackBerry 10 platform, zoomlevel is decided by altitude. Hence you have to provide zoom level in
terms of 1000.
Syntax
JavaScript: zoomLevel
Lua: zoomlevel
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l Android
l iPhone/iPad
l Windows Tablet
l Windows Kiosk
l BlackBerry 10
l onClick
l onPinClick
l onSelection
33.4.1 onClick
An event callback is invoked by the platform when the user performs a click action on the map and location
data with "latitude" and "longitude" are passed to the callback. This event is not raised if the user clicks on
map pin and callout.
Signature
Input Parameters
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web (basic), BlackBerry, BlackBerry 10, and on all
Windows platforms
33.4.2 onPinClick
An event callback that is invoked by the platform when a map pin is clicked, passing the selected locationdata
to the callback.
Note: On SPA (Windows Phone) platform, a pop-over already appears when you click the pin. Hence alerts
should not be used for onPinClick event.
Signature
Input Parameters
Read / Write
JavaScript Example
Yes
Platform Availability
33.4.3 onSelection
An event callback that is invoked by the platform when the user clicks on a callout of the Map.
Signature
Input Parameters
mapwidgetid[widgetref] - Mandatory
Handle to the widget instance.
Read / Write
JavaScript Example
Yes
Platform Availability
l addPolyline
l clear
l dismissCallout
l getBounds
l navigateTo
l navigateToLocation
l removePolyline
33.5.1 addPolyline
This method is used to add a polyline to the map widget with the given location data. You can add multiple
polylines to the map widget using this method.
Signature
JavaScript: addPolyline(locationData)
Input Parameters
l startLocation [String] [Optional] : Specifies the location data for the start point of the
polyline. The values should be provided as specified in locationData property. The start
point of the polyline is represented with a map pin.
l endLocation [String] [Optional] : Specifies the location data for the end point of the
polyline. The values should be provided as specified in locationData property. The start
point of the polyline is represented with a map pin.
l locations [JSObject] [Optional] : Specifies the list of all the locations as an array
including start and end points. Each location object accepts "lat" and "lon" keys and
other keys are ignored.
o lineColor [String] : Specifies the color of the polyline in #RBGA hex format.
Return Values
None
Exceptions
WidgetError, Error
JavaScript Examples
mapref.addPolyline (
{
id: "polyid1",
startLocation:{lat:"43.47591",lon:"80.53964",name:"Campus
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
33.5.2 clear
This method is used to clear all the data associated with map widget which including locationData and
polylines.
Signature
JavaScript: clear()
Input Parameters
None
Return Values
None
Exceptions
None
JavaScript Examples
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
33.5.3 dismissCallout
This method is used to dismiss the custom callout for a given location. This method is ignored if the callout is
already is in dismissed state, or location argument is invalid or non-existing.
Signature
JavaScript: dismissCallout(location)
Input Parameters
Return Values
None
Exceptions
WidgetError
Platform Availability
33.5.4 getBounds
This method returns the currently visible map boundaries as an object. The predefined keys for the object are
as follows:
l center[JSObject] : Specifies the latitude and longitude keys and associated values.
l northeast [JSObject] : Specifies the latitude and longitude keys and associated values.
l southwest [JSObject] : Specifies the latitude and longitude keys and associated values.
l latspan [number] : Specifies the spanning latitudes in degrees.
l lonspan [number] : Specifies the spanning longitude in degrees.
Signature
JavaScript: getBounds()
Input Parameters
None
Return Values
None
Exceptions
WidgetError, Error
JavaScript Examples
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
33.5.5 navigateTo
This helps to navigate programmatically from one index to other index in the given list of locations shown on
the map view.
Signature
Input Parameters
Return Values
None
Exceptions
WidgetError
JavaScript Examples
Platform Availability
33.5.6 navigateToLocation
This method allows you to navigate programmatically to the specified location. Based on the parameters
passed it also displays the dropPin and callout.
Note: All the values specified in this method invocation are respected only for the invocation and does not
change the original state of the map, I.e locationData that is set at the map widget level.When this method is
called in sequence, the map is navigated to the latest location and there wont be trace of the old locations
which were navigated earlier through this method on the map..
Signature
Input Parameters
2. showcallout defined as a part of the locationData that is set at the map widget level
for a matching location.
Note: If navigated to same location again and again by toggling dropPin property, pin is
toggled.
Return Values
None
Exceptions
WidgetError
JavaScript Examples
Platform Availability
33.5.7 removePolyline
Signature
JavaScript: removePolyline(polylineID)
Input Parameters
polylineID[String] - Mandatory
Specifies the id of the polyline what is used while adding a polyline. This method is ignored if the
given id is incorrect or not found.
Return Values
None
Exceptions
WidgetError, Error
JavaScript Examples
mapref.removePolyline("polyid1")
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
Map template enables you to define a template for callout with specified widgets. You can use the template on
multiple maps and in multiple forms. This is primarily useful for developers to achieve common look and feel of
the callout in the map widget and the changes made to template reflect across the maps.
l To have uniform look and feel of the callout with the specified widgets.
l To display different callouts for different maps.
l To perform an action on a callout.
When you want information to be displayed across all the Maps in the application, you have a provision to add
a Map Template using Kony Studio. For more information about Map Templates refer Kony Studio User
Guide.
1. Go to Applications View.
2. Expand the application for which you want to create the MapTemplate.
3. Navigate to templates > maps, right-click mobile/desktop/tablet and select New Map Template.
The Create a New Template window appears.
Note: Only HBox and VBox are supported on the form. You can put other
widgets within these widgets.
i. Drag and drop the required widgets onto the HBox/VBox. Set the properties of these
widgets. For more information, see Kony Widget User Guide.
ii. A map template is created.
You can define only one template for each map using the above process.
1. Go to Applications view.
2. Expand the application for which you want to use section template.
3. Navigate to forms > mobile/tablet/desktop , right-click and select New Form. The Create a New
Form window appears.
4. Enter a name for the Form and click Finish. A new Form is created.
5. If you are building for desktop, select the Form in desktop and right-click on the Form. Select Fork. The
Platform Selection window appears.
6. Select Desktop_web and click OK. The form is now forked for Desktop_web and new window
appears as web_<formname>.
Note: The development activities for desktop web should happen in web_<formname> only. Although the
newly created form, remains accessible in the desktop forms.
7. Drag-drop a Map on the Form and other widgets as required. Click Save.
8. To set the template to a map, select the map and go to Properties window.
9. Select calloutTemplate and Select/Search map Template window opens. Select the template,
which you want to set to the segment.
10. Click OK.
34. ObjectSelector3D
The ObjectSelector3D widget can be used for allowing the user to select homogeneous objects arranged on a
two-dimensional grid. It provides the user with a three-dimensional graphical view of the objects which makes
it more attractive than regular two-dimensional images. It has two modes, a selection mode and a walk-
through mode.
The selection mode provides you with a top view of the grid of 3D objects and allows the user to tap on objects
to select/unselect them. At any time, the user can hold down on a selected object and the widget will go into
walk-through mode.
In walk-through mode, the user is shown a simulation of how it would appear if the user were to start from a
starting point and walk (on foot) up to the selected object.
Note: To use the ObjectSelector3D widget, you must load the 3D models. For more information about
loading the models, see Kony Studio User Guide.
The ObjectSelector3D widget provides you with an option to set Basic Properties, Layout Properties, an
Event, and Methods.
Event
onSelectionDone
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
l To display identical elements where the user wants to make the selection of his choice (for example, in
a Travel Application, you can provide all the seats indicating reserved and unreserved tickets of a
flight, train or bus. While booking the seats, let the user select his preference.
l You can also use this widget in applications to book a seat in a stadium or a cinema hall leaving the
selection of seats to the customer.
Selection modes in different modes:
The appearance of the widget using a cube model on Windows Phone (Mango) platform is as follows:
1. Drag and drop the ObjectSelector3D widget onto a form (occupies the complete available width). Or,
based on your requirements, you can choose to resize a ObjectSelector3D widget in the horizontal
direction by placing an HBox on the form and by dragging and dropping the ObjectSelector3D widget
inside the HBox and resizing accordingly.
2. It is applicable only on Windows Phone (Mango) platform.
3. It uses the models added in the IDE through the project properties. If the models are not loaded you
won't be able to use this widget.
4. Use the text property and specify the text to be displayed on the ObjectSelector3D.
5. Define an onSelectionDone event.
Customizing Appearance
You can customize the appearance of the ObjectSelector3D by using the following properties:
Important Considerations
l This widget cannot be used without the models being loaded in the project.
l For performance reasons, the models being used must be specifically designed for real-time rendering.
l This widget is only useful where objects must be selected out of a homogeneous set (i.e., all the
objects must be the same kind. For example, seats in a bus.)
l focusSkin
l id
l info
l isVisible
l skin
l text
34.1.1 focusSkin
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
34.1.2 id
Syntax
JavaScript: id
Lua: id
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
34.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
34.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
34.1.5 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
34.1.6 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
34.2.1 containerWeight
Specifies the percentage of width that should allocated by its parent widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
weight except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
JavaScript Example
Yes
Platform Availability
34.2.2 contentAlignment
Specifies the alignment of the text on the ObjectSelector3D with respect to its boundaries. A default value
CONTENT_ALIGN_MIDDLE_LEFT is assigned for all platforms. To choose another alignment, click the
drop-down arrow and select the desired alignment. However, to change the default value on a particular
platform, select the button next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_MIDDLE_LEFT
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the widget.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the widget.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the widget.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the widget.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the widget.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the widget.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the widget.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
widget.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the widget.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
34.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
34.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
34.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
34.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
34.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Mobile 7. On
other platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Mobile 7 and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
34.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
34.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_TOP_LEFT
l WIDGET_ALIGN_TOP_CENTER
l WIDGET_ALIGN_TOP_RIGHT
l WIDGET_ALIGN_MIDDLE_LEFT
l WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l onSelectionDone
34.3.1 onSelectionDone
An event callback that is invoked by the platform when an Image is selected in ObjectSelector3D .
Signature
JavaScript: onSelectionDone
Lua: onselectiondone
Read / Write
JavaScript Example
Yes
Platform Availability
l addModel
l clearAllData
l defineSpecialModels
l getSelectedCells
l setCameraProperties
l setMapData
l setRequiredSelectionsCount
l setSelectedCells
34.4.1 addModel
This method allows you to add a new model to the widget's working set of models.
Signature
Input Parameters
Note: The resourceName is the original file name of the model without any file extension to it.
For example, if the original model file name is Box_Normal.fbx, the corresponding
resourceName would be Box_Normal. For more information on how to add models to the
application, refer to the section Adding Models to the Application from IDE in Kony Studio
User Guide.
For example, a scale of 1.0 will not cause any change to the model's size. A scale of 0.5 will cause
the model to be scaled to half of its original size and a scale of 2.0 will cause the model to be scaled
to double its original size.
Return Values
None
Exceptions
None
JavaScript Examples
Platform Availability
34.4.2 clearAllData
This method allows you to clear all the data set on the widget.
Signature
JavaScript: clearAllData()
Lua: OS3D.clearalldata(os3did)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Examples
Platform Availability
34.4.3 defineSpecialModels
This method allows you to define the models to the widget. The widget needs to know the models that
represent selected/unselected items.
Signature
Input Parameters
Return Values
None
Exceptions
None
JavaScript Examples
Platform Availability
34.4.4 getSelectedCells
This method allows you to retrieve the cells that are currently selected in the widget.
Signature
JavaScript: getSelectedCells()
Lua: OS3D.getselectedcells(os3did)
Input Parameters
Return Values
Exceptions
None
JavaScript Examples
Platform Availability
34.4.5 setCameraProperties
This method allows you to set the properties of the camera while in walk-through mode.
Signature
Input Parameters
Return Values
Exceptions
None
JavaScript Examples
Platform Availability
34.4.6 setMapData
This method allows you to define the map of objects which will be presented to the user for selecting the
items.
Signature
Input Parameters
Return Values
None
Exceptions
None
JavaScript Examples
Note: Selected models cannot be specified in the data, use the setselectedcells method to specify the data.
Platform Availability
34.4.7 setRequiredSelectionsCount
This method allows you to define the number of objects the user must select for the selection process to be
considered complete.
Signature
JavaScript: setRequiredSelectionsCount(count)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Examples
Platform Availability
34.4.8 setSelectedCells
This method allows you to identify the cells that are initially selected in the map.
Signature
JavaScript: setSelectedCells(array)
Input Parameters
Return Values
None
Exceptions
None
JavaScript Examples
Platform Availability
35. Phone
A Phone widget, when placed in an application, allows you to launch the native phone dialer and initiate a
phone call to the number that is displayed on it. It appears as a button on the Form and the phone number is
displayed on it either in the number format or the phone spell text. When the user selects the phone widget,
the native dialer is launched to make a phone call.
Note: Phone widget is not applicable for Server side Mobile Web, Desktop Web, Windows 8 Tablet, and
Windows 7 Kiosk platforms.
l To build applications for both Native and Mobile Web (SPA), you can use phone.dial API in your
application to initiate a call. But, the Server side Mobile Web platforms do not support this API. To
overcome this you must use the Phone widget to be able to initiate a call from both Native and Mobile
Web platforms.
l The convenience of providing a call initiation feature. Which otherwise, for the call initiation feature you
must use a button and define an onclick event or use a RichText widget.
Phone widget provides you with an option to set Basic Properties and Layout Properties.
The appearance of the Phone widget with a phone number on various platforms is as follows:
Platform Appearance
Android
Platform Appearance
BlackBerry
iPhone
Windows
1. From the IDE, drag and drop the Phone widget onto a form (occupies the complete available width). Or,
based on your requirements, you can choose to perform any of the following options:
a. If you want to resize a Phone widget in the horizontal direction, place an HBox on the form and
drag and drop the Phone widget inside the HBox and resize accordingly.
b. If you want to resize a Phone widget in the vertical direction, place an HBox on the form and
place a VBox inside the HBox; and drag and drop the Phone widget inside the VBox and resize
accordingly.
2. Use the text property to enter the phone number or phone spell text to which the call must be initiated.
Customizing Appearance
You can customize the appearance of the Phone by using the following properties:
Important Considerations
J2ME: Unlike other platforms (for example Android, BlackBerry etc.) you will not be able to simulate a Phone
widget behavior on an emulator.
l focusSkin
l id
l isVisible
l skin
l text
35.1.1 focusSkin
Type
String
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, BlackBerry 10, Windows Tablet, and Windows Kiosk
platforms.
35.1.2 id
id is a unique identifier of Phone consisting of alpha numeric characters. Every Phone should have a unique id
within an Form.
Type
String - [Mandatory]
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.1.3 isVisible
Default: true
Note: This property is not applicable if the widget is placed in a Segment. When the widget is placed in a
Segment, the Visibility of the widget is controlled by the data property of the segment.
Type
Boolean
Read / Write
Note: In addition, the visibility of the widget can be controlled by using the setVisibility method.
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.1.4 skin
Specifies the look and feel of the Phone when not in focus.
Type
String
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.1.5 text
Type
String
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
l containerWeight
l contentAlignment
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
35.2.1 containerWeight
Specifies the percentage of the parent width that should allocated to the widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
width except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
Read / Write
No
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.2.2 contentAlignment
Specifies the alignment of the text on the Phone with respect to its boundaries. A default value CONTENT_
ALIGN_CENTER is assigned for all platforms. To choose another alignment, click the drop-down arrow and
select the desired alignment. However, to change the default value on a particular platform, select the button
next to the drop-down and select respective platform and choose the value.
Default: CONTENT_ALIGN_CENTER (the default value for all platforms is center; content is aligned at the
center of the widget)
l CONTENT_ALIGN_TOP_LEFT - Specifies the text should align at top left corner of the widget.
l CONTENT_ALIGN_TOP_CENTER - Specifies the text should align at top center of the widget.
l CONTENT_ALIGN_TOP_RIGHT- Specifies the text should align at top right of the widget.
l CONTENT_ALIGN_MIDDLE_LEFT- Specifies the text should align at middle left of the widget.
l CONTENT_ALIGN_CENTER- Specifies the text should align at center of the widget.
l CONTENT_ALIGN_MIDDLE_RIGHT- Specifies the text should align at middle right of the widget.
l CONTENT_ALIGN_BOTTOM_LEFT- Specifies the text should align at bottom left of the widget.
l CONTENT_ALIGN_BOTTOM_CENTER- Specifies the text should align at bottom center of the
widget.
l CONTENT_ALIGN_BOTTOM_RIGHT - Specifies the text should align at bottom right of the widget.
Syntax
JavaScript: contentAlignment
Lua: contentalignment
Type
JavaScript: Number
Lua: Number
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.2.3 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
Yes
Platform Availability
Available on all platforms except on Desktop Web, SPA, Windows Tablet, and Windows Kiosk
platforms.
35.2.4 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next widget.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.2.5 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
Yes
Platform Availability
35.2.6 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Call, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the widget and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, BlackBerry 10, and Windows Kiosk
platforms.
35.2.7 paddingInPixel
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.2.8 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
35.2.9 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
Yes
Platform Availability
Available on all platforms except on Desktop Web, Windows Tablet, and Windows Kiosk platforms.
36. PickerView
A PickerView widget uses a spinning wheel metaphor to display multiple sets of values and allows you to
select a single combination of values. You can select a single combination of values by rotating the wheels
and aligning the desired row of values with the selection indicator.
PickerView can have multiple components and each component comprises of keys. Users can choose the
keys from different components and make the choices .. useful in grouping the multiple choices that user can
make in different categories related to concept. For example: color, model, year of manufacturing all these
three can be modeled as components with different possible values so that user can make his choice using
this single widget.
Note: PickerView widget is not supported in Windows 7 Kiosk, Desktop Web, SPA, BlackBerry 10, and on
all Server side Mobile Web platforms. To implement PickerView in Desktop Web platform, the developer is
expected to make use of multiple list boxes to achieve similar functionality.
Events Methods
onSelection setComponentData
setSelectedKeyInComponent
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
Platform Appearance
Android
Platform Appearance
iPhone
On Windows Phone, the PickerView widget appears as a button and displays the selected combination of
values. If you touch the button, the PickerView window opens and you can select the desired values.
The following image illustrates the appearance of the widget when rendered:
l When you want a user to make multiple selections and arrive at a combination of the selected values.
For example, for Flight Bookings, if you want the user to select one of the available dates, time, and
flight number; you can create lists for date, time, and flight numbers and display them in a PickerView
widget.
1. From the IDE, drag and drop the PickerView onto a form (occupies the complete available width). Or, based
on your requirements, you can choose to perform any of the following options:
a. If you want to resize the PickerView widget in the horizontal direction, place an HBox on the
form and drag and drop the PickerView widget inside the HBox and resize accordingly.
b. If you want to align multiple PickerView widgets in the horizontal direction, place an HBox on
the form and drag and drop the PickerView widgets inside the HBox.
c. If you want to align multiple PickerView widgets in the vertical direction, place an HBox on
the form and place a VBox inside the HBox; and drag and drop the PickerView widgets inside
the VBox.
2. Define the Master Data from the IDE (masterData) or through code (masterDataMap) for the PickerView
widget.
3. For programming purposes, if you want to set some values as pre-selected values or find the values
selected by the user, use the selectedKeys and the selectedKeyValues respectively.
5. (Optional) If you want to change the data in one of the components of the PickerView widget from the code
after you have set the masterData, you can use the setComponentData method.
6. (Optional) If you want to set a value as the selected value in one of the components of the PickerView
widget, you can use the setSelectedKeyInComponent method.
Pitfalls
l You must avoid resizing a PickerView widget or placing multiple PickerView widgets side- by- side in
the horizontal direction.
You must avoid doing so because, by resizing or placing multiple PickerView widgets side- by- side in
the horizontal direction, when the PickerView widget is rendered, the PickerView widget alignment
might not be confined to the screen width and results in a bad user experience.
Limitations
PickerView widget is not supported in Windows Phone, Windows 7 Kiosk, Desktop Web, SPA, and on all
Server side Mobile Web platforms
l focusSkin
l id
l info
l isVisible
l masterData
l masterDataMap
l selectedKeys
l selectedKeyValues
l skin
36.1.1 focusSkin
Specifies the look and feel of the PickerView widget when it is in focus.
Note: Not applicable for iPhone / iPad currently. Even if configured will be ignored in case of iPhone and
iPad.
Syntax
JavaScript: focusSkin
Lua: focusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except iOS, Desktop Web, Windows Kiosk, SPA, BlackBerry 10, and on all
Server side Mobile Web platforms.
36.1.2 id
id is a unique identifier of PickerView consisting of alpha numeric characters. Every PickerView should have a
unique id within an Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.3 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can always read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.4 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.5 masterData
Specifies the set of values that must be displayed for the user to make a selection from the available choices.
Default: User Defined (You must specify the key and the display value)
To specify the set of values, click the Ellipsis ( ) button against the property to open the MasterData for
PickerView window.
In the Master Data window, you can specify the Key, Display Value, i18n Key, and the Accessibility Config.
You can add the components by clicking the "+" button.
The following screen shot illustrates the MasterData for pickerview window:
Note: Select the Use as test data in preview mode option if you want to see the data you enter in the Master
Data when you use the quick preview feature of the IDE. (For more information on Quick Preview, see the
Kony Studio User Guide.
Note: If the key or the display value is null/nil, the value will not be listed as one of the available choices.
The key and value should be of string data type
Note: The accessibilityConfigObject is optional and the object should contain the keys as defined in the
accessibilityConfig property.
[
//0th component
[
["key1","value1", accessibilityConfigObject],
["key2","value2", accessibilityConfigObject],....,
["keyn", "valuen", accessibilityConfigObject], componentWidth
],
//1st component
[
["key1","value1", accessibilityConfigObject],
["key2","value2", accessibilityConfigObject],....,
["keyn", "valuen", accessibilityConfigObject], componentWidth
],
]
Syntax
JavaScript: masterData
Lua: masterdata
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.6 masterDataMap
Specifies the set of values from which you can make one or more selections. You must set the values from
the code.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can always read and write data to it.
It is array of arrays. masterdatamap format: leaf level with four elements represents the component data,
[0] is the array of JS objects with hashes. Component with the keys and values
For example: data for PickerView with 2 components with width set as 30 and 70.
[
//0th component
[
[
{key1="datakey1", value1="dataValue1", "accessibilityconfig":acObje
ct},
{key1="datakey2", value1="dataValue2",
"accessibilityconfig":acObject},
{key1="datakey3", value1="dataValue3", "accessibilityconfig":acObje
ct},
key1,value1,30
]
]
//1st component
[
[
{key1="datakey1", value1="dataValue1", "accessibilityconfig":acObje
ct},
{key1="datakey2", value1="dataValue2", "accessibilityconfig":acObje
ct},
{key1="datakey3", value1="dataValue3", "accessibilityconfig":acObje
ct},
key1,value1,30
]
]
Note: The accessibilityConfig is the standard key expected in each items data array. It is optional and the
object should contain the keys as defined in the accessibilityConfig property.
This property is applicable only if the masterData is not set. You must use either the masterData or the
masterDataMap to set data for the PickerView.
Note: If the key or the value is null/nil, the value will not be listed as one of the available choices.
Syntax
JavaScript: masterDataMap
Lua: masterdatamap
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.7 selectedKeys
If you create a PickerView with multiple values, you can choose to show specific values as selected when the
PickerView is rendered. Returns the array of selected keys from the masterdata representing the selected
key. If you set the selectedkeys to null/nil, the selection is cleared.
Syntax
JavaScript: selectedKeys
Lua: selectedkeys
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.8 selectedKeyValues
Returns the array of selected key-value pairs selected from the masterdata representing the selected key
value.
Syntax
JavaScript: selectedKeyValues
Lua: selectedkeyvalues
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.1.9 skin
Specifies the look and feel of the button when not in focus. It is the skin which is applied at the widget level.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
focusSkin:"pickerFSkin", masterData:[[["y1","2009"],["y2","2010"],["y3","2
011"], 40],[["m1","Jan"],["m2", "Feb"],["m3","Mar"], ["m4","Apr"],["m5","M
ay"],["m6","Jun"], ["m7","Jul"], 60]], isVisible:true, selectedKeys:["y2",
"m1"] };
var pickerLayout = {margin:[5,5,5,5], marginInPixel:true, widgetAlignment:
constants.WIDGET_ALIGN_CENTER, hExpand:true, containerWeight:99};
Yes
Platform Availability
Available on all platforms except iOS, on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry
10, and Desktop Web platforms
l containerWeight
l hExpand
l margin
l marginInPixel
l widgetAlignment
36.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.2.2 hExpand
Specifies if the widget should occupy all the width available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the PickerView against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.2.4 marginInPixel
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
36.2.5 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
l onSelection
36.3.1 onSelection
An event callback that is invoked by the platform when the component selection changes.
Signature
Input Parameters
Return Values
None
Syntax
JavaScript: onSelect
Lua: onselect
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except BlackBerry, Desktop Web, Windows Kiosk, SPA, BlackBerry 10, and
on all Server side Mobile Web platforms.
l setComponentData
l setSelectedKeyInComponent
36.4.1 setComponentData
Provides the ability to set the data for a given component with in the pickerview. To use this method, you must
first have set data using the masterData property. This method allows you to set component data to the
PickerView widget. The data you specify in this method overrides the existing data.
Note: The width is considered to be the same as the width which was originally specified in the masterData.
To change the width, you must use the masterData.
Signature
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
36.4.2 setSelectedKeyInComponent
This method allows you to set a particular value in the component data of a PickerView widget as selected.
Signature
Input Parameters
Note: The component index starts from 0 to n (n is the number of defined components).
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
Available on all platforms except on all Server side Mobile Web, Windows Kiosk, SPA, BlackBerry 10,
and Desktop Web platforms
37. SegmentedUI
A SegmentedUI consists of multiple segments (rows or records) and each segment (row or record) can have
multiple child widgets.
l Box
l Button
l Image
l Label
l Line
l Link
l RichText
l Phone
l Switch
Apart from the above mentioned widgets, Desktop Web platform allows you to add some more widgets. The
below table shows the additional widgets and the properties accessible from code applicable to Desktop Web
platform:
Note: For ComboBox, RadioButton,and CheckBox widgets masterData should be provided only if the
masterDataMap set to the widget initially is different for a particular row.
The data returned when selectedItem is called on the SegmentedUI widget when the row has the following
widgets:
Each of the above widgets is allowed to have its own skin and control. This gives the flexibility to design a
segment with separate interconnected widgets and expose their properties for mapping.
When a SegmentedUI template is created based on the input data, the segment is repeated in the Segmented
UI.
The SegmentedUI widget provides you with an option to set Basic Properties, Layout Properties, Platform
Specific Properties, Events, and Methods.
Deprecated properties are provided with their alternative properties in the Deprecated section.
Events Methods
onDidFinishDataLoading addAll
onEditing addDataAt
onRowClick addSectionsAt
Events Methods
onSwipe removeAll
scrollingEvents removeAt
preOnclickJS removeSectionsAt
postOnclickJS setData
setDataAt
setSectionAt
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored
JavaScript Example
For backward compatibility with support for all deprecated properties and behaviors, use the constructor
kony.ui.SegmentedUI.
l To provide a list of records or rows from which a user can make a single or multiple selections.
l To display a hierarchy of information. Each row item can lead to different subset of information
displayed in a new list.
l To display conceptually grouped information.
Widget Appearance on Platforms
The following is the appearance of the Segment on various platforms with a specified Master Data:
Platform Appearance
Android
Platform Appearance
BlackBerry
iPhone
Windows Phone
Platform Appearance
1. From the IDE, drag and drop the segment widget onto a form (occupies the complete available width).
2. Use the Orientation property to specify if the widget orientation in the segment must be vertical or
horizontal and drag-and-drop the supported widgets into the segment.
Note: You can use the HBox and VBox to align the widgets in the horizontal and vertical directions
without using the Orientation property.
3. Drag and-drop the supported widgets into the segment and set the data for the segment from the IDE
by using the data property or programmatically by specifying the widgetDataMap property and then set
data using the setData method.
4. Specify the rows of the segment must appear in a table or in pages by using the viewType property.
5. Use the selectionBehavior property to specify if the segment must support single selection or multiple
selection, or none. Based on your selection, define an onRowClick or a scrolling event.
Important Considerations
The following are the important considerations for the segment widget:
l Amount of data required from number of rows. For example, if you set data for 100 rows,
memory for all the 100 records will be in memory.
l View hierarchy (Box and other supported widgets) in each segment row. If the View hierarchy is
complex, the memory usage is high.
Note: On iPhone, 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.
Note: In KonyOne Studio 4.1 and below, if you add widgets (button, image, label, line, link, or
Rich Text) to the segment from the IDE, the value set for the isVisible property in the IDE for
these widgets is not considered. The default isVisible property value is set to true. If you want
to change the value to false, you can do so by using the segment methods.
l Images in segment are not scaled and are rendered with autosize property set to false. If the image
requires lesser space than the allocated space, the image is center aligned.
l You cannot add any elements to the widgets dynamically. However, if you want to hide any elements,
do not provide any data for that element.
l You can dynamically change the skin of the widgets in the segment by using the Segment Alternate
Methods.
l A SegmentedUI cannot be placed directly in a ScrollBox.It can be placed in a ScrollBox with
orientation as Vertical and only then you can place a SegmentedUI on a ScrollBox.
l The height of the segmentedUI is determined by the content of the widget. If you set the
screenLevelWidget as true, then the height of the segmentedUI widget is the form height excluding
headers and footers.
l Whenever a segmentedUI is set as screenLevelWidget there is a reduction in load time of the
segmentedUI but scrolling speed reduces. This is because the SegmentedUI loads few rows at the
load time and the rest of the rows are loaded as user scrolls through the widget. This is recommended
option when you have huge number of records.
l When a segmentedUI is not set as screenLevelWidget, load time of segmentedUI increases because
all the rows are loaded at the beginning, but scrolling speed improves.
Note: Mobile Web also supports dynamic skinning using the Segment Alternate Methods. However, for the
basic version of Mobile Web, if a background image is applied to the widget in the Segment through skin, the
dynamic skinning is not supported.
Note: In general Android SDK does not support the bounce-back feature (rubber band effect). But there are
some OEM's which extended the android SDK to support bounce-back like samsung devices. So to
summarize this is a device specific feature rather than an Android SDK feature.
l alternateRowSkin
l data
l groupCells
l id
l info
l isVisible
l needPageIndicator
l orientation
l pageOnDotImage
l pageOffDotImage
l pullToRefreshI18NKey
l pullToRefreshSkin
l pushToRefreshI18NKey
l pushToRefreshSkin
l releaseToPullRefreshI18NKey
l releaseToPushRefreshI18NKey
l retainSelection
l rowSkin
l rowFocusSkin
l rowTemplate
l screenLevelWidget
l sectionHeaderSkin
l sectionHeaderTemplate
l selectedRowIndex
l selectedRowIndices
l selectedRowItems
l selectionBehavior
l selectionBehaviorConfig
l separatorColor
l separatorRequired
l separatorThickness
l showScrollbars
l viewType
l viewConfig
l widgetDataMap
l widgetSkin
37.1.1 alternateRowSkin
Specifies the skin that is applied to every alternate even numbered row in the segment.
For example, if you have 5 segments, the alternate row skin is applied to segments 2 and 4.
Note: If you delete any even segment using the method removeAt, the odd indexes will reset and become
even. The Alternate skin is applied to these new even indexes.
For example, if you have 5 segments and you delete segment 2, the odd indexes reset and segment 3
becomes segment 2 and the alternate skin is applied to it.
Syntax
JavaScript: alternateRowSkin
Lua: alternaterowskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.2 data
Specifies the set of values that must be displayed on each row of the segment. The data is categorized into
Sections and Rows.The Sections information is optional. You can set the data in three different formats.
Note: In the above example, template is the standard key which can be optionally to override the common
rowTemplate provided with a specific template for the row. For template always the value has to be valid
box reference, if not it falls back to the common rowTemplate. mentainfo is another standard key which can
be used to specify meta information about the row. iOS specific standard parameters that metainfo can
support are clickable, skin and editmode.
Note: In the above examples, the values of dataId1, dataId2 are shown as string, but dataId3 is key value
pair. The key value pair format allows you to set the properties specific to the widget. In the above example,
we are setting the isVisible property to ture and text property to "Foo", skin property with ID nskin and
focusSkin to a skin with ID fskin. If a string is provided, typically is mapped to the text property for button
and labels and the src property for the image.
Example of Format 2
//set the data with sections where section header is a name. This example
has two sections and each section with two rows.
[
[
"section1",[
{dataId1:"foo", dataId2:"foo", dataId3:"foo", accessibilityCo
nfig:acObject},
{dataId1:"bar", dataId2:"bar", dataId3:"bar", accessibilityCo
nfig:acObject}
], accessibilityConfig:acObject
]
,
[
"section2",[
{dataId1:"foo", dataId2:"foo", dataId3:"foo", accessibilityCo
nfig:acObject},
{dataId1:"bar", dataId2:"bar", dataId3:"bar", accessibilityCo
nfig:acObject}
], accessibilityConfig:acObject
]
]
Example of Format 3
//set the data with sections where section header driven by template. This
example has two sections and each section with two rows.
[
[
{secDataId1:"", secDataId2:"", template=secHeaderBoxRef2, accessibility
Config:acObject},
[
{dataId1:"foo", dataId2:"foo", dataId3:"foo", accessibilityCo
nfig:acObject},
{dataId1:"bar", dataId2:"bar", dataId3:"bar", accessibilityCo
nfig:acObject}
]
]
,
[
{secDataId2:"", secDataId2:"", template=secHeaderBoxRef2, accessibility
Config:acObject},
[
{dataId1:"foo", dataId2:"foo", dataId3:"foo", accessibilityCo
nfig:acObject},
{dataId1:"bar", dataId2:"bar", dataId3:"bar", accessibilityCo
nfig:acObject}
]
]
]
The below table explains the type and description of template and metaInfo keys as well as keys inside the
metaInfo key:
JavaScript:
Object Indicates the template to be used for the specific
template Not Applicable
row
Lua: UserData
JavaScript:
metaInfo ( in JS)
Object
Allows to capture row level attributes
metainfo ( in Lua)
Lua: Table
JavaScript:
Boolean Specifies if the row is clickable and supported by
clickable
all platforms.
Lua: Boolean
JavaScript:
Number
Lua: Number
Possible values
eidtMode is only applicable if the editStyle has
constants.SEG been set to either constants.SEGUI_EDITING_
UI_EDIT_ STYLE_ICON or constants.SEGUI_EDITING_
MODE_ STYLE_SWIPE
INSERT (
editMode ( in JS) displays a "+"
If the editMode property is not specified for a row
icon on the left then it is not enabled for editing (even though an
editmode ( in Lua)
handside of the editStyle has been set).
row)
constants.SEGUI_EDIT_MODE_INSERT is not
constants.SEG applicable for constants.SEGUI_EDITING_
UI_EDIT_ STYLE_SWIPE
MODE_
DELETE (
displays a "-"
icon on the left
handside of the
row)
JavaScript:
Object ID of the skin that needs to be applied to the
skin
entire row.
Lua: UserData
Syntax
JavaScript: data
Lua: data
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.3 groupCells
Specifies if all the rows in the segment should grouped using a rounded corner background and border.
Default: true
Syntax
JavaScript: groupCells
Lua: groupcells
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
selectedRowIndex:4,selectedRowIndices:[4,5]};
var segLayout ={padding:[5,5,5,5], margin:[5,5,5,5], containerWeight:100};
var segPSP ={};
Yes
Platform Availability
Available on all platforms except Windows Phone (Mango), Desktop Web, and Server side Mobile Web
platforms
37.1.4 id
A unique identifier of Segment consisting of alpha numeric characters. Every Segment should have a unique
id within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.5 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming .
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
37.1.6 isVisible
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Platform Availability
37.1.7 needPageIndicator
A Page Indicator is a succession of docs centered below the SegmentedUI widget. Each dot corresponds to a
row segment with the white dot indicating the currently viewed page.
Specifies if the page indicator must be displayed when a segment is dispalayed using pageView. This
property is available only when the viewType is selected as pageView.
Default:true
Syntax
JavaScript: needPageIndicator
Lua: needpageindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.8 orientation
Specifies how you can stack the widgets within the SegmentedUI. You can set the orientation of the
SegmentedUI as horizontal or vertical.
Default: BOX_LAYOUT_HORIZONTAL
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: orientation
Lua: orientation
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except on all Server side Mobile Web and BlackBerry 10 platforms
37.1.9 pageOnDotImage
Specifies the image to indicate that the page is currently being viewed. This property is available only when
the viewType is selected as pageview. By default a white dot indicates the currently viewed page.
Note: The image size should be of size 7x7 px and 14x14 px for non-retina and retina devices respectively.
Type
Syntax
JavaScript: pageOnDotImage
Lua: pageondotimage
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.10 pageOffDotImage
Specifies the image to indicate that the pages that are not been currently viewed. This property is available
only when the viewType is selected as pageview. By default a black/grey dot indicates the currently viewed
page.
Note: The image size should be of size 7x7 px and 14x14 px for non-retina and retina devices respectively.
Syntax
JavaScript: pageOffDotImage
Lua: pageoffdotimage
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.11 pullToRefreshI18NKey
Specifies the i18N key for "pull to refresh" title. The platforms get the value from the existing application locale
specific i18N resource bundle. If the key is not found in the resource bundle, then platforms use the default
(english locale) title text.
Note: This property is supported when the viewType is set as SEGUI_VIEW_TYPE_TABLEVIEW and the
property screenLevelWidget is set to true.
Syntax
JavaScript: pullToRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.1.12 pullToRefreshSkin
Specifies the skin to be applied to the pull to refresh title. This property does not support image as
background.
Note: This property is supported when the viewType is set as SEGUI_VIEW_TYPE_TABLEVIEW and the
property screenLevelWidget is set to true.
l font_weight
l font_style
l font_size
l font_color
l font_name
l background_color
l bg_type
l background_style
Note: The "release to refresh" title picks the skin of "pull to refresh" or "release to refresh" respectively.
Syntax
JavaScript: pullToRefreshSkin
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.1.13 pushToRefreshI18NKey
Specifies the i18N key for "push to refresh" title. The platforms get the value from the existing application
locale specific i18N resource bundle. If the key is not found in the resource bundle, then platforms use the
default (english locale) title text.
Note: This property is supported when the viewType is set as SEGUI_VIEW_TYPE_TABLEVIEW and the
property screenLevelWidget is set to true.
Syntax
JavaScript: pushToRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.1.14 pushToRefreshSkin
Specifies the skin to be applied to the push to refresh title. This property does not support image as
background.
Note: This property is supported when the viewType is set as SEGUI_VIEW_TYPE_TABLEVIEW and the
property screenLevelWidget is set to true.
l font_weight
l font_style
l font_size
l font_color
l font_name
l background_color
l bg_type
l background_style
Note: The "release to refresh" title picks the skin of "pull to refresh" or "release to refresh" respectively.
Syntax
JavaScript: pushToRefreshSkin
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.1.15 releaseToPullRefreshI18NKey
Specifies the i18N key for "release to refresh" title that appears for pull to refresh. The platforms get the value
from the existing application locale specific i18N resource bundle. If the key is not found in the resource
bundle, then platforms use the default (english locale) title text.
Note: This property is supported when the viewType is set as SEGUI_VIEW_TYPE_TABLEVIEW and the
property screenLevelWidget is set to true.
Syntax
JavaScript: releaseToPullRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.1.16 releaseToPushRefreshI18NKey
Specifies the i18N key for "release to refresh" title that appears for push for refresh. The platforms get the
value from the existing application locale specific i18N resource bundle. If the key is not found in the resource
bundle, then platforms use the default (english locale) title text.
Note: This property is supported when the viewType is set as SEGUI_VIEW_TYPE_TABLEVIEW and
screenLevelWidget is set to true.
Syntax
JavaScript: releaseToPushRefreshI18NKey
Type
JavaScript: String
Read / Write
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.1.17 retainSelection
Specifies if the segment should retain the selection made even when the user navigates out of the form and
revisits the form.
Note: By default retainSelection is true in Server side Mobile Web, hence this property is not supported.
Default: false
If set to true, the selection is retained when the user navigates to different form.
Type
Syntax
JavaScript: retainSelection
Lua: retainselection
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
l SPA (iPhone/Android/BlackBerry/Windows NTH)
37.1.18 rowSkin
Syntax
JavaScript: rowSkin
Lua: rowskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.19 rowFocusSkin
Specifies the skin that must be applied when user selects the row.
Syntax
JavaScript: rowFocusSkin
Lua: rowfocusskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.20 rowTemplate
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.
Syntax
JavaScript: rowTemplate
Lua: rowtemplate
Type
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.21 screenLevelWidget
Specifies weather 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: You cannot place more than one segment as a screen level widget inside a form. Also, if you choose
to make a segment a screen level widget, we recommend that you place only one segment in the form and
do not place any other widgets in the form.
Note: Do not set the screen level widget property to true for more than one widget in the form. If you have
multiple widgets with this property set as true, there may be issues with how information is displayed along
with some scrolling issues.
Note: In iOS platform, screenLevelWidget property can be set to true when SegmentedUI is placed in
ScrollBox and Popup.
Default: false
If set to true, the widget occupies the whole container and there is a reduction in load time of the SegmentedUI
as only few rows are loaded at the load time. The rest of the rows are loaded as the user scrolls through the
widget. But the scrolling speed reduces.
If set to false, the widget does not occupy the whole container and load time of SegmentedUI increases
because all the rows are loaded at the beginning. But the scrolling speed improves.
On iPhone, Android, and Windows platforms, if this property is set to true, the following are applicable:
l The widgets placed above and below the segment (which is a screen level widget) are
not visible when rendered.
l You can use the retainHeaderFooter property to specify if the header and footer scroll
with the form or scroll with the segment.
Android
l Only the widgets placed above the segment (which is a screen level widget) are visible. The
widgets placed below the segment are not visible when rendered.
l You can use the Position property (segheader and segfooter) of the Box to specify if the header
and footer scroll with the form or scroll with the segment.
Note: If you leave the Position property options unchanged as normal; when rendered, only
the Boxes placed above the segment are visible. The Boxes placed below the segment are
not visible.
If you change the Position property to header or footer, the Boxes are added as form header or
footer and are "fixed" and do not scroll along with the segment.
Windows
l The widgets placed above and below the segment (which is a screen level widget) are
not visible when rendered.
Note: If you configure Application level Header and Footer, they will be visible even if the browser
is a screen level widget.
Syntax
JavaScript: screenLevelWidget
Lua: screenlevelwidget
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
l Windows Phone
l Windows Kiosk
37.1.22 sectionHeaderSkin
Syntax
JavaScript: sectionHeaderSkin
Lua: sectionheaderskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.23 sectionHeaderTemplate
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. Please refer data property for
examples.
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
screenLevelWidget has been set to true.
Syntax
JavaScript: sectionHeaderTemplate
Lua: sectionheadertemplate
Type
JavaScript: kony.ui.Box
Lua: UserData
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.24 selectedRowIndex
Indicates the currently selected row in single select or multi select modes in the SegmentedUI. The index is
with respect to the order in which data is set with data property. Programmatically setting the selectedRow
Index will not make any visible differences in the row, however it will bring the row at the index into the view
able area on the screen. Setting it to null/nil clears the selection state and also sets the selectedRowIndices
to null in case segui selection behavior is SEGUI_SINGLE_SELECT or SEGUI_DEFAULT_BEHAVIOR or
SEGUI_MULTI_SELECT_BEHAVIOR. The selectedRowIndex is not updated when clicked on any child
widget of a Row. For example, a Button or an HBox.
[sectionIndex1, [rowIndex1],
For example,
[1,3] indicates 4th row in 2nd section.
[1,4] indicates 5th row in 2nd section.
Syntax
JavaScript: selectedRowIndex
Lua: selectedrowindex
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
37.1.25 selectedRowIndices
Specifies an array of indexes which indicates the selected rows. In case of MULTI_SELECT there can be
more than one selected index and the array represents the same. In case of SINGLE_SELECT and
DEFAULT_BEHAVIOR the array contains only one element indicating the selectedIndex. Setting it to null/nil
clears the selection state and also sets the selectedIndices to null/nil. The selectedRowIndices is not updated
when clicked on any child widget of a Row. For example, a Button or an HBox.
When this property is read from the SegmentedUI the list structure depends on the usage of sections.
[
[sectionIndex1, [rowIndex1, rowIndex2, ...],
[sectionIndex3, [rowIndex4, rowIndex5, ...],
.....
]
For example:
Syntax
JavaScript: selectedRowIndices
Lua: selectedrowindices
Type
JavaScript: Array
Lua: Table
Read / Write
JavaScript Example
l If you set new data in the segment using the setData method, the earlier selected indices
are cleared.
l If you add additional data to the segment using the addAll method, the earlier selected
indices are retained.
No
Platform Availability
37.1.26 selectedRowItems
Syntax
JavaScript: selectedRowItems
Lua: selectedrowitems
Type
Lua: Table
Read / Write
No
Platform Availability
37.1.27 selectionBehavior
Default: SEGUI_DEFAULT_BEHAVIOR
l SEGUI_DEFAULT_BEHAVIOR: Indicates that the segment does not support either single or multiple
selection. This option allows you to define an onRowClick event for the segment.
l SEGUI_SINGLE_SELECT_BEHAVIOR: Indicates that you can make one selection when you have
many choices in the segment (the behavior is similar to a RadioButtonGroup).
l SEGUI_MULTI_SELECT_BEHAVIOR: Indicates that you can make more than one selection when
you have many choices in the segment (the behavior is similar to a CheckBoxGroup).
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: selectionBehavior
Lua: selectionbehavior
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.28 selectionBehaviorConfig
This property is enabled if you select either singleselect or multiselect. It specifies the Image widget ID which
is used to indicate to the user that the row is selected or deselected. Following are the key value
configurations:
imageIdentifier - Identifier of the Image widget that is placed in template box and this will be used to indicate
the selection state by toggling selectedStateImage and unselectedStateImage.
Note: Only after you specify the imageIdentifier, the selectStateImage and unselectedStateImage
properties will be available.
selectedStateImage
Specifies the image to be displayed when the user selects the row.
unselectedStateImage
Specifies the image to be displayed when the user deselects the row.
Note: The image size should be equal for both selectedStateImage and unselectedStateImage otherwise
the UI gets distorted.
Syntax
JavaScript: selectionBehaviorConfig
Lua: selectionbehaviorconfig
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
No
Platform Availability
37.1.29 separatorColor
Specifies the color of the separator between row of segmentedUI. The color property follows hex format
(#RRGGBBAA) which includes even transparency portion. For example, if the seperator color is green and
transparency is 50% then value is 00ff0032. Similarly if the transparency is 100% then the value is 00ff0064.
Syntax
JavaScript: separatorColor
Lua: separatorcolor
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.30 separatorRequired
Specifies if the segment should display the separator between the rows of the SegmentedUI.
Default: false
Syntax
JavaScript: separatorRequired
Lua: separatorrequired
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
37.1.31 separatorThickness
Note: For iOS platform, this property is applicable only when you set the groupCells property as true.
Note: From iOS7 onwards this property is not applicable even when you set the groupCells property as true.
Default: 1px
Syntax
JavaScript: separatorThickness
Lua: separatorthickness
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.32 showScrollbars
Syntax
JavaScript: showScrollbars
Lua: showscrollbars
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Desktop Web and Server side Mobile Web platforms
37.1.33 viewType
You can use this property to select the view type of a segment. The following are the available view types that
you can select and their appearances on iPhone native client:
Default: SEGUI_VIEW_TYPE_TABLEVIEW
Note: Only the view type SEGUI_VIEW_TYPE_TABLEVIEW supports sections. All other views do not
support sections but display rows of all sections continuously one below the other without any indication of
sections.However, all section related APIs, sectionIndex, rowIndex work with all views of the segui without
any code level changes when switching from one view to the other view.
Note: To avoid UI issues with segment, ensure that each page of segment with pageview has
equal size and also the height of segment should fit into the screen viewport area.
The below option applicable to iPhone, iPad and Android/Android Tablet platforms.
Syntax
JavaScript: viewType
Lua: viewtype
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
37.1.34 viewConfig
On Android platform, this property is applicable only when viewType is set as SEGUI_VIEW_TYPE_
COVERFLOW. The cover flow view enables you to flip through the widgets placed in a segment and bring the
associated widget into view. You can flip through the widgets placed in a segment as shown in the figure.
1. Drag-drop a segment on to the form, from the widget properties window navigate to viewType.
2. Click the Ellipsis ( ) button against the property, select Android and then select SEGUI_VIEW_
TYPE_COVERFLOW from the drop down box. Click OK.
3. Click the Ellipsis ( ) button against the viewConfig property. The viewConfig window appears.
4. Enter projectionAngle, rowItemRotationAngle, spaceBetweenRowItems, rowItemWidth, and
isCircular as required. Click OK.
On iOS platform, this property is applicable only when enableDictionary property is set to true. The index of
the dictionary is displayed as a bar on the right side of the segment. This property helps you to customize the
indexColor, indexBackgroundColor, and indexTrackingBackgroundColor.
tableViewConfig[JSObject]: This is a string key whose value is a map which accepts the configurations for
customizing the index bar of the table view. Following are the keys and their respective values:
indexColor [String]: Specifies the color of the index in hex format as a string. This option is
available from iOS 6 and above.
indexBackgroundColor [String]: Specifies the background color of the index in hex format as
a string. This option is available from iOS 7 and above.
In the below snapshots, the indexBackgroundColor is set as blue and indexTrackingBackgroundColor is set
as red. When the form is loaded, indexBackgroundColor is displayed as blue, but when you scroll then the red
color is applied to the bar.
Syntax
JavaScript: viewConfig
Type
JavaScript: JSObject
Read / Write
Platform Availability
l iPad
l iPhone
l Android/Android Tablet
37.1.35 widgetDataMap
Specifies the mapping information between the widget id's and the keys in the data.
Note: It is developer responsibility to ensure that Widget datamap to accommodate all the widget ids
required including the widgets referred in dynamic templates.
{
widgetID1: "dataId1",
widgetId2: "dataId2",
widgetId3: "dtaId3",
widgetId4: "secDataId1"
widgetId5: "secDataId2"
}
Note: Only after you specify the mapping information, you can use the Methods applicable for a segment.
Syntax
JavaScript: widgetDataMap
Lua: widgetdatamap
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Below is an example showing a segment and assigning properties for widgets placed on it.
//On an onClick event of a button, the properties for label1, image1 and
button1 are set.
function form1_button_onClick_(eventobject) {
form1.segment1.data = [{
"button1": {
"text": "CButton1",
"containerWeight": 50
},
"label1": {
"text": "CButton2",
"containerWeight": 30,
"isVisible":false
},
"image1": {
"src": "img4.png",
"isVisible": true,
"containerWeight":50
}
}]
};
No
Platform Availability
37.1.36 widgetSkin
Note: In Server side Mobile Web, widgetSkin property with Border style as rounded corner is supported only
when you set the border property as SEGUI_BORDER_NONE.
Syntax
JavaScript: widgetSkin
Lua: widgetskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l containerHeight
l containerHeightReference
l containerWeight
l gridCell
l layoutMeta
l layouType
l layoutAlignment
l margin
l marginInPixel
l padding
l paddingInPixel
37.2.1 containerHeight
Specifies the height of the SegmentedUI in terms of percentage. The percentage is with reference to the value
of containerHeightReference property. This property is enabled when the viewType is set as SEGUI_VIEW_
TYPE_TABLEVIEW or SEGUI_VIEW_TYPE_PAGEVIEW.
Note: In Windows platforms, when screenLevelWidget property is set to false, the SegmentedUI widget
occupies the form screen height. When screenLevelWidget property is set to true and viewType property is
set to TABLEVIEW, the SegmentedUI widget occupies the form height.
Note: When screenLevelWidget property is set to true and viewType property is set to PAGEVIEW, the
SegmentedUI widget occupies the content height.
Syntax
JavaScript: containerHeight
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform availability
37.2.2 containerHeightReference
Default: CONTAINER_HEIGHT_BY_FORM_REFERENCE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: containerHeightReference
Type
JavaScript: Number
Read / Write
JavaScript Example
Yes
Platform Availability
37.2.3 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
37.2.4 gridCell
Note: This property is applicable only when a widget is placed inside a container widget with Grid Layout
applied.
Represents the grid cell details in the sequence colSpan, rowSpan, rowNo, colNo. Description of the details
are as follows:
l colSpan: Specifies the number of columns that a grid should span. Default value is 1.
l rowSpan: Specifies the number of rows that a grid should span. Default value is 1.
l rowNo: Specifies the row number in where the widget is placed in a grid layout.
l colNo: Specifies the column number in where the widget is placed in a grid layout.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. The default option is XYLayout. To set GridLayout, right-click on the form and select Apply
GridLayout.
Syntax
JavaScript: gridCell
Lua: gridCell
Type
JavaScript: JSObject
Lua:table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
37.2.5 layoutMeta
A custom JSObject with the key, value pairs that developer can use to provide the meta info about the grid
layout. The following are the mandatory keys required to be part of the Meta.
Note: The data for layoutmeta data is set when you set grid layout view properties for rows and columns.
This property can be set using Kony Studio Grid Layout view. To set the view, go to Window > Show View >
Others and select GridLayout View from Kony Studio folder.
The sum total of percentage (%) widths of each of the columns in the grid layout should add up to 100%.
Syntax
JavaScript: layoutMeta
Lua: layoutmeta
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
37.2.6 layoutType
Defines the type of the layout of widget. Following are the available options:
l CONTAINER_LAYOUT_BOX: This is the default options on both Windows Tablet and Desktop Web
platforms.
l CONTAINER_LAYOUT_GRID: In grid layout the form is split it to rows and columns.
Note: Layout type is not visible as a property. It is set when the user applies XYLayout or GridLayout on a
form. From the IDE, the default option is XYLayout. To set GridLayout, right-click on the form and select
Apply GridLayout.
Syntax
JavaScript: layoutType
Lua: layouttype
Type
Lua:String - [Mandatory]
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Desktop Web
37.2.7 layoutAlignment
Default: BOX_LAYOUT_ALIGN_FROM_LEFT
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: layoutAlignment
Lua: layoutalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
Available on all platforms except Server side Mobile Web, BlackBerry 10, and Windows Kiosk platforms.
37.2.8 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: widgetSkin
Lua: widgetskin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
37.2.9 marginInPixel
Enables you to define the space around a widget in pixels or in percentage. You can use this option to define
the top, left, right, and bottom distance between the widget and the next element.
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
37.2.10 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except iOS, Server side Mobile Web (basic), and BlackBerry 10 platforms
37.2.11 paddingInPixel
Enables you to define the space between the content of the widget and the widget boundaries in pixels or in
percentage. You can use this option to define the top, left, right, and bottom distance between the widget
content and the widget boundary.
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Android/Android Tablet
l Windows Phone (Mango)
l Windows Kiosk
l blockedUISkin
l border
l bounces
l contextMenu
l defaultSelection
l dockSectionHeaders
l editStyle
l enableDictionary
l indicator
l pressedSkin
l progressIndicatorColor
l searchBy
l searchCriteria
l showProgressIndicator
l viewConfig
37.3.1 blockedUISkin
Specifies the skin that must be used to block the interface until the action in progress (for example, a service
call) is completed.
Note: For the skin to be available in the list, you must add a skin for blockedUISkin under Widget Skins.
Syntax
JavaScript: blockedUISkin
Lua: blockeduiskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Desktop Web
l Server side Mobile Web (advanced)
l SPA (iPhone/Android/BlackBerry/Windows NTH)
37.3.2 border
Default: SEGUI_BORDER_BOTH_BOTTOM_TOP
Note: This property is applicable only when the segment viewType is set to SEGUI_VIEW_TYPE_TABLE_
VIEW.
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: border
Lua: border
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
37.3.3 bounces
Specifies whether the scroll view bounces past the edge of the content and back again.
Default:true
Note: This property is applicable only when the segment viewType is set to SEGUI_VIEW_TYPE_TABLE_
VIEW.
Syntax
JavaScript: bounces
Lua: bounces
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.4 contextMenu
A context menu is a menu that appears upon clicking a widget. A context menu typically offers a limited set of
choices that are applicable for that widget. Usually these choices are actions, related to the widget.
If you define a context menu for a widget, the steps involved to invoke the context menu on a platform and the
appearance of the context menu varies.
l You can invoke the context menu either by clicking on the widget (applicable only on BlackBerry
versions 6.x and above) or by a long press on the screen (or trackpad).
l You can choose to add icons to indicate the menu items in the context menu (applicable only on
BlackBerry versions 6.x and above).
l BlackBerry layouts menu items in a 3 item grid view. The menu items Switch Application, Help, Close,
and Full Menu are added automatically based on the number of menu items added in the context menu.
For example, If you add a context menu with 2 items, it will display Full Menu item along with the items
added. If you add a context menu with 3 items, it will display Full Menu, Help, Switch Application items
along with the items added.
l If the focus is on a widget that has a context menu; and if you click the "menu key", the Full Menu
appears along with the context menu items.
l On Blackberry Non-Touch Devices, only Full Menu item is displayed irrespective of number of items
added in the context menu.
Note: The context menu items in the Full Menu will disappear if the focus is shifted from the widget which
has the context menu.
The following images illustrates the context menu on various BlackBerry devices:
l You can invoke the context menu by a long press on the widget.
l The menu items are displayed as text (no support for icons).
l There is no support for sub-menus in a context menu.
The following image illustrates the context menu on Android platform:
Type
Array(kony.ui.MenuItem)
Syntax
JavaScript: contextMenu
Lua: contextmenu
Type
Lua: Table
Read / Write
JavaScript Example
function callbackMenuItem1()
{
alert("Clicked on First menu item");
}
function callbackMenuItem2()
{
alert("Clicked on Second menu item");
}
function callbackMenuItem3()
{
alert("Clicked on Third menu item");
}
function callbackMenuItem4()
{
alert("Clicked on Fourth menu item");
}
Note: On Android platform, the image icon, separator, and submenu properties are not supported.
No
Platform Availability
l Android/Android Tablet
l BlackBerry
l Windows Phone
l Windows Tablet
37.3.5 defaultSelection
Specifies if the first clickable element (Image or Label) of the segment is selected by default.
Default:true
Note: This property is applicable only when the segment viewType is set to SEGUI_VIEW_TYPE_TABLE_
VIEW.
Syntax
JavaScript: defaultSelection
Lua: defaultselection
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
37.3.6 dockSectionHeaders
The docking header property enables you to dock or place 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 is applicable only when the segment is a screenLevelWidget and viewType is set to
SEGUI_VIEW_TYPE_TABLE_VIEW and has sections data.
For example, If you scroll the segment data shown in the figure below, as the segment data scrolls up, the
Samsung Phones docked header moves out of view and is replaced with the HTC Phones section header
which is now docked.
Default:false
Syntax
JavaScript: dockSectionHeaders
Lua: docksectionheaders
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Yes
Platform Availability
37.3.7 editStyle
Default: SEGUI_EDITING_STYLE_NONE
l SEGUI_EDITING_STYLE_ICON: An icon will be displayed on the left hand side of each row.
l SEGUI_EDITING_STYLE_SWIPE: A delete or insert button will be shown on the right hand side of
each row when the user performs a SWIPE gesture on the row. Whether an insert button or delete
button is to be shown is controlled by the editmode property that is set using the data property of the
SegmentedUI.
l SEGUI_EDITING_STYLE_NONE: No special edit styles are applied.
Note: This property is applicable only when the segment viewType is set to SEGUI_VIEW_TYPE_TABLE_
VIEW.
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
For information regarding the Meta Info that can be set for the rows, see Methods associated with the
segment.
If you want to enable Swipe to delete feature for a row in the SegmentedUI then set the editing style to
constants.SEGUI.EDITING_STYLE_SWIPE (a delete confirmation appears when you swipe a row).
Syntax
JavaScript: editStyle
Lua: editstyle
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
l iPhone
l iPad
37.3.8 enableDictionary
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 screenLevelWidget property is set to true, viwType is set to SEGUI_
VIEW_TYPE_TABLE_VIEW, and the section headers have been set.
Default: false
The following image illustrates the behavior of the Enable Dictionary property when set to true:
Syntax
JavaScript: enableDictionary
Lua: enabledictionary
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.9 indicator
Specifies the indicator type as rowSelect, rowClick, or none. Based on your selection, the behavior is
exhibited:
Default: SEGUI_ROW_SELECT
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: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: indicator
Lua: indicator
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.10 pressedSkin
Specifies the skin to indicate that the row of the segment is pressed or clicked.
Syntax
JavaScript: pressedSkin
Lua: pressedskin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
37.3.11 progressIndicatorColor
Default: PROGRESS_INDICATOR_COLOR_WHITE
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: progressIndicatorColor
Lua: progressindicatorcolor
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.12 searchBy
Indicates the identifier of the widget placed inside the row of the SegmentedUI. Search will be performed
against the content present inside the widget.
Note: This property is applicable only when screenLevelWidget of SegmentedUI is set to true and viewType
is set to SEGUI_VIEW_TYPE_TABLE_VIEW.
Syntax
JavaScript: searchBy
Lua: searchby
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.13 searchCriteria
Specifies the search criteria to be applied when searching has been enabled on the SegmentedUI.
Note: This property is applicable only when screenLevelWidget of SegmentedUI is set to true, viewType is
set to SEGUI_VIEW_TYPE_TABLE_VIEW, and searchBy property has been set.
Default: SEGUI_SEARCH_CRITERIA_STARTSWITH
Note: To set the value through code, prefix the option with constants. such as constants.<option> .
Syntax
JavaScript: searchCriteria
Lua: searchcriteria
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.14 showProgressIndicator
If you do not want the progress indicator to be displayed, set the value to none.
Syntax
JavaScript: showProgressIndicator
Lua: showprogressindicator
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iPhone
l iPad
37.3.15 viewConfig
Note: For more information on applying the Grid layout please refer Kony Studio User Guide.
Configurable properties of viewConfig property are Reference Width and Reference Height. If reference height
and width are greater than 0, then view set is grid view.
Default application displays 0, you can give any number greater than 0 to get grid view type of a widget.
For example, if you set an onClick to a box, the onClick event will be executed whenever you click each cell.
If you set righttap event using setGestureRecognizer to a box then you can see right click behavior on each
cell of grid view.
Syntax
JavaScript: viewConfig
Lua: viewconfig
Type
JavaScript:Object
Lua: table
Read / Write
No
Yes
Platform Availability
l onDidFinishDataLoading
l onEditing
l onRowClick
l onSwipe
l scrollingEvents
l preOnclickJS
l postOnclickJS
Note: In Server side Mobile Web, for the events preOnclickJS and postOnclickJS you will not be able to
access application model or APIs, as these functions are executed in browser whereas the remaining JS
modules are executed in server. For these events you can access browser objects ( window, document
etc..) to change UI or perform some validation before server event. If the event preOnclickJS returns true,
only then the request is sent to server for subsequent action.
You have to specify the modules to be loaded in browser using import JS tab, only then these files get
included in html script tag otherwise you will not be able to access the objects defined in those modules.
37.4.1 onDidFinishDataLoading
This event is triggered when you load data in the segmentedUI using the setData method. This event is
supported only when you set the segment view type as table view.
Signature
JavaScript: onDidFinishDataLoading
Read / Write
JavaScript Example
//The below function is the call back function for onEditing event
function onDidFinishDataLoadingCallBck(seguiWidget)
{
//Write your logic here
}
Platform Availability
37.4.2 onEditing
This event is triggered when a user indicates his desire to edit the row (delete or insert). This event is only
triggered if the eidtStyle is set to SEGUI_EDITING_STYLE_ICON or SEGUI_EDITING_STYLE_SWIPE.
Signature
Input Parameters
editmode - Mandatory
Specifies the editing mode either insert or delete. Following are the available options:
l SEGUI_EDIT_MODE_INSERT
l SEGUI_EDIT_MODE_DELETE
Note: To set the value through code, prefix the option with constants. such as
constants.<option> .
JavaScript Example
//The below function is the call back function for onEditing event
function onEditingCallBck(seguiWidget, editmode, sectionIndex, rowIndex)
{
//Write your logic here
}
Platform Availability
37.4.3 onRowClick
This event is triggered when the user click any row of the SegmentedUI. This event is not raised if the
clickable property in the metainfo is set to false.
Signature
Input Parameters
Read / Write
JavaScript Example
Platform Availability
37.4.4 onSwipe
This event is triggered when you swipe a row in a segment. This event is available only when the viewType is
set to page view.
Signature
Input Parameters
l SEGUI_VIEW_TYPE_PAGEVIEW
l SEGUI_VIEW_TYPE_COVERFLOW (iOS and Android)
l SEGUI_VIEW_TYPE_STACK (iOS)
l SEGUI_VIEW_TYPE_LINEAR (iOS)
l SEGUI_VIEW_TYPE_ROTATORY (iOS)
l SEGUI_VIEW_TYPE_INVERTED_ROTARY (iOS)
l SEGUI_VIEW_TYPE_CYLINDER (iOS)
l SEGUI_VIEW_TYPE_INVERTED_CYLINDER (iOS)
Read / Write
JavaScript Example
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, and Server side Mobile Web (Basic, BJS,
and Advanced) platforms.
37.4.5 scrollingEvents
An event callback that is invoked by the platform when scrolling the SegmentedUI widget.
Following are the requirements and limitations to use this event on iOS and Android/Android Tablet platforms:
l This event is invoked only when it is placed directly inside a ScrollBox or in a Form
l Segment viewType must be set as SEGUI_VIEW_TYPE_TABLEVIE
l The property screenLevelWidget must be set to true.
Note: If segment is inside any other container widget like HBox/VBox then onPull, onPush,
onReachingBegining and onReachingEnd events, cross platform behavior is undefined and these events
might not be called.
Note: On Android platform, if the rows height/number of rows is less than the screen display height, then
onReaching and onPush event callbacks won't get invoked.
Signature
JavaScript: onReachingBegining(seguiWidget)
Lua: onreachingbegining(seguiWidget)
onReachingEnd: Gets called when scrolling reaches the end of the SegmentedUI widget.
Signature
JavaScript: onReachingEnd(seguiWidget)
Lua: onreachingend(seguiWidget)
Signature
JavaScript: onPull(seguiWidget)
Lua: onpull(seguiWidget)
Signature
JavaScript: onPush(seguiWidget)
Lua: onpush(seguiWidget)
Input Parameters
Type
JavaScript: JSObject
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
Available on all platforms except BlackBerry, BlackBerry 10, Desktop Web, Windows Kiosk, and Server
side Mobile Web platforms
37.4.6 preOnclickJS
This event allows the developer to execute custom javascript function before the onClick callback of the
widget is invoked. This is applicable only for Mobile Web channel. The function must exist in a javascript file
under project>module>js folder.
Syntax
JavaScript: preOnclickJS
Lua: preonclickjs
Read / Write
JavaScript Example
//The below function is the call back function for preOnclickJS event call.
function preOnclickJSCalBck(seguiWidget)
{
//Write your logic here
}
Yes
Platform Availability
Available on Server side Mobile Web (BJS and Advanced) platform only
37.4.7 postOnclickJS
This event allows the developer to execute custom javascript function after the onClick callback of the widget
is invoked. This is applicable only for Mobile Web channel.The function must exist in a javascript file under
project>module>js folder.
Syntax
JavaScript: postOnclickJS
Lua: postonclickjs
Read / Write
JavaScript Example
//The below function is the call back function for postOnclickJS event cal
l.
function postOnclickJSCalBck(seguiWidget)
{
//Write your logic here
}
Yes
Platform Availability
Note: The methods described in this section can be used only after you specify the mapping information
between the widget IDs and the keys in the data using the widgetDataMap property.
The methods that you can use on all platforms are as follows:
l addAll
l addDataAt
l addSectionAt
l removeAll
l removeAt
l removeSectionAt
l setData
l setDataAt
l setSectionAt
37.5.1 addAll
This method allows you to add new data to the segment. The new data is appended to the existing data. If the
segment has no data, the new data is placed in the segment.
Note: Using this method, you can not add the rows to the existing sections.
Signature
JavaScript: addAll(data)
Lua:segui.addall(seguiid, data)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
37.5.2 addDataAt
Allows you to add one row of data at a given index or with in a section. The new data is placed before the
index. The existing data is pushed to the next row.
Signature
Input Parameters
Row data can also have the standard template key to indicate a new template for this added row.
However it is developer responsibility to ensure widgetdatamap covers the widgets present in the
new template.
Note: Sections should not be counted as rows when calculating the rowIndex.
Index is '0' based in JavaScript and should be less than "n", where "n" is the number of existing
rows within the section if sectionIndex is mentioned. If the sectionIndex is not mentioned "n" is the
total number of rows in a segment.
Index is '1' based in Lua and should be less than "n", where "n" is the number of existing rows
within the section if sectionIndex is mentioned. If the sectionIndex is not mentioned "n" is the total
number of rows in a segment.
If the rowIndex mentioned is greater than "n", then row is added at the end of the segment or at the
end of the section depending on the sectionIndex.
Return Values
None
JavaScript Example
//Defining a row.
dataObj1 = {globaDdataId1:"label1", globaDataId2:"label2", globalDataId3:"
label3"};
//addAt method call ,adding the above row at 15th index position.
segment.addDataAt(dataObj1,15);
Error Codes
None
Platform Availability
37.5.3 addSectionAt
This method allows you to add one or more sections with rows to the segment.
Signature
Input Parameters
Note: Sections and its rows can have the standard template key to indicate a new template
for this added row. However it is developer responsibility to ensure widgetdatamap covers the
widgets present in the new template.
Index is '0' based in JavaScript and should be less than "n", where "n" is the number of existing
sections within the segment. If the index is greater than or equal to "n", then section is added at the
end of the segment.
Index is '1' based in Lua and should be less than "n", where "n" is the number of existing sections
within the segment. If the index is greater than or equal to "n", then section is added at the end of
the segment.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
37.5.4 removeAll
This method is used to remove all the existing rows and sections in a segment.
Signature
JavaScript: removeAll()
Lua: segui.removeall(seguiid)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
37.5.5 removeAt
This method is used to remove the row at the given index or a row with in a section.
Note: If the index is not within the limits then removeAt will be silent and doesn't yield any result.
Signature
Input Parameters
Note: Sections should not be counted as rows when calculating the rowIndex.
Index is '0' based in JavaScript and should be less than "n", where "n" is the number of existing
rows within the section if sectionIndex is mentioned. If the sectionIndex is not mentioned "n" is the
total number of rows in a segment.
Index is '1' based in Lua and should be less than "n", where "n" is the number of existing rows
within the section if sectionIndex is mentioned. If the sectionIndex is not mentioned "n" is the total
number of rows in a segment.
If the rowIndex mentioned is not within the limits then no action takes place.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
37.5.6 removeSectionAt
This method allows you to remove a section at the given index within a segment.
Signature
JavaScript: removeSectionAt(sectionIndex)
Input Parameters
Index is '0' based in JavaScript and should be less than "n", where "n" is the number of existing
sections within the segment. The operation is ignored if the sectionIndex is not mentioned.
Index is '1' based in Lua and should be less than "n", where "n" is the number of existing sections
within the segment. The operation is ignored if the sectionIndex is not mentioned.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
37.5.7 setData
This method allows you to set new data to the segment. When you set new data, the existing data will be
replaced with the new data. If the segment has no data, the new data is placed in the segment.
Signature
JavaScript: setData( data)
Input Parameters
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
37.5.8 setDataAt
Allows you to set data or modify an existing data of a row or within a section. The existing data of the row will
be replaced with the new set. In case the index is not valid and not falling in range 0 <= index <= N, where N is
the total number of records then the operation is ignored.
Signature
Input Parameters
Note: Sections should not be counted as rows when calculating the rowIndex.
Index is '0' based in JavaScript and should be less than "n", where "n" is the number of existing
rows within the section if sectionIndex is mentioned. If the sectionIndex is not mentioned "n" is the
total number of rows in a segment.
Index is '1' based in Lua and should be less than "n", where "n" is the number of existing rows
within the section if sectionIndex is mentioned. If the sectionIndex is not mentioned "n" is the total
number of rows in a segment.
If the rowIndex mentioned is not within the limits then no action takes place.
Return Values
None
JavaScript Example
//Defining a row.
dataObj1 = {globaDdataId1:"label3", globaDataId2:"label4", globalDataId3:"
label5"};
//setDataAt method call,modifying the data at 15th index position with the
above row.
segment.setDataAt(dataObj1,15);
Error Codes
None
Platform Availability
37.5.9 setSectionAt
This method allows you to set or modify a section with rows to the segment. When you set new data, the
existing data will be replaced with the new data. If the segment has no data, the new data is placed in the
segment.
Signature
Input Parameters
Index is '0' based in JavaScript and should be less than "N", where "N" is the number of existing
sections within the segmentedUI widget. If not. setSectionAt will be silent and does not yield any
results.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
SegmentedUI template enables you to define a template for section headers. Only one template can be used
for each segment. This is primarily useful for developers to achieve common look and feel of section headers
along with few widgets added as part of section header of a segment.
When you want the same information to be displayed across all the Section Headers of a Segment in the
application, you have a provision to add a Segment Template using Kony Studio. For more information about
section headers refer Kony Studio User Guide.
1. Go to Applications View.
2. Expand the application for which you want to create the SegmentTemplate.
3. Navigate to templates > segments, right-click mobile/desktop/tablet and select New Segment
Template. The Create a New Segment window appears.
Note: Only HBox and Scrollable box are supported on the form. You can put
other widgets within these widgets.
i. Drag and drop the required widgets onto the HBox/Scrollable Box. Set the properties of
these widgets. For more information, see Kony Widget User Guide.
ii. A segment template is created.
For more information on setting a Section Header template for a segment, click here.
You can define only one template for each segment using the above process.
1. Go to Applications view.
2. Expand the application for which you want to use section template.
3. Navigate to forms > mobile/tablet/desktop , right-click and select New Form. The Create a New
Form window appears.
4. Enter a name for the Form and click Finish. A new Form is created.
5. If you are building for desktop, select the Form in desktop and right-click on the Form. Select Fork. The
Platform Selection window appears.
6. Select Desktop_web and click OK. The form is now forked for Desktop_web and new window
appears as web_<formname>.
Note: The development activities for desktop web should happen in web_<formname> only. Although the
newly created form, remains accessible in the desktop forms.
7. Drag-drop a SegmentedUI on the Form and add widgets to the segment as required. Click Save.
8. To set the template to a segment, select the segment and go to Properties window.
9. Select sectionHeaderTemplate and Select/Search Segment Template window appears. Select the
template, which you want to set to the segment.
10. Click OK.
Note: Setting data using data property will be made available in future releases.
38. Switch
The Switch widget is identical to the Switch Control (on-off switch which is non customizable) in iPhone and
presents two mutually exclusive choices or states.
The Switch widget displays the value that is currently in effect. You must slide the control to select (or reveal)
the other value.
Note: The Switch widget is supported on iOS, SPA, Desktop Web, Windows Phone (7.5 and 8), and
Windows 8 Tablets.
You can use a Switch widget to present the user two simple, diametrically opposed choices that determine
the state or choice of something.
For example, in an Airline application booking screen, you can use the Switch widget to display "One Way "
and "Round Trip". The user can choose to slide and select the required value before proceeding with the
booking.
The Switch widget provides you with an option to set Basic Properties, Layout Properties, and Events.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
1. From the IDE, drag and drop the Switch widget onto a form (occupies the complete available width).
Or, based on your requirements, you can choose to perform the following :
a. If you want to resize a Switch widget in the horizontal direction, place an HBox on the form and
drag and drop the Switch inside the HBox and resize accordingly.
2. Specify the text to be displayed in the left and right portions of the Switch widget by using the
leftSideText and rightSideText properties respectively.
3. (Optional) Use the selectedIndex property to specify the option of the Switch that must be shown as
selected when rendered.
4. (Optional) Use the skin property to specify an image for the left and right portions of the Switch widget.
For example, you can use a bright image for the selected side and a dull image for the unselected side.
Note: You must first add a skin for the Switch widget and specify the Left Image and the Right
Image. For more information about adding skins in the IDE, see the Working with Applications
section of the Kony Studio User Guide.
Important Considerations
l For a good user experience, use a predictable pair of values so that the users do not have to slide the
Switch to know the other value.
l You can also consider using the Switch widget to change the state of other UI elements in the view.
Depending upon the choice that the user makes, changes in the UI must take place.
For example, in an Airline application booking screen, based on the Switch widget selection as "One
Way" or "Round Trip", the required UI elements must change.
l One color or Two colors in iPhone specific forked skin are supported only on iOS 5.0 and above. These
properties are not respected in versions older than iOS 5.0.
l Following are the changes and behavior of Switch widget in iOS7 and above:
l id
l info
l isVisible
l leftSideText
l Left Text i18n Key
l rightSideText
l Right Text i18n Key
l selectedIndex
l skin
38.1.1 id
A unique identifier of Switch consisting of alpha numeric characters. Every Switch should have a unique id
within a Form.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.1.2 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can always read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.1.3 isVisible
Default:true
Note: This property is not applicable if the widget is placed in a SegmentedUI. When the widget is placed in
a Segment, the default Visibility is set to true. If you want to change the value to false, you can do so by
using the SegmentedUI methods.
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.1.4 leftSideText
Syntax
JavaScript: leftSideText
Lua: leftsidetext
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
Specifies the key to be used for internationalization of the string specified in the leftSideText property.
Syntax
JavaScript: leftSideText
Type
JavaScript: kony.i18n.getLocalizedString
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.1.6 rightSideText
Syntax
JavaScript: rightSideText
Lua: rightsidetext
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
Specifies the key to be used for internationalization of the string specified in the rightSideText property.
Syntax
JavaScript: rightSideText
Type
JavaScript: kony.i18n.getLocalizedString
Read / Write
No
JavaScript Example
selectedIndex:0, isVisible:true};
var swtchLayout = {margin:[5,5,5,5], marginInPixel:false, widgetAlignment:
constants.WIDGET_ALIGN_TOP_LEFT, containerWeight:99};
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.1.8 selectedIndex
This property is accessible only from code and it specifies the option of the Switch that must be shown as
selected when rendered.
In JavaScript, the possible values for this property are 0 and 1. By default, the selected Index is set to 1, and
the option in the right portion of the Switch is selected. If you change the selected index to 0, the option in the
left portion of the Switch is selected.
In Lua, the possible values for this property are 1 and 2. By default, the selected Index is set to 2, and the
option in the right portion of the Switch is selected. If you change the selected index to 1, the option in the left
portion of the Switch is selected.
Note: If data contains the sections then the selectedIndex indicates the selected row index within the
section.
Syntax
JavaScript: selectedIndex
Lua: selectedindex
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.1.9 skin
Note: In iOS 7 platform, if the skin is not applied, we will get the look and feel of native switch. If the skin is
applied we will not get the native look.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
l containerWeight
l margin
l marginInPixel
l widgetAlignment
38.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.2.2 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.2.3 marginInPixel
Enables you to define the space around a widget in pixels or in percentage. You can use this option to define
the top, left, right, and bottom distance between the widget and the next element.
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.2.4 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_TOP_LEFT
l WIDGET_ALIGN_TOP_CENTER
l WIDGET_ALIGN_TOP_RIGHT
l WIDGET_ALIGN_MIDDLE_LEFT
l WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
38.3.1 onSlide
An event callback that is invoked by the platform when there is a change in the default selected value.
Syntax
JavaScript: onSlide
Lua: onslide
The onSlide event callback accepts additional parameters when a Switch widget is placed in a segment row
or section template.
Signature
Input Parameters
Read / Write
JavaScript Example
Yes
Platform Availability
l iOS
l Windows Phone
l Windows Tablet
l SPA
l Desktop Web
39. SignatureCapture
A SignatureCapture widget enables you to capture a signature on a form and save it as an image for easy
uploading.
Note: This widget is only supported on Windows Phone 8 and Windows 8 Tablet platforms.
The SignatureCapture widget provides you with an option to set Basic Properties, Layout Properties Platform
Specific Property, Event, and Methods.
Platform Specific
Basic Properties Layout Properties
Properties
id containerWeight accessMode
info hExpand
isVisible margin
penWidth marginInPixel
rawBytes padding
skin paddingInPixel
vExpand
widgetAlignment
Event Methods
onCapture clear
save
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
1. From the IDE, drag and drop the Signature widget onto a form or any other container widget.
2. Set the value of pen width to a value between 1 and 10 inclusive.
Customizing Appearance
You can customize the appearance of the SignatureCapture widget by using the following properties:
Important Considerations:
l The padding and margin properties are not applicable for this widget.
l This widget is supported only in Windows Phone 8 and Windows 8 tablet platforms.
l id
l info
l isVisible
l penWidth
l rawBytes
l skin
39.1.1 id
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.1.2 info
A custom JSObject with the key value pairs that a developer can use to store the context with the widget.
This will help in avoiding the globals to most part of the programming.
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can always read and write data to it.
Info property holds any JSObject. Post assigning the JSObject to info property, the JSObject should not be
modified. For example,
widget.info.a = 'hello world'; //This will not update the widget info a pr
operty to Hello world. widget.info.a will have old value as hello.
Syntax
JavaScript: info
Lua: info
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
No
Platform Availability
l Windows Tablet
l Windows Phone
39.1.3 isVisible
Default:true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.1.4 penWidth
Specifies the width of the stroke lines of a signature. You can enter a value between 1-10 inclusive.
Syntax
JavaScript: penWidth
Lua: penwidth
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.1.5 rawBytes
Note: This is a non-Constructor property. You cannot set this property through widget constructor. But you
can read and write data to it.
Syntax
JavaScript: rawBytes
Lua: rawbytes
Type
JavaScript: JSObject
Lua: UserData
Read / Write
No
Platform Availability
l Windows Tablet
l Windows Phone
39.1.6 skin
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
l containerWeight
l hExpand
l margin
l marginInPixel
l padding
l paddingInPixel
l vExpand
l widgetAlignment
39.2.1 containerWeight
Specifies the percentage of the parent width that should allocated to the widget. The parent widget space is
distributed to its child widgets based on this weight factor. All its child widgets should sum up to 100% of
width except when placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
No
Platform Availability
l Windows Tablet
l Windows Phone
39.2.2 hExpand
Specifies if the widget should occupy all the width available to it.
Default: true
If set to false, the widget occupies the preferred width. The preferred width of a widget is the sum of its
contents width, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: hExpand
Lua: hexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.2.3 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element.
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: widgetSkin
Lua: widgetskin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.2.4 marginInPixel
Enables you to define the space around a widget in pixels or in percentage. You can use this option to define
the top, left, right, and bottom distance between the widget and the next element.
Default: false
Syntax
JavaScript: marginInPixel
Lua: margininpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.2.5 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary.
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.2.6 paddingInPixel
Enables you to define the space between the content of the widget and the widget boundaries in pixels or in
percentage. You can use this option to define the top, left, right, and bottom distance between the widget
content and the widget boundary.
Default: false
Note: This property can be set to true or false only for iPhone, iPad, Android and Windows Phone. On other
platforms this property does not give any results even when set to true.
Note: For backward compatibility on older projects, this property is will be made true for iPhone, iPad,
Android and Windows Phone and for other platforms it will be false.
Syntax
JavaScript: paddingInPixel
Lua: paddinginpixel
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.2.7 vExpand
Specifies if the widget has to occupy all the vertical space available to it.
Note: Mobile Web does not support the Expand property. This is because a widget in a Mobile Web cannot
expand or contract based on the neighboring widget (default behavior of a widget in a Mobile Web).
Default: false
If set to false, the widget occupies the preferred height. The preferred height of a widget is the sum of its
contents height, padding and margin.
If set to true, the widget ensures that the entire width available to it, is occupied.
Syntax
JavaScript: vExpand
Lua: vexpand
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.2.8 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Horizontal alignment attributes are only applicable if hExpand is false. Similarly vertical alignment attributes
are only applicable if vExpand is false.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_TOP_LEFT
l WIDGET_ALIGN_TOP_CENTER
l WIDGET_ALIGN_TOP_RIGHT
l WIDGET_ALIGN_MIDDLE_LEFT
l WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l WindowsTablet
l Windows Phone
39.3.1 accessMode
Default:CAMERA_IMAGE_ACCESS_MODE_PRIVATE
JavaScript: accessMode
Lua: accessmode
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l Windows Tablet
l Windows Phone
39.4.1 onCapture
An event callback is invoked when the user captures the signature and clicks on a button or image where the
save method is called.
Signature
JavaScript: onCapture
Lua: oncapture
Read / Write
JavaScript Example
//The below function is the callback for onCapture event of the SignatureC
apture widget.
function onCapturCalBck(SignatureCapture)
{
//Write logic here
}
Yes
Platform Availability
l Windows Tablet
l Windows Phone 8
l clear
l save
39.5.1 clear
This method enables you to clear the area where a signature is captured.
Signature
JavaScript: clear()
Lua:signaturecapture.clear(signaturecatureId)
Input Parameters
signaturecatureId[widgetref] - Mandatory
Handle to the widget instance.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
l Windows Tablet
l Windows Phone
39.5.2 save
Saves the signature as an image and executes onCapture callback. You can access the saved image through
rawBytes property. This property is also used to assign image to Image or Button widget as background
image.
Signature
JavaScript: save ()
Lua:signaturecapture.save(signaturecatureId)
Input Parameters
signaturecatureId[widgetref] - Mandatory
Handle to the widget instance.
Return Values
None
JavaScript Example
Error Codes
None
Platform Availability
l Windows Tablet
l Windows Phone
40. Video
Video widget enables you to play a video (by streaming data from a server) within a form. You can add a video
widget only within a container widget.
Note: This widget is currently supported only on SPA and Desktop Web platforms.
l To play a video which may provide an explanation about the contents of the form.
l To play an advertisement within the form.
l To play a video which provides product features.
Note: The configuration properties should be passed only in the respective configuration objects otherwise
they are ignored.
JavaScript Example
Platform Appearance
BlackBerry (SPA/Mobile
Web Advanced)
1. From the IDE, drag and drop the Video widget onto a Container widget.
2. Double-click Video widget and locate source property from the Edit Properties window.
3. Specify the source URL from which the video will be streamed.
4. (Optional) You can specify a poster which is to be displayed within the video widget area before a video
starts playing.
Customizing Appearance
You can customize the appearance of a Video by using the following properties:
padding: Defines the space between the content of the widget and the widget boundaries.
Important Considerations:
l When the form contains dockable components such as headers, footers, or an Appmenu, scrolling the
video widget on iPhone or iPad does not scroll the form. This is due to a limitation that iPhone video
controls do not respond to (custom) touch events when media controls are present.To avoid this, apply
left or right margins to the either side of the video widget to enable scrolling of the form as well.
l If you have two videos in a form, you can only play one at a time.
Supported devices and video formats for SPA platform.
Video XHTML
Format Mandatory
Category and
OS Browser (WebM, Attributes Comments
Device
OGG, MP4, Height/Wi
OGV) dth
BB Non Touch - Native BB Video tag doesn't render without
BB 6 MP4 Supported
BlackBerry 9780 bold Browser XHTML attributes
BB 7.0 (touch) -
Native BB
BlackBerry 9900 Bold BB 7 MP4 na
and BlackBerry 9860
Browser
BB 6.0 (touch) -
Native BB not
BlackBerry 9800 BB 6 na
Torch
Browser supported
Windows Phone
not
Mango - Dell Venue Win 7.5 IE9 na
Pro
supported
Native
Samsung Galaxy S2 - Android
Android MP4 na
amsung I9100 2.3.3
Webkit
Native
Samsung Galaxy S2 - Android
Android MP4 na
amsung I9100 4.0.4
Webkit
Native
Samsung Galaxy S2 - Android
Android MP4 na
amsung I9100 4.0.4
Webkit
iPhone - iPhone iOS 4.2.1 Safari MP4 na
iPhone - iPhone iOS 6.1.3 Safari MP4 na
Windows Phone 8 -
Windows Phone 8 OS8 IE10 MP4 na
(Nokia)
Refer to the below links for supported video formats on Desktop Web platform:
http://caniuse.com/#search=video
http://www.w3schools.com/tags/att_video_poster.asp
l id
l isVisible
l skin
l source
l text
40.1.1 id
id is a unique identifier of Video consisting of alpha numeric characters. Every Video should have a unique id
within an Form.
Note: This is a Construct-only property. You cannot set this property through a widget constructor. But
you can always read and write data to it.
Syntax
JavaScript: id
Lua: id
Type
Read / Write
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.1.2 isVisible
This property controls the visibility of the Video widget on the form.
Default: true
Syntax
JavaScript: isVisible
Lua: isvisible
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
JavaScript Example
Note: You can set the visibility of a widget dynamically from code by using the setVisibility method.
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.1.3 skin
Specifies the look and feel of the video when not in focus.
Syntax
JavaScript: skin
Lua: skin
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.1.4 source
Specifies the URLs of the video which are to be streamed. When you click the button next to the source
property, the Video widget source URLs dialog appears. Specify the URL of a video which is saved in three
different formats. The three formats are mp4, webm, ogv. {mp4 : "mp4 URL", web : "webm URL", ogv : "ogv
URL"}.
For example, if you stream a video from a server , the video must be available in all the three formats. You
then specify the URL of these videos in the Video widget source URLs dialog.
Note: It is mandatory to specify the URL for all the three different formats. The device browser plays a
format which is compatible with the underlying Native SDK.
Syntax
JavaScript: source
Lua: source
Type
JavaScript: JSObject
Lua: UserData
Read / Write
JavaScript Example
//Defining the properties for Video with source:{mp4 : "mp4 URL", web : "w
ebm URL", ogv : "ogv URL"}, Here mp4 URL means the URL which will open mp4
video, Similarly webm URL and ogv URL.
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.1.5 text
Syntax
JavaScript: text
Lua: text
Type
JavaScript: String
Lua: String
Read / Write
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
l containerWeight
l margin
l padding
l widgetAlignment
40.2.1 containerWeight
Specifies percentage of width to be allocated by its parent widget. The parent widget space is distributed to its
child widgets based on this weight factor. All its child widgets should sum up to 100% of weight except when
placed in kony.ui.ScrollBox.
Syntax
JavaScript: containerWeight
Lua: containerweight
Type
JavaScript: Number
Lua: Number
Read / Write
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.2.2 margin
Defines the space around a widget. You can use this option to define the left, top, right, and bottom distance
between the widget and the next element. The Array format is [left, top, right, bottom]. For example:
[10,10,10,10].
To define the margin values for a platform, click the ( ) button against the property to open the
Margin screen. Select the checkbox against the platform for which you want to define the margins and enter
the top, left, right, and bottom margin values.
If you want to use the margin values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the margin values to be applied.
The following image illustrates the window to define the margins for platforms:
Syntax
JavaScript: margin
Lua: margin
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.2.3 padding
Defines the space between the content of the widget and the widget boundaries. You can use this option to
define the top, left, right, and bottom distance between the widget content and the widget boundary. The Array
format is [left, top, right, bottom]. For example: [10,10,10,10].
To define the padding values for a platform, click the ( ) button against the property to open the
Padding screen. Select the checkbox against the platform for which you want to define the padding's and
enter the top, left, right, and bottom padding values.
If you want to use the padding values set for a platform across other platforms, you can click the Apply To
button and select the platforms on which you want the padding values to be applied.
Note: Due to Browser restrictions, you cannot apply Padding for a ComboBox, Form and ListBox widgets
on Mobile Web platform.
Note: If no skin is applied to a Button, then Padding is not supported on iPhone. This is due to iOS Safari
browser limitation. If you want the padding to be applied, apply a skin to the button and then apply padding.
The following image illustrates the window to define the padding's for platforms:
Syntax
JavaScript: padding
Lua: padding
Type
Lua: Table
Read / Write
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
40.2.4 widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each of these below options have a
horizontal alignment attribute and a vertical alignment attribute. For example, WIDGET_ALIGN_TOP_LEFT
specifies the vertical alignment as TOP and horizontal alignment as LEFT.
Default: WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_TOP_LEFT
l WIDGET_ALIGN_TOP_CENTER
l WIDGET_ALIGN_TOP_RIGHT
l WIDGET_ALIGN_MIDDLE_LEFT
l WIDGET_ALIGN_CENTER
l WIDGET_ALIGN_MIDDLE_RIGHT
l WIDGET_ALIGN_BOTTOM_LEFT
l WIDGET_ALIGN_BOTTOM_CENTER
l WIDGET_ALIGN_BOTTOM_RIGHT
Syntax
JavaScript: widgetAlignment
Lua: widgetalignment
Type
JavaScript: Number
Lua: Number
Read / Write
No
JavaScript Example
Yes
Platform Availability
l SPA(iPhone/BlackBerry/Android/WindowsNTH)
l Desktop Web
l controls
l poster
40.3.1 controls
Specifies if the default video controls need to be displayed. When this property is set to false, video is
playable by clicking anywhere on the Poster.
Default: True
Syntax
JavaScript: controls
Lua: controls
Type
JavaScript: Boolean
Lua: Boolean
Read / Write
No
JavaScript Example
Yes
Platform Availability
l SPA(Android)
l Desktop Web
40.3.2 poster
You can specify an image which is to be displayed as a poster or as a starting image for the video. The image
location must point to an external URL. For example,
www.kony.com/sites/all/themes/kony/logo.png
Syntax
JavaScript: poster
Lua: poster
Type
JavaScript: String
Lua: String
Read / Write
No
JavaScript Example
Yes
Platform Availability
Every application has features for the users, you can choose to make these features available on every
screen or specific screens of the application (by using the needAppMenu in a form) for easy navigation to
these features.
For example, for a banking mobile application, the application features can include Accounts, Payments,
Transfers, ATM Locations, and Services.
These features can be placed as App Menu as illustrated in the figure below:
Note: On BlackBerry and J2ME platforms, App Menu is also supported on a Popup.
Appmenu provides you with an option to set Common Properties, Platform Specific Properties, and Methods.
Platform Specific
Common Properties Methods
Properties
Skin Needs Separator createAppMenu
Focus Skin Appbar Button Style setCurrentAppMenu
ID Position getCurrentAppMenu
Title setAppMenuFocusByID
Icon addAppMenuItemAt
Render removeAppMenuItemAt
i18n Key setAppMenuBadgeValue
Event getAppMenuBadgeValue
l If you add more than six App Menu items, the menu items beyond the fifth App Menu item are grouped
under the Menu item More (added automatically by the Android platform) and if you select More, the
rest of the Menu items are displayed in a list without any icons (even if the icons are set through code).
This is an Android platform limitation.
l You cannot specify a skin for the App Menu.
BlackBerry Specific Behavior
l A maximum of five App Menu items can displayed on the screen. Even if you provide more than 5
items, it will display 5 items and ignore the rest.
iOS Specific Behavior
l In iOS 7 and iOS 7.1, AppMenu supports only single color. If the color is not specified, then by default
native color ( transparent) is applied to iOS 7 and cyan color is applied to iOS7.1.
l A maximum of five App Menu items can displayed on the screen. If you want to display more than 5
items, follow any of the below steps:
o Create a customizable more controller using KonyForm, which would give you the
appmenu look & feel and navigation perspective.
o Use show/hide app menu items as required.
o You should always show a form in closure execution of app menu item.
l A maximum of four App Menu icons can displayed on the screen followed by an ellipsis. If you click the
ellipsis, the description of the App Menu icons is displayed.
If there are more than four App Menu items, when you click the ellipsis, the text describing the four App
Menu is displayed along with the rest of the App Menu items in a list without icons.
l The text describing the app menu icons are always in a lowercase.
l Only One Color Background style is supported for the App Menu.
l The font color is applied to the App Menu item text and the circle around the App Menu item icon.
l On Mobile Web platforms, if you add more than four App Menu items, the menu items beyond the
fourth App Menu item are grouped under the Menu item More (added automatically by the Mobile Web
platform) and if you select More, all the App Menu items are displayed in a list with the associated
icons.
Note: Only the icons in the list are clickable and not the text.
l For dynamic App Menu (addmenuitem and removemenuitem) to work on Mobile Web, you must have
atleast one App Menu item at the application level from the IDE; otherwise the dynamic App Menu will
not work.
l The behavior of the App Menu in Mobile Web Advanced, Basic, and BJS is not the same. The behavior
of the App Menu for Mobile Web (Advanced, Basic, and BJS) is as follows:
Note: In Mobile Web (Advanced) versions, the App Menu is displayed at the bottom of the screen and is
visible even when you scroll the form.
Note: In Mobile Web (Basic and BJS) platforms, the App Menu is available at the bottom of the form and
you must scroll to the bottom of the form to see the App Menu.
l Skin
l Focus Skin
l ID
l Title
l Icon
l Render
l i18n Key
l Event
41.1.1 Skin
Note: For iPhone and Android, you cannot set a skin for the default App Menu items.
Note: In iOS 7 and iOS 7.1, AppMenu supports only single color. If the color is not specified, then by default
native color ( transparent) is applied to iOS 7 and cyan color is applied to iOS7.1.
Type
String
Read / Write
No
Yes
Note: When you apply a skin for an App Menu item for Kiosk, the menu items overflow outside the emulator
width. The items shown outside the appmenu bar are called the overflow items. When the appmenu
contains more items than can fit into its area, it enables the overflow button. To see the overflow items, the
user can click the overflow button and the items are shown in a pop-up window below the appmenu.
Platform Availability
Specifies the look and feel when there is focus on the App Menu.
Note: For iPhone and Android, you cannot set a focus skin for the default App Menu items.
Type
String
Read / Write
No
Yes
Platform Availability
41.1.3 ID
Yes
Platform Availability
41.1.4 Title
Type
String
Read / Write
No
Yes
Platform Availability
41.1.5 Icon
Type
String
Read / Write
No
Yes
Platform Availability
41.1.6 Render
Specifies if the widget code must be included in the platform when the code is generated.
You can use the Render property to specify the platforms on which the widget will not be available.
By default, the Render property includes all the platforms. You must explicitly clear the check box against the
platforms that you want to exclude.
Unlike the Visible property, the Render property does not include the widget in the code generated for the
excluded platforms and hence the generated code results in an optimized application for the excluded
platforms.
Note: When two widgets are placed side by side in an HBox, and you exclude one widget from code
generation, the widget which is rendered respects its container weight and does not expand.
However, on Mobile Web advanced platform, due to the browser behavior, the widget which is rendered
does not respect the container weight and expands to occupy the available width.
Type
String
Read / Write
No
Yes
Platform Availability
Note: When an application supports more than one locale and you require different text for a different locale,
you have to destroy the form before locale change. Even if the forms are destroyed, the appmenu will remain
in the old locale. To overcome this behavior, you have to re-create the appmenu every time locale is
changed. To recreate the appmenu, use createAppMenu method.
Type
String
Read / Write
No
Yes
Platform Availability
41.1.8 Event
Specifies the event for the App Menu item. For more information, see Kony Studio User Guide.
Note: In BlackBerry platform, if an event is not defined, the App Menu item behaves as Close command.
Yes
Platform Availability
l Needs Separator
l Appbar Button Style
l Position
Specifies if the App Menu must have a separator between the App Menu items. By default, this property is
selected and a separator appears between the App Menu items.
If you do not want the separator for an App Menu item, open the Edit Platform Specific Properties screen and
clear the Needs Separator check box.
Note: This property is applicable only on BlackBerry platform from version 6.0 and above.
The following image illustrates the Edit Platform Specific Properties screen:
The following image illustrates an App Menu with a separator between the App Menu items:
Platform Availability
Specifies the button style for application bar. For example, you can apply a the button style with play button
style or pause button style etc.
Yes
Platform Availability
41.2.3 Position
l BOTTOM_LEFT
l BOTTOM_RIGHT
l TOP_LEFT
l TOP_RIGHT
Accessible from IDE
Yes
Platform Availability
41.3 Methods
The namespace for App Menu is kony.application. It has the following methods associated with it:
l createAppMenu
l setCurrentAppMenu
l getCurrentAppMenu
l setAppMenuFocusByID
l addAppMenuItemAt
l removeAppMenuItemAt
l setAppMenuBadgeValue
l getAppMenuBadgeValue
41.3.1 createAppMenu
This method allows you to create App Menu dynamically through code.
Note: You must set this method in pre-appinit property. You can set this method only once. For more
information about the pre-appint property, see Configuring Project Properties, Application Properties in the
Kony Studio User Guide.
Note: On Android platform, if you add more than six App Menu items, the menu items beyond the fifth App
Menu item are grouped under the Menu item More (added automatically by the Android platform) and if you
select More, the rest of the Menu items are displayed in a list without any icons (even if the icons are set
through code). This is an Android platform limitation.
Note: On Windows Phone, a maximum of four App Menu icons can be displayed on the screen followed by
an ellipsis. If you click the ellipsis, the description of the App Menu icons is displayed.
If there are more than four App Menu items, when you click the ellipsis, the text describing the four App
Menu is displayed along with the rest of the App Menu items in a list without icons.
Signature
Input Parameters
l menuitemImage: The image to be used for the menu item (image will not be displayed on
Blackberry platform).
l menuitemClosure: onclick event to be executed for the menu item.
l menuitemSeparator: (Applicable on Blackberry only) A boolean value to hide/show the
separator below the menu item.Default: true (the separator is shown)
Note: On iOS platform, menuitemId and menuItemClosure are mandatory parameters and the
menuItemClosure should end with form.show() call.
Return Values
None
Exceptions
SkinError - If the skin is not defined with the specified skin identifier.
Error - If the input is invalid type or doesn't follow the structure as expected.
Special Considerations
If the app menu is already created with the identifier passed, a new app menu will be created and the old
app menu will be replaced with the new one.
At least one app menu item is must in the app menu created. App menu with zero number of app menu
items is invalid.
Example
To create an App Menu for a banking application with Accounts and Payments enter the following:
//The below two functions are callback functions for onClickClosure events
for menu items.
function onClickClosure1()
{
//proceed with the logic
}
function onClickClosure2()
{
//proceed with the logic
}
Error Codes
None
Platform Availability
41.3.2 setCurrentAppMenu
This method uses the unique identifier which represents the App Menu and sets it as current app menu. There
can be only one current app menu that can be set any time. If you call this method multiple times, will replace
the current app menu.
Note: For iPhone, this method is one way of showing the form as well as focusing on a specific menu item.
Note: When an appmenu is set as current app menu item, by default the first app menu item of the app
menu is selected and the function associated with the first app menu item gets executed.
Signature
JavaScript: kony.application.setCurrentAppMenu(appMenuId)
Lua: setcurrentappmenu(appMenuId)
Input Parameters
Return Values
None
Exceptions
Error - If the input is invalid type or doesn't follow the structure as expected.
Example
Error Codes
None
Platform Availability
41.3.3 getCurrentAppMenu
This method returns the unique identifier of the current app menu that is set through setCurrentAppMenu.
Signature
JavaScript: kony.application.getCurrentAppMenu ()
Lua: getcurrentappmenu ()
Input Parameters
None
Return Values
This method returns appMenuId as string. Incase of app menu is not set, null is returned.
Exceptions
None
Example
Error Codes
None
Platform Availability
41.3.4 setAppMenuFocusByID
This method takes id (which is set using createAppMenu) instead of index and sets the focus on the menu
item of the current app menu.
Note: While using this method, ensure that the current menu item is in focus before showing the form.
Note: For iOS platform, closure associated with the focus id will get executed along with setting the focus to
the given id.
Signature
JavaScript: kony.application.setAppMenuFocusByID(appMenuitemId)
Lua: setappmenufocusbyid(appMenuitemId)
Input Parameters
Return Values
None
Exceptions
Error - If the input is invalid type or doesn't follow the structure as expected.
Special Considerations
At any given point of time, one of the app menu items in the current app menu is mandatory to be focused
app menu item.
Example
//Set the menu item with the identifier "appmenuitemid2" as the focused me
nu item.
kony.application.setAppMenuFocusByID("appmenuitemid2");
Error Codes
No error codes
Platform Availability
Available on all platforms except on BlackBerry, BlackBerry 10, and on all Windows channels
41.3.5 addAppMenuItemAt
Signature
Input Parameters
Note: On iOS platform, menuitemId and menuItemClosure are mandatory parameters and the
menuItemClosure should end with form.show() call.
Return Values
None
Exceptions
Error - If the input is invalid type or doesn't follow the structure as expected.
Special Considerations
The index value starts from 0. For example, to insert a menu item at the 4th position specify the index
value as 3.
Example
Error Codes
No error codes
Platform Availability
41.3.6 removeAppMenuItemAt
Signature
Input Parameters
Return Values
None
Exceptions
Error - If the input is invalid type or doesn't follow the structure as expected.
Special Considerations
If current focus menu item is removed then the first menu item of the app menu will be focused by default
as its associated function will be selected.
At least one app menu item must be present in the app menu. App menu with zero number of app menu
items is invalid state of the app menu.
Example
Error Codes
No error codes
Platform Availability
41.3.7 setAppMenuBadgeValue
This method allows you to set a badge value to the given app menu item at the upper, right corner of the menu
item. Passing an empty string "" as a parameter, removes the badge off the appmenu item. This method is
applicable only for iPhone. The figure below depicts a badge applied on an appmenu item.
Signature
Input Parameters
Return Values
None
Exceptions
None
Example
Error Codes
No error codes
For more information about the Badge APIs refer the Kony API Reference Document.
Platform Availability
41.3.8 getAppMenuBadgeValue
This method enables you to read the badge value (if any) attached to the given Appmenu item.
Signature
Input Parameters
Return Values
Exceptions
None
Example
For more information about the Badge APIs refer the Kony API Reference Document.
Platform Availability
41.4 Methods
The namespace for App Menu is kony.application. It has the following methods associated with it:
l setAppMenu
l setAppMenuFocusIndex
l showAppMenuItems
l hideAppMenuItems
41.4.1 setAppMenu
This method allows you to create App Menu dynamically through code.
Note: You must set this method in pre-appinit property. You can set this method only once. For more
information about the pre-appint property, see Configuring Project Properties, Application Properties in the
Kony Studio User Guide.
Note: On Android platform, if you add more than six App Menu items, the menu items beyond the fifth App
Menu item are grouped under the Menu item More (added automatically by the Android platform) and if you
select More, the rest of the Menu items are displayed in a list without any icons (even if the icons are set
through code). This is an Android platform limitation.
Note: On Windows Phone, a maximum of four App Menu icons can be displayed on the screen followed by
an ellipsis. If you click the ellipsis, the description of the App Menu icons is displayed.
If there are more than four App Menu items, when you click the ellipsis, the text describing the four App
Menu is displayed along with the rest of the App Menu items in a list without icons.
Input Parameters
Return Values
None
Example
To create an App Menu for a banking application with Accounts and Payments enter the following:
//The below two functions are callback functions for onClickClosure events
for menu items.
function onClickClosure1()
{
//proceed with the logic
}
function onClickClosure2()
{
//proceed with the logic
}
Error Codes
No error codes
Platform Availability
41.4.2 setAppMenuFocusIndex
Specifies the App Menu item on which the focus must be set.
Note: For iPhone, this method is one way of showing the form as well as focusing on a specific menu item.
This method should not be called from any lifecycle event of the form.
Input Parameters
Return Values
None
Example
Error Codes
None
Platform Availability
41.4.3 showAppMenuItems
This method shows only the App Menu items that you specify and hides the rest.
Input Parameters
Return Values
None
Example
//To show only the App Menu items 1 and 2 and hide the others, enter the f
ollowing:
showappmenuitems({"appmenuid1","appmenuid2"})
Error Codes
None
Platform Availability
41.4.4 hideAppMenuItems
This method hides the App Menu items that you specify and shows the rest.
Note: For iPhone, this method should not be called from any lifecycle event of the form.
Input Parameters
Return Values
None
Example
Error Codes
None
Platform Availability
In software application development, 508 Compliance is also referred to as accessibility. For example, people
with impaired vision must be able to use software with the help of touch gestures, that is designed to run on a
system that has a keyboard. The result of performing a function is read out using the screen reading
technology.
The assistive technology (AT) for iPhone and Android platforms has built-in programs that support
accessibility when enabled on devices. Browser-based platforms use the Web Accessibility Initiative -
Accessible Rich Internet Applications (WAI-ARIA) framework. The WAI-ARIA framework enables you to add
attributes to identify features for user interaction, map controls, events, and APIs used in a rich Internet
application.
Note: The screen-reading capabilities of the different assistive technologies may vary and may not produce
the same results.
Navigation Keys
When a device enables assistive technology, visually impaired users typically navigate through the UI
controls such as tab/enter/arrow keys/page up/down keys. On various touch-only devices, a few of these key
actions are mapped to touchscreen finger gestures.
The chart below shows how keyboard-based navigation keys are mapped to gestures on mobile platforms:
Note: A gesture may function differently in different assistive technologies. Refer to the respective
assistive technology documentation for more information on gestures.
iOS Gestures
l Android: https://support.google.com/nexus/answer/2926960?hl=en
l iOS: https://www.apple.com/in/accessibility/osx/voiceover/
l SPA and Desktop Web: http://www.w3.org/WAI/mobile/
The built-in assistive technology in the iOS and Android platforms reads some basic widgets of Kony Studio,
such as Button, Label, and TextBox. The assistive technology in iOS and Android platforms read the
information differently on other widgets.
Every application that is created using Kony Studio is accessible to iOS and Android platforms built-in
assistive technology. The way the assistive technology interprets the widget information is left to its individual
capability. Developers can enhance the behavior of assistive technology with the configuration property
(explained in the next page) available for each accessibility supported widget.
The general navigation model is for a user to tab/swipe to reach a widget, interact with the control in that
widget, and then tab/swipe to move focus to the next widget in the tab order. When a container widget
contains a widget, the tab/swipe gesture brings the focus to the container widget because it is the next item in
the tab order. This continues down the layers of widgets until the last widget is reached. For example, we
have two widgets ' HBox ' and ' Button ' on a page. The widget ' HBox ' contains a ' VBox ' widget. Within the '
VBox ' widget there is a ' Label ' widget.
While tabbing, the focus lands on HBox, then another tab will move the focus to VBox, and then another tab
will move the focus to Label. This is because Label is the last widget in VBox focus will not come directly to
the Label. One more tab will move the focus to Button. The order in which the focus is passed from one widget
to another widget is based on the nearest neighboring widget in a given direction.
Note: Some operating systems allow you to change the systems and enlarge all text displayed on the
screen.
1. From Kony Studio, drag a widget where you want it. For example, a Button widget.
2. Select the Button widget and locate the accessibilityConfig property from the Properties Window.
3. Click the Ellipsis ( ) button against the property. The Accessibility Config window appears.
l a11yLabel: Specifies an alternate text to identify the widget. Generally the label should be the
text that is displayed on the screen.
l a11yValue: Specifies the current state/value associated with the widget so that the user can
perform an action. For example, a checkbox is in selected state or unselected state.
l a11yHint: Specifies the descriptive text that explains the action about the widget.
l a11yHidden: Specifies if the widget must be ignored by assistive technology.
The property accessibilityConfig enables you to specify the accessibility configuration property for a widget.
Following are the predefined keys:
Note: On the Android platform, the text specified for a11yLabel is prefixed to the
a11yValue.
Note: On the Android platform, the text specified for a11yValue is prefixed to
the a11yHint.
Note: This option is supported on iOS 5.0 and above, Android 4.1 and above,
and SPA.
Limitations
Android:
l If the results of the concatenation of a11y fields result in an empty string, then the accessibilityConfig
is ignored and the text that is on widget is read out.
l The soft keypad does not gain accessibility focus with right/left swipe gesture when the keypad
appears.
SPA: The a11y fields are mapped to the ARIA tags. The results may vary among browsers because not
all browsers recognize all the ARIA tags.
Read / Write
JavaScript Example
Platform Availability
l iOS
l Android
l SPA (iPhone and Android)
then the assistive technology in the respective platforms will read as follows:
Note: In the above snapshot the highlighted text is role, generated by native platforms. The iPhone
appended the text button to the value, and Android appended the text button to the hint automatically. Kony
Studio has no control on this behavior. Developers should test the text that is provided for
accessibilityConfig.
l Form
l HBox
l VBox
l ScrollBox
l Popup
42.3.1 Form
l Tab key or equivalent touch gesture moves the focus to the first
focusable child widget of the form.
l Multiple tabs move the focus to the interactive child widgets of the
Keyboard/Gesture-based form.
Interactions l The title of the form is accessible in the platforms that support native
form widget titleBar property using the tab key or equivalent touch
gesture along tab order.
iOS:
l When the VoiceOver focus reaches the bottom of the form, it does not
cycle to the top of the form again, with a right swipe gesture. Similarly,
with a left swipe gesture, the focus does not cycle to the bottom of the
form when you have reached the top of the form.
l The iOS VoiceOver, focus the first accessible widget available on the
form.
Android:
SPA:
42.3.2 HBox
l Tab key or equivalent touch gesture moves the focus along the tab
order when:
a. Box is clickable
iOS:
l If the accessibilityConfig is set for an HBox, then the focus never goes
to its child widgets and other widgets within the HBox are not
accessible to the user.
Android: None
SPA:
Limitations
l SPA-iPhone: If the accessibilityConfig is set for an HBox, then the
focus never goes to its child widgets, and other widgets within the
HBox are not accessible to the user.
l SPA-Android: If the accessibilityConfig is set for an HBox, then
widgets within the HBox are not accessible to the user with a swipe
gesture. But when touched explicitly the widgets gain focus. The
option a11yHint is not supported.
42.3.3 VBox
l Tab key or equivalent touch gesture moves the focus along the tab
order when:
a. Box is clickable.
iOS:
l If the accessibilityConfig is set for a VBox, then the focus never goes
to its child widgets and other widgets within the VBox.
Android: None
SPA:
42.3.4 ScrollBox
l Tab key or equivalent touch gesture moves the focus along the tab
order when accessibilityConfig is defined.
Keyboard/Gesture based l Multiple tabs or navigation keys help in navigating focus to the child
Interactions widgets that are actionable.
l Page Up / Page Down or equivalent key/gesture allows you to scroll
the content of the ScrollBox.
iOS:
42.3.5 Popup
l Tab key or equivalent touch gesture moves the focus to the first
Keyboard/Gesture based focusable child widget of the Popup.
Interactions l Multiple tabs move the focus to the interactive child widgets of the
Popup.
l The a11yLabel overrides the text of the title property.
l The a11yValue, a11yHint, and a11yHidden fields are not applicable to
Default Behavior Popup and are ignored.
l accessibilityConfig property is supported in iPhone, Android, and SPA-
iPhone platforms.
iOS:
l When the VoiceOver focus reaches the bottom of the Popup, it does
not cycle to the top of the Popup again, with a right swipe gesture.
Similarly with a left swipe gesture, the focus does not cycle to the
bottom of the Popup when you have reached the top of the Popup.
Android:
SPA:
l Button
l Calendar
l CheckBox
l ComboBox
l Image
l Label
l Line
l Link
l ListBox
l RadioButton
l RichText
l Slider
l TextArea
l TextBox
42.4.1 Button
iOS: None
Android: None
SPA:
Limitations
l SPA-iPhone: None
l SPA-Android: The option a11yHint is not supported.
42.4.2 Calendar
A Calendar widget accepts dates from the user. Following are the view types
that support accessibility in respective platforms:
42.4.3 CheckBox
l Accessible by the tab key or equivalent touch gesture along tab order.
l Multiple tabs or navigation keys help in navigating the focus to each
Keyboard/Gesture based check button in the group.
Interactions
l With a focus on the CheckBox, press the Spacebar or Enter key or
equivalent gesture to change the selection state of the focused check
button.
iOS: Following are the limitations of iOS platform based on the selected
viewType:
viewType accessibilityConfig
Items within
Widget Level
widget
CHECKBOX_VIEW_TYPE_LISTVIEW Respected Ignored *
CHECKBOX_VIEW_TYPE_TOGGLEVIEW Ignored Respected
CHECKBOX_VIEW_TYPE_
Ignored Ignored
ONSCREENWHEEL
CHECKBOX_VIEW_TYPE_TABLEVIEW Ignored Respected
Android: None
SPA:
42.4.4 ComboBox
iOS: Following are the limitations of iOS platform based on the selected
viewType:
viewType accessibilityConfig
Items Within
Widget Level
Widget
COMBOBOX_VIEW_TYPE_LISTVIEW Respected Ignored *
COMBOBOX_VIEW_TYPE_TABLEVIEW Ignored Respected
COMBOBOX_VIEW_TYPE_TOGGLEVIEW Ignored Respected
COMBOBOX_VIEW_TYPE_
Ignored Ignored
ONSCREENWHEEL
SPA:
42.4.5 Image
Keyboard/Gesture based
Tab key or equivalent touch gesture along tab order.
Interactions
On all platforms, except SPA, if the accessibility is not configured, the image
widget is not accessible to the user.
Limitations
SPA-Android: The option a11yHint is not supported.
42.4.6 Label
iOS: None
Android: None
SPA:
Limitations
l SPA-iPhone: accessibilityConfig property is not supported.
l SPA-Android:The option a11yHint is not supported
42.4.7 Line
Keyboard/Gesture based
Not accessible by the tab key or equivalent touch gesture.
Interactions
Limitations None
42.4.8 Link
l With a focus on the link, press the Spacebar or Enter key or equivalent
gesture action to select the link.
Keyboard/Gesture based
Interactions l Single finger double tap to execute the action.
l Tab key or equivalent touch gesture along tab order.
iOS: None
Android: None
SPA:
Limitations
l SPA-iPhone: None
l SPA-Android: The option a11yHint is not supported.
42.4.9 ListBox
l Accessible by the tab key or equivalent touch gesture along tab order.
l With a focus on the ListBox, press the Spacebar or Enter key or
equivalent gesture to open the drop-down list.
Keyboard/Gesture based
Interactions l With drop-down list in an expanded state, press the Spacebar or Enter
key or equivalent gesture to select the focused item.
l Multiple tabs or navigation keys help in navigating the focus to each
item in the ListBox.
iOS: Following are the limitations of iOS platform based on the selected
viewType:
viewType accessibilityConfig
Items Within
Widget Level
Widget
LISTBOX_VIEW_TYPE_LISTVIEW Supported Ignored *
LISTBOX_VIEW_TYPE_TABLEVIEW Ignored Supported
LISTBOX_VIEW_TYPE_TOGGLEVIEW Ignored Supported
LISTBOX_VIEW_TYPE_
Ignored Ignored
ONSCREENWHEEL
SPA:
42.4.10 RadioButton
l Accessible by the tab key or equivalent touch gesture along tab order.
l With a focus on the RadioButton, press the Spacebar or Enter key or
Keyboard/Gesture based
equivalent gesture to change the selection state of the focused item.
Interactions
l Multiple tabs or navigation keys help in navigating the focus to each
item in the RadioButton.
iOS: Following are the limitations of the iOS platform based on the selected
viewType:
viewType accessibilityConfig
Items Within
Widget Level
Widget
RADIOGROUP_VIEW_TYPE_LISTVIEW Supported Ignored *
RADIOGROUP_VIEW_TYPE_
Ignored Supported
TABLEVIEW
RADIOGROUP_VIEW_TYPE_
Ignored Supported
TOGGLEVIEW
RADIOGROUP_VIEW_TYPE_
Ignored Ignored
ONSCREENWHEEL
Limitations * accessibilityConfig is ignored when set through masterData or
masterDataMap to the items within the widget that pops up as pickerview
from the bottom is ignored.
Android: None
SPA:
42.4.11 RichText
Keyboard/Gesture based
Accessible by the tab key or equivalent touch gesture along tab order.
Interactions
42.4.12 Slider
l Accessible by the tab key or equivalent touch gesture along tab order.
Keyboard/Gesture based l With a focus on the Slider, press the Right / Up key or equivalent
Interactions gesture to increase the value of the slider. Press the Left / Down key or
equivalent gesture to decrease the value of the slider.
Android: Android OS cannot change the slider value when accessibility is set.
SPA:
42.4.13 TextArea
iOS: None
Limitations SPA:
l SPA-iPhone: None
l SPA-Android: The option a11yHint is not supported.
42.4.14 TextBox
iOS: None
Limitations SPA:
l SPA-iPhone: None
l SPA-Android: The option a11yHint is not supported.
l Alert
l Camera
l Hz Image Strip
l PickerView
l SegmentedUI
l Switch
42.5.1 Alert
Limitations On all platforms, the buttons within the Alert dialog are not configurable.
42.5.2 Camera
If the entire image strip widget is not focused as a whole, then the
accessibilityConfig is not respected in any of the platform. The
accessibilityConfig is supported only when the viewType is set to
HORIZONTAL_IMAGESTRIP_VIEW_TYPE_STRIPVIEW.
Android: In Android OS versions less than 4.2, Horizontal Image Strip does
not scroll though it has content to scroll. It depends on the capability of the
built-in accessibility service. You must enable an option in Android OS
Limitations versions greater than equal to 4.2 in system accessibility settings to auto
scroll the content on swipe gesture. You will observe similar behavior with
native applications as well.
SPA:
42.5.4 PickerView
Android: In Android OS versions less than 4.2, SegmentedUI does not scroll
though it has content to scroll. It depends on the capability of the built-in
Limitations
accessibility service. You must enable an option in Android OS versions
greater than equal to 4.2 in system accessibility settings to auto-scroll the
content on a swipe gesture. You will observe similar behavior with native
applications as well.
Example code sample code
Android: In Android OS versions less than 4.2, SegmentedUI does not scroll
though it has content to scroll. You must enable an option in Android OS
versions 4.2 and above system accessibility settings to auto-scroll the
content on a swipe gesture. You will observe similar behavior with native
applications.
Limitations SPA:
Android: In Android OS versions less than 4.2, SegmentedUI does not scroll
though it has content to scroll. It depends on the capability of the built-in
accessibility service. You must enable an option in Android OS versions 4.2
and above, in system accessibility settings to auto-scroll the content on a
swipe gesture. You will observe similar behavior with native applications as
well.
Limitations
SPA: The event onRowClick is fired when any child widget is explicitly
selected or clicked.
42.5.7 Switch
l Accessible by the tab key or equivalent touch gesture along tab order.
Keyboard/Gesture based
Interactions l With a focus on the Switch, press the Enter key or Spacebar or
equivalent gesture to toggle the state and initiate the action.
SPA:
Limitations
l SPA-iPhone: None
l SPA-Android: The option a11yHint is not supported.
42.7.1 SPA
1. Scrolling a form and SegmentedUI through a swipe with three fingers and tab gestures (custom scroll)
is not supported in SPA platform.
2. When a Popup is loaded, the default focus goes to the form on which the Popup is loaded, and then it
comes to Popup.
3. A Label widget without any text is not focusable with tab gestures.
4. When a form is loaded, the default focus can be any where in the form.
5. For the widgets such as ScrollBox, Horizontal Image Strip, Slider, and Segment (PAGEVIEW), a
swipe or tab gesture will not bring the focused item into a view area.
6. On the SPA Android platform, accessibiltiyConfig for form and Popup is not supported.
7. On the SPA Android platform, before loading a form, some random text is read by assistive technology.
The random text is read from the script tag that may be present in JavaScript.
8. For container widgets, if only a11yHint is configured, then accessibility first reads the text of the child
widgets and then a11yHint text that is configured for a container widget.
Note: Widget level animation is supported only in iOS (version 5.0 and above) and Android (version 3.0 and
above) platforms only.
Animation feature allows you to animate widgets on a Form, HBox, VBox to add a widget, remove a widget,
replace a widget with other widget, and set the visibility of a widget with animation. Following are the widgets
in which the animations are supported using the respective methods:
l addAt: This method is used to add widgets to the container at the specified index.
l removeAt: This method removes a widget at the given index from the container.
l replaceAt: This method replaces a widget with another widget in the container.
l setVisibility: This method is used to set the visibility of the widget.
l layoutAnimConfig: This property is used to configure the layout changes that occur due to the
animations applied/removed on other widgets.
The above methods except layoutAnimConfig property are documented in methods sections of the respective
widgets.
l animEffect
l animDuration
l animDelay
l animCurve
l animCallBacks
l Form
l HBox
l VBox
l Button
l Label
l Image
l Calendar
l SegmentedUI
The signature and properties of the layoutAnimConfig property are as follows:
Signature
layoutAnimConfig (JSObject)
animEffect - Optional
Specifies the animation effect. Following are the available options of animation effect:
Note: Using any constants other than the ones explained above may
lead to undefined behavior.
animDuration - Optional
Specifies the duration of the animation effect in seconds. The default value is 1 second. The
negative values are ignored and defaulted to 1 second.
animDelay - Optional
Specifies the delay of the animation effect in seconds. The default value is 0 second. The
negative values are ignored and defaulted to 0 second.
animCurve - Optional
Specifies the animation curve to be applied while playing the animation. An animation curve
defines the speed of the animations at different intervals of the animation duration. Following are
the available options of animation curve:
animCallBacks - Optional
It is a JS dictionary containing the events invoked by the platform during the animation life
cycle. Following are the available events:
function animStarted()
function animEnded()
Note: Passing an invalid type other than the above events lead to run time
exceptions/ crashes.
JavaScript Example
}
formObj.layoutAnimConfig = withAnimConfig3;
If the layoutAnimConfig is not configured for the above widgets, will get inherited from the parent widget. If the
parent widget also not configured then the search continues through parent hierarchy until layoutAnimConfig
is found that can be used or Form widget is reached in the heirarchy.
If the layoutAnimConfig is not configured at the widget or cannot be inherited from the parent hierarchy then
layout changes will be animated with the below defaults:
l Animation callbacks are expected to be light weight and avoid calling heavy end operations such as
network calls, SQL Lite, etc.
l Animations are played only on the form to which the widget belongs are rendered and currently
displayed on the form. Invoking animations on a widget whose form is not yet shown/rendered doesn't
reflect the animations.
l Touching a widget, when an animation is in progress may lead to undefined behavior.
l The animation effect constants.ANIMATION_PLATFORM_DEFAULT is not respected when used in
animation configuration while invoking an operation.
l Layout animation configuration specified is not respected by Android. By default Android always plays
the default animations native to android for all other widgets, which go through animation due to an
operation on a widget.
l Animations that child widgets go through (due to layout animation configuration) are undefined when an
operation such as addAt, removeAt, and replaceAt are invoked with an animation configuration on a
parent widget. For proper animations:
l You must add parent widget and then child widget with animation.
l If you remove some widgets, then remove the child widgets first with animation and then the
parent widget.
l If you replace a widget using replaceAt method, do not make layoutAnimConfig applicable for
the new widget to avoid unwanted animations.
l Animation behavior when the properties of widgets in the same closure where an operation on a widget
is invoked with an animation:
l If properties of the same widget (on which operation is invoked) are modified even these
property changes also go through animation configuration specified while invoking the
operation. It is one animation where the operation will be animated along with the property
changes.
l If properties of different widgets (widgets other than the one on which operation is invoked) are
modified then these property changes go through animation configuration specified in layout
animation configuration.
l When there is no change in the state of the widget or parent widget after cumulative set of operations in
the closure, then the animations are not played including callbacks. For example, when a widget is
removed and added in the same closure with animation at the same location in the widget hierarchy,
then there is no change in the widgets, hence the widget will not go through any animation.
Note: In Android platform, you may observe intermittent animations for a fraction of second including
the callbacks for each of the operations invoked with animation in the closure.
This chapter describes the behavior of container and component widgets when different properties of the
widget are enabled or disabled.
l The width allocated to the child widget is dependent on the percentage allocated size
(container weight) of the widget.
l The actual width occupied by the widget is determined by the content of the widget
and the Expand horizontal property.
If percent property is false, the HBox exhibits the following width characteristics:
l If an HBox contains multiple child widgets with varying heights, the height of the
child widget with the maximum height is set as the height of the HBox.
l If a background image is specified (as part of the normal skin) for the HBox, and if
the height of the child widgets is lesser than the height of the background image, the
height of the HBox will be the height of the image.
Create an HBox with a width of 200 px and add five buttons (Button1, Button2, Button3, Button4, and
Button5) with container weights of 20 each. Depending upon the properties set for the HBox
(containerWeight) and for the individual buttons (Expand horizontal and vertical), the layout varies.
Properties
Set the following property values for the HBox, Button1, Button2, Button3, Button4, and Button5:
HBox:
Button1:
hExpand: false
vExpand: false
Button2:
hExpand: true
vExpand: false
Button3:
hExpand: false
vExpand: true
Button4:
Button5:
hExpand: false
vExpand: true
Layout
Explanation:
Button1
Width: The width occupied is 20 px (preferred width) and not 40 px (allocated width) as the
hExpand property is set to false and horizontal expansion is not allowed.
Height: The height occupied is 40 px (preferred height) and not 80 px (height of the HBox) as the
vExpand property is set to false and vertical expansion is not possible.
Button2
Width: The width occupied is 40 px (allocated width) and not 20 px (preferred width) as the
hExpand property is set to true and horizontal expansion is allowed.
Height: The height occupied is 40 px (preferred height) and not that of the HBox (80 px) as the
vExpand property is set to false and vertical expansion is not possible.
Note: Button2 does not begin immediately after Button1. This is because the Use Widget Size %
property of the HBox is set to true.
Button3
Width: The width occupied is 20 px (preferred width) and not 40 px (allocated width) as the
hExpand property is set to false and horizontal expansion is not allowed.
Height: The height occupied is 80 px (HBox height) and not 40 px (preferred height) as the
vExpand property is set to true and vertical expansion is possible.
Button4
Width: The width occupied is 40 px (allocated width) and not 20 px (preferred width) as hExpand
property is set to true and horizontal expansion is allowed.
Height: The height occupied is 80 px (HBox height) and not 40 px (preferred height) as vExpand
property is set to true and vertical expansion is possible.
Button5
Width: The width occupied is 40 px (allocated width) and not 60 px (preferred width) even
though the hExpand property is set to false.
This is because when the required width is more than the allocated width, the widget always
occupies the complete allocated width irrespective of the Expand property setting and wraps the
text to the next line.
HBox
If there are multiple child widgets with varying heights, the height of the child widget with the
maximum height is set as the height for the HBox.
Here, Button5 has the maximum height. So, the height of Button5 is set as the height of the
HBox.
Create an HBox with a width 100 px and add two widgets (Label1and Button1) with container weights of
50 and 50 respectively, the following use cases are applicable:
Use Case 1
Set the following property values for the HBox, Label1, and Button1:
HBox:
Label1
hExpand: true
vExpand: true
Text to be displayed: Large text (enter any text which wraps to four lines)
Button1:
hExpand: false
vExpand: false
Text to be displayed: Hi
Layout
Explanation
The height of the HBox is the height of the child widget with the maximum height. Here Label1 has the
maximum height, and so, the height of Label1 is set as the height of the HBox.
This means that the width and height available to Button1 are 50 px and 80 px respectively.
However, as the Expand horizontal and vertical properties for Button1 are false, Button1 occupies a
width of 20 px (preferred width) and a height of 30 px (preferred height) respectively. This gives an
opportunity for Button1 to be aligned in the directions specified by the layoutAlignment property.
Use Case 2
Set the following property values for the HBox, Label1, and Button1:
HBox:
Label1
hExpand: true
vExpand: true
Text to be displayed: Large text (enter any text which wraps to four lines)
Button1:
hExpand: true
vExpand: false
Text to be displayed: Hi
Layout
Explanation
The height of the HBox is the height of the child widget with the maximum height. Here, Label1 has the
maximum height, and so, the height of Label1 is set as the height of the HBox.
This means that the width and height available for Button1 are 50 px and 80 px respectively.
For Button1, as the Expand horizontal property is set to true, it occupies a width of 50 px (allocated
width).
As the Expand vertical property is set to false, Button1 occupies a height of 30 px (preferred height).
Hence alignment is possible only in the vertical direction.
Use Case 3
Set the following property values for HBox, Label1, and Button1:
HBox:
Label1
hExpand: true
vExpand: true
Text to be displayed: Large text (enter any text which wraps to four lines)
Button1:
hExpand: false
vExpand: true
Text to be displayed: Hi
Layout
Explanation
The height of the HBox is the height of the child widget with the maximum height. Here, Label1 has the
maximum height, and so, the height of Label1 is set as the height of the HBox.
This means that the width and height available for Button1 are 50 px and 80 px respectively.
For Button1, as the Expand vertical property is set to true, it occupies the entire available height of 80 px
and not 30 px (preferred height). Hence the alignment is possible only in the horizontal direction.
Use Case 4
Set the following property values for the HBox, Label1, and Button1:
HBox:
Label1
hExpand: true
vExpand: true
Text to be displayed: Large text (enter any text which wraps to four lines)
Button1:
hExpand: true
vExpand: true
Text to be displayed: Hi
Layout
Explanation
The height of the HBox is the height of the child widget with the maximum height. Here Label1 has the
maximum height, and so, the height of Label1 is set as the height of the HBox.
This means that the width and height available for Button1 are 50 px and 80 px respectively.
However, as the Expand horizontal and vertical properties for Button1 are true, Button1 occupies the
complete available width and height and cannot be aligned in any direction.
44.2.1 Scenario 1
Create a VBox of width 100 px and add two buttons (Button1 and Button2) with container weights of 50 and
50 respectively, consider the following cases:
Use Case 1
Set the following property values for the VBox and Button1:
VBox:
Button1:
Layout
Explanation:
For Button1, as the Expand horizontal property is set to false, it occupies a width of 40 px (preferred
width) and not 100 px (allocated width), and occupies a height of 30 px (preferred height). However,
Button1 can be aligned in the left, center, and right direction of the allocated space.
Use Case 2
Set the following property values for the VBox and Button1:
VBox:
Button1:
Layout
Behavior:
Button1 occupies the allocated width (100 px) and the height is the preferred height (30 px).
Explanation:
As the Expand horizontal property is set to true, the widget occupies a width of 100 px (allocated width)
and not 40 px (preferred width) because the horizontal expansion is allowed.
Use Case 3
Set the following property values for the VBox and Button1:
VBox:
Button1:
Width required to display the text 'Good Morning World' (preferred width): 120 px
Height required to display the text 'Good Morning World' (preferred height): 40 px
Layout
Behavior:
Button2 occupies the allocated width (100 px) and wraps the text to the next line and has an height of 80
px.
Reason
When the required width is more than the allocated width, the widget always occupies the complete
allocated width irrespective of the Expand property setting and wraps the text to the next line.
Here, Button1 occupies a width of 100 px (allocated width). and wraps the text to the next line, and has
an height of 80 px.
As the height of the VBox is dependent on the content, and in this use case, the text is wrapped to the
next line, this results in a corresponding increase in height.
1. ComboBox and ListBox, skin styles "Transparent" and "One Color" are supported in background color
tab.
2. ComboBox and ListBox, browser does not support if the properties defined in font tab and border are
different for skin and focusSkin.
3. On Firefox browser, TextBox and TextArea widgets does not support percentage (%) based padding,
while other browsers does support.
4. For all widgets in Internet Explorer 7 and 8, transparency ( border/font) is not supported for skin.
5. On safari browser, ListBox and ComboBox widgets does not support padding.
6. Rounded Corners will not work for all widgets in Internet Explorer 8 because of border-radius property
is not supported in Internet Explorer 8 and its lower versions.
7. Vertical split and Horizontal split will not work for all widgets in Internet Explorer 9 and its lower
versions.
8. For non-modal popups (isModal = false), popup transparency (transparencyBehindThePopup) property
is not applied as the background widgets are accessible to the user.
9. A valid calendar year selection range is from 1900 to 2099. If you select an year beyond the range
shows an alert message (you can customize this error message).
10. In Internet Explorer 8 and below browsers do not support all geolocation APIs.
11. focusSkin applied to the container widgets ( like HBox, VBox, Segment ) is not inherited by the inner
widgets in IE browsers (IE8, IE9, IE10). To overcome this apply focusSkin at every widget inside the
container widget.
12. For ScrollBox and TabPane widgets, angle background Multi Step Gradient is not supported.
13. Desktop Web platform does not support browser (Internet Explorer 8 ) running in compatibility mode.
14. Vertical gradient and Horizontal gradient are supported for all widgets in Internet Explorer 8 and above
versions.
15. Preview of map widget is not supported.
16. On Internet Explorer browsers, focusSkin applied to the widgets CheckBox and RadioButton will work
on click of text, but not on icon.
17. For Browser widget, Desktop Web platform supports BROWSER_REQUEST_METHOD_GET option
only.
18. Video widget in print API is not supported in Firefox browser.
19. To apply focusSkin for dynamically created widgets, assign focsuSkin dynamically after creating the
widget.
formid.widgetid.focusSkin = "skinname";
20. To apply hoverSkin for dynamically created widgets, assign hoverSkin dynamically after creating the
widget.
formid.widgetid.hoverSkin = "skinname";
widget.
formid.widgetid.focusSkin = "skinname";
1. The widgets ObjectSelector3D, Phone, PickerView, Switch, MenuItem and Video are not supported.
2. As of today (10th, July 2013) Windows 7 Kiosk applications run only on Windows 8 PRO and not on
Windows 8 RT.
3. The application icon that is set from Application Properties > Common > Desktop icon size should be
multiple of 8 pixel and less than 256 pixel. For example, the icon image should be of size 8x8 or 16x16
px, it should be not 16x17 px.
45.4 BlackBerry 10
This section lists the limitations and properties that are not supported by BlackBerry 10 platform.
l PickerView
l TabPane
2. Gradient skins are not supported on any widgets.
3. The BlackBerry 10 supports application version only if the format is specified as x.x.x (For example,
2.3.6). The Build generation fails if you specify any other version format.
4. Only three options (WIDGET_ALIGN_TOP_LEFT, WIDGET_ALIGN_CENTER, and WIDGET_
ALIGN_BOTTOM_RIGHT) of the widgetAlignment is supported by respective widgets.
5. The layout property hExpand is always true for respective widgets and there is no effect when you set
as false.
6. You application crashes- when an event is invoked dynamically by assigning a JSObject except on
Button, SegmentedUI, HBox, and VBox. For example, the below code will not work.
7. In calendar widget, if you use the method setenabled, the date gets cleared and validStartDate is
displayed. If validStartDate is not set then current date is displayed.
8. The property focusSkin is not supported for TextBox widget.
9. The font style with underline is not supported for TextBox widget.
10. Skin font style with underline is supported only for widgets RichText and Link.
11. All BlackBerry 10 supported widget events are not writable.
a. From Kony Studio, you must set the permission for access_location_service as true. To set
access_location_service, navigate to Application Properties > Native > BlackBerry10, select
access_location_services and click Add > and then click Finish.
b. Your device location service setting must be on. To set device location service in your device,
navigate to Device Settings > Location Services > turn on the location services.
c. BlackBerry Native maps are supported, but map key and provider not applicable.
d. The Map widget is available in the United States and Canada regions. It will not work in Asia
Pacific region.
e. The Map widget works with BlackBerry 10 OS version 10.0.9.2709 and above.
f. If the network is slow, then rendering of the map is not smooth. The fonts and the user interface
(UI) may be affected.
g. For devices earlier than 10.1, a developer- specified or custom pin image is not displayed. Only
BlackBerry 10 provided images can be displayed.
h. Rendering of Map may takes 2 to 3 minutes or sometimes more than 5 minutes depending on
your network.
i. Templates for Map widget are not supported.
j. The default pin is always shown by the BlackBerry 10 device.
k. When a Map is loading you cannot display any alert messages as "Map is loading".
l. Your application may crash when you perform any action while loading a map.
m. Zoom level is decided by altitude. Hence user has to provide zoom level in terms of 1000. The
default zoomlevel is 10000.
n. Events associated with respective widgets are not writable.
a. By default the itemOrientation of a CheckBox widget is set to vertical. Unlike other platforms,
the BlackBerry 10 platform does not support the horizontal orientation.
b. When you define a skin for normal skin or focus skin, the options font style, font size, font color
are applied to the text of the CheckBox. They are not applicable to CheckBox image.
a. Word Wrapping and Padding properties are not supported for Native button. Image button
supports Word Wrapping.
b. Rounded corner for borders and background is not supported. You can achieve this behavior
using Image button.
c. When you define a skin for normal skin or focus skin, the options font style, font size, font color
are applied to the text of the button in Image Button. They are not applicable to Native Button
widget.
46. Glossary
base64
Returns the base64 encoded string of the image raw bytes. It is applic-
able for few widgets such as Image, Camera, and SignatureCapture wid-
gets.
Basic Properties
Widgets properties are classified into three groups. Basic properties, Lay-
out Properties and Platform Specific Properties. Most of the Basic Prop-
erties are applicable for all platforms.When you hand code the
properties should be put in basic bucket. Some of the Basic Properties
are ID, skin, focusSkin and so on.
blockedUISkin
Specifies the skin that must be used to block the interface until the action
in progress (for example, a service call) is completed.
CheckBoxGroup
The CheckBoxGroup widget allows you to make one or more selections
from a group of check boxes. If you select a check box, a check mark
appears inside the check box to indicate the selection.
ComboBoxGroup
The ComboBox is a widget that allows you to select a single item from a
drop-down list. When you select an item from the drop-down list, the
selected item is displayed on the ComboBox.
containerWeight
Specifies percentage of width to be allocated by its parent widget. The
parent widget space is distributed to its child widgets based on this
weight factor. All its child widgets should sum up to 100% of weight
except when placed in kony.ui.ScrollBox.
DataGrid
The DataGrid widget allows you to present a collection of data in rows
and columns (tabular format). You can use this widget to show a read-
only view of a small amount of data in a tabular format.
Event
Events are functions that are associated with respective widgets are
executed to perform a sequence of actions, when the condition is sat-
isfied.
focusSkin
This is a skin property and it determines the look and feel when there is
focus on a widget.
footers
A footer is a section of the form that is docked at the bottom of the form
(does not scroll along with the content of the form). These footers can
be reused across forms.
Form
A Form is a visual area (basic application screen) that holds other wid-
gets. You can use a form to set a title and scroll content (similar to a web
browser). The entire contents of the form except the headers and foot-
ers scroll together. A form is also the top most container widget. A form
can contain any number of widgets but cannot contain another form.
HBox
An (HBox) is used to layout widgets in a single horizontal orientation. It
can contain any number of widgets. However, due to form size lim-
itations, it is advisable not to place many widgets in a HBox.
headers
A header is a section of the form that is docked at the top of the form
(does not scroll along with the content of the form). These headers can
hExpand
Specifies if the widget should occupy all the width available to it.
HorizontalImageStrip
HorizontalImageStrip also called as Hz Image Strip displays a list of
images which are aligned side-by-side in the horizontal direction. You
can scroll through the Hz Image Strip to view the next or previous set of
images.
hoverSkin
Specifies the look and feel of a widget when the cursor hovers on the wid-
get.
id
id is a unique identifier of widget consisting of alpha numeric characters.
Every widget should have a unique id within a form.
Image
Image widget is a non-interactive widget that you can use to display a
graphic (local or remote) from a PNG file.
ImageGallery
ImageGallery represents a set of images adjacent to each other. If the
images exceed the row size, they are pushed to the next line.
info
A custom JSObject with the key value pairs that a developer can use to
store the context with the widget. This will help in avoiding the globals to
most part of the programming.
isVisible
This property controls the visibility of a widget on the form.
Label
Label widget is used to display non-editable text on the form and is non-
interactive.
Layout Properties
Widgets properties are classified into three groups. Basic properties, Lay-
out Properties and Platform Specific Properties. Most of the Layout Prop-
erties are applicable for all platforms.When you hand code the
properties should be put in layout bucket. Some of the properties that
fall under layout bucket are margin, padding, containerWeight, wid-
getAlignment and so on.
Line
The Line widget allows you to draw a horizontal or a vertical line on a
form. It is used as a separator between widgets for a better visual exper-
ience.
Link
Link widget allows you to define a hyperlink that you can interact with
(select and click) and navigate to an external location or a location within
the application.
ListBox
List Box displays a list of items as a drop-down box and allows you to
select a single item at a time.
Map
A Map widget provides you the capability to display pre-defined locations
(latitude and longitude) on an onscreen map. Platforms like BlackBerry
(above JDE 4.5), iPhone (above 3.0), and Android provide a native map
widget that can be displayed as part of the application.
margin
Defines the space around a widget. You can use this option to define the
left, top, right, and bottom distance between the widget and the next ele-
ment.
MenuItem
MenuItem is a choice on the Menu. It is typically a command or function
such as Application Logout, Form Exit, Sending SMS, or other options
that you can select inside a Menu.
Method
Methods are procedures that are associated with respective widgets to
access the data stored in an instance of the class to control the state of
the instance.
ObjectSelector3D
The ObjectSelector3D widget can be used for allowing the user to select
homogeneous objects arranged on a two-dimensional grid. It provides
the user with a three-dimensional graphical view of the objects which
makes it more attractive than regular two-dimensional images. It has
two modes, a selection mode and a walk-through mode.
padding
Defines the space between the content of the widget and the widget
boundaries. You can use this option to define the top, left, right, and bot-
tom distance between the widget content and the widget boundary.
Phone
A Phone widget, when placed in an application, allows you to launch the
native phone dialer and initiate a phone call to the number that is dis-
played on it. It appears as a button on the Form and the phone number
is displayed on it either in the number format or the phone spell text.
When the user selects the phone widget, the native dialer is launched to
make a phone call.
PickerView
A PickerView widget uses a spinning wheel metaphor to display multiple
sets of values and allows you to select a single combination of values.
You can select a single combination of values by rotating the wheels and
aligning the desired row of values with the selection indicator.
Popup
Popup is a visual component that displays content on top of existing con-
tent, within the bounds of the application window. Generally a popup is
displayed in the center of the screen on top of the Form from which you
have invoked the popup. It does not span the entire screen
width.Popups allow you to partition UI design into smaller parts.
RadioButtonGroup
RadioButtonGroup is a widget that allows you to define a set of radio but-
tons and the user can choose one of it as an option. A radio button usu-
ally contains a small circle with text next to it. When you make a
selection, a dot appears in the circle to indicate your selection.
RichText
RichText widget is used to display non-editable and well formatted text
on the Form. HTML formatting tags are used in RichText widget to dis-
play text with styles (bold, underlined etc.), links, and images. You can
use a RichText widget to show a read-only text.
ScrollBox
A ScrollBox is a scrollable container which allows you to scroll the content
within horizontally and vertically. A ScrollBox can contain any widget
except a Tab pane.
SegmentedUI
A SegmentedUI consists of multiple segments (rows or records) and
each segment (row or record) can have multiple child widgets.
SignatureCapture
A SignatureCapture widget enables you to capture a signature on a form
and save it as an image for easy uploading.
skin
Specifies the look and feel of the widget when not in focus.
Slider
Slider widget allows you to select a value from a defined range of values
by moving the thumb (an indicator) in a horizontal direction. The Slider
widget consists of a seekbar (or track) and a thumb (a control that you
can slide). You can optionally choose to display a minimum value and a
maximum value.
Switch
The Switch widget is identical to the Switch Control (on-off switch which
is non customizable) in iPhone and presents two mutually exclusive
choices or states.
TabPane
TabPane widget is a container widget that allows you to organize mul-
tiple tabs within it. Each Tab will in turn hold a collection of widgets within
the same area of the Form. You can only view one Tab a time.
TextArea
TextArea is used to provide an editable field for the user to enter text
which spans over multiple lines. You can use the TextArea widget to
provide a field where a user can enter multiple lines of text.
TextBox
TextBox widget is an editable text component that can be placed on a
form and is used to obtain an input from a user. You can use the TextBox
widget to provide a field where a user can enter input text.
toolTip
Specifies the hint text when the cursor hovers over a widget, without
clicking it. The text entered in the tooltip appears as a small box when
the cursor hovers over a widget.
vBox
A VBox is used to layout widgets in a single vertical orientation. It can
contain any number of widgets. However, due to form size limitations, it
is advisable not to place many widgets in a VBox.
vExpand
Specifies the widget expansion in the vertical direction.
Video
Video widget enables you to play a video (by streaming data from a
server) within a form. You can add a video widget only within a container
widget.
widgetAlignment
Indicates how a widget is to be anchored with respect to its parent. Each
of the options have a horizontal alignment attribute and a vertical align-
ment attribute. For example, WIDGET_ALIGN_TOP_LEFT specifies the
vertical alignment as TOP and horizontal alignment as LEFT.