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

Parameters

None

Returns

String

clear()

Clear the value of the widget

Parameters

Returns

None

enable()

Enable the widget on the page.

 

Parameters

Returns

None

disable()

Disable the widget on the page.

Parameters

 

Returns

None

get_input()

Returns the input element of the widget.     

Example-YesNo Fetch Input Element

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

None

Returns

​JQuery Object

get_element()

Returns the element of the widget.

Example-YesNo Fetch Element

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

None

Returns

​JQuery Object

get_container()

Returns the container element of the widget.

Example-YesNo Fetch Container Element

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

None     

Returns

​JQuery Object

hide()

Hides the widget from the form.

Example-Hide YesNo

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

None

Returns

None

show()

Shows the widget on the form.

Example-Show YesNo

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

None

Returns

None

get_value()

Returns the value of the widget.

Example-YesNo Fetch Value

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

None

Returns

Boolean

set_value()

Sets the value of the widget.

Example-YesNo Set Value

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

Boolean

Returns

None

get_textValue()

Returns the text value of the widget.

Example-YesNo Fetch Text Value

tpc.forms[0].TpcYesNo.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].TpcYesNo.set_textValue("Allow"); tpc.forms[0].TpcYesNo.set_textValue("Do Not Allow");
Parameters

String

Returns

None

get_kendoInput()

Returns the kendo object associated with the widget.

Example-YesNo Fetch KendoInput

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

None

Returns

Depends on Configuration.
Kendo.ui.DropDownList Object if DropDownList
Kendo.mobile.ui.Switch Object if Mobile Switch
Null if Radiobuttons or Checkbox

get_displayInput()

Returns the boolean display associated with the widget.

Example-YesNo Fetch Display Input Element

tpc.forms[0].TpcYesNo.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].TpcYesNo.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].TpcYesNo.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].TpcYesNo.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 CRM ​Yes/No widget, these returned properties and their types are:

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

Example-YesNo Fetch Model

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

None

Returns

Object     

toggle()

toggles the visibility of the widget. ​

Example-EXAMPLE-YES/NO TOGGLE

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

None

Returns

None

readonly()

 set the widget state to read only

Example-Yes/No - 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