RECOMMENDATION: If you are using a version of The Portal Connector higher than 4.0, we strongly recommend utilizing the MVC based widgets and components to create your site. This documentation is for legacy purposes only and will soon be deprecated.

get_type()

Returns the widget type.

Example-YesNo Fetch Type

tpc.forms[0].TpcBoolean.get_type();
Parameters

None

Returns

String

clear()

Clears the value of the widget.

Example-Clear YesNo

tpc.forms[0].TpcBoolean.clear();
Parameters

None

Returns

None

enable()

Enables the widget on the page.

Example-Enable YesNo

tpc.forms[0].TpcBoolean.enable();
Parameters

None

Returns

None

disable()

Disables the widget on the page.

Example-Disable YesNo

tpc.forms[0].TpcBoolean.disable();
Parameters

 None

Returns

None

get_input()

Returns the input element of the widget.     

Example-YesNo Fetch Input Element

tpc.forms[0].TpcBoolean.get_input();
Parameters

None

Returns

jQuery Object

get_element()

Returns the element of the widget.

Example-YesNo Fetch Element

tpc.forms[0].TpcBoolean.get_element();
Parameters

None

Returns

jQuery Object

get_container()

Returns the container element of the widget.

Example-YesNo Fetch Container Element

tpc.forms[0].TpcBoolean.get_container();
Parameters

None     

Returns

jQuery Object

hide()

Hides the widget from the form.

Example-Hide YesNo

tpc.forms[0].TpcBoolean.hide();
Parameters

None

Returns

None

show()

Shows the widget on the form.

Example-Show YesNo

tpc.forms[0].TpcBoolean.show();
Parameters

None

Returns

None

get_value()

Returns the value of the widget.

Example-YesNo Fetch Value

tpc.forms[0].TpcBoolean.get_value();
Parameters

None

Returns

Boolean

set_value()

Sets the value of the widget.

Example-YesNo Set Value

tpc.forms[0].TpcBoolean.set_value(false); tpc.forms[0].TpcBoolean.set_value(true);
Parameters

Boolean

Returns

None

get_textValue()

Returns the text value of the widget.

Example-YesNo Fetch Text Value

tpc.forms[0].TpcBoolean.get_textValue();
Parameters

None

Returns

String

set_textValue()

Sets the value of the widget by a text label.

Example-YesNo Set Text Value

tpc.forms[0].TpcBoolean.set_textValue("Allow"); tpc.forms[0].TpcBoolean.set_textValue("Do Not Allow");
Parameters

String

Returns

None

get_kendoInput()

Returns the Kendo Object associated with the widget.

Example-YesNo Fetch Kendo Input

tpc.forms[0].TpcBoolean.get_kendoInput();
Parameters

None

Returns

Kendo Object:
Kendo.ui.DropDownList Object if DropDownList
Kendo.mobile.ui.Switch Object if Mobile Switch
Null if RadioButton or Checkbox

get_displayInput()

Returns the boolean display associated with the widget.

Example-YesNo Fetch Display Input Element

tpc.forms[0].TpcBoolean.get_displayInput();
Parameters

None

Returns

jQuery Object

add_valueChanged()

Fired when the value of the widget is changed by the user.
The event handler function context (available via the this keyword) will be set to the widget instance.

Example-YesNo Add ValueChanged Binding

//For example, using: var a = tpc.forms[0].TpcBoolean.add_valueChanged(function() { console.log( this.get_value()); }); //will output the selected value of the widget to the console as soon as the value changes. All delegates must be set with a variable.
Parameters

Function

Returns

None

remove_valueChanged()

Removes any delegate hooked up to the add_valueChanged() event.

Example-YesNo Remove ValueChanged Binding

//For example, using: var a = tpc.forms[0].TpcBoolean.add_valueChanged(function() { console.log( this.get_value()); }); //will output the selected value of the widget to the console as soon as the value changes. All delegates must be set with a variable. This way you can easily remove this delegate from any widget by using: tpc.forms[0].TpcBoolean.remove_valueChanged(a);
Parameters

Function

Returns

None

get_model()

Returns the model object of the widget, which contains a number of useful properties related to the widget.
In the case of the Yes/No Field widget, these returned properties and their types are:

  • BooleanLabels: Array
  • InputMode: Integer
  • ReadOnly: Boolean

Example-YesNo Fetch Model

tpc.forms[0].TpcBoolean.get_model();
Parameters

None

Returns

Object     

toggle()

Toggles the visibility of the widget.

Example-YESNO TOGGLE

tpc.forms[0].TpcBoolean.toggle()
Parameters

None

Returns

None

readonly()

 Sets the widget state to read only.

Example-YesNo READONLY

//set to true
tpc.forms[0].TpcBool.readonly(true);

//set to false
tpc.forms[0].TpcBool.readonly(false);

//show the read only status
tpc.forms[0].TpcBool.readonly();
Parameters

true, false

Returns

None