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-TextField Fetch Type

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

None

Returns

String

required()

Enables or disables client side validation.

Example-TextField Required

tpc.forms[0].TpcTextfield.required();
Parameters

Boolean

Returns

None

clear()

Clears the value of the widget.

Example-Clear TextField

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

None

Returns

None

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-Textfield Add Value Changed Binding

//For example, using: var a = tpc.forms[0].TpcTextfield.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

None

Returns

None

get_container()

Returns the container element of the widget.     

Example-Textfield Fetch Container Element

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

None

Returns

jQuery Object     

get_element()

Returns the element of the widget.

Example-Textfield Fetch Element

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

None

Returns

jQuery Object

get_input()

Returns the input element of the widget.

Example-Textfield Fetch Input Element

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

None

Returns

jQuery Object

get_model()

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

  • DisplayPromptChar: Boolean
  • InputMode: Integer
  • Mask: String
  • MaxValue: Integer
  • MinValue: Integer
  • NumberOfRows: Integer
  • NumericPrecision: Integer
  • PromptChar: String
  • ReadOnly: Boolean
  • ShowEditorToolBar: Boolean
  • ShowSpinners: Boolean

Example-Textfield Fetch Model

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

None

Returns

Object

get_kendoInput()

Returns the Kendo Input Object associated with the widget.
In the case of the CRM Textfield, only certain input modes will use a Kendo Input Object, otherwise, it will throw an error.
These input modes are:
Numeric textfield, masked textfield, and HTML textfield.

Example-Textfield Fetch Kendo Input

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

None

Returns

Kendo Object:
Kendo.ui.Editor Object if set to HTML Editor
Kendo.ui.MaskedTextBox Object if Mask is set
Kendo.ui.NumericTextBox Object if Numeric attribute is used

get_value()

Returns the value of the widget.

Example-Textfield Fetch Value

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

None

Returns

String if text attribute.
Integer or Decimal if Numeric attribute.

set_value()

Sets the value of the widget.

Example-Textfield Set Value

tpc.forms[0].TpcTextfield.set_value("Ivan"); //For numeric textfields... tpc.forms[0].TpcTextfield.set_value(8);
Parameters

String for all textfields
Integer or decimal for numeric textfield.

Returns

None

remove_valueChanged()

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

Example-Textfield Remove Value Changed Binding

//For example, using: var a = tpc.forms[0].TpcTextfield.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 with a variable. This way you can easily remove this delegate from any widget by using: tpc.forms[0].TpcTextfield.remove_valueChanged(a);
Parameters

Function

Returns

None

hide()

Hides the widget from the form.

Example-Hide Textfield

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

None

Returns

None

show()

Shows the widget on the form.

Example-Show Textfield

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

None

Returns

None

enable()

Enables the widget on the form.

Example-ENABLE TEXTFIELD

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

None

Returns

None

toggle()

Toggles the visibility of the widget.

Example-TEXTFIELD TOGGLE

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

None

Returns

None

readonly()

 Sets the widget state to read only.

Example-TEXTFIELD READONLY

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

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

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

true, false

Returns

None

disable()

Disables the widget on the form.

Example-DISABLE TEXTFIELD

tpc.forms[0].TpcTextfield.disable()
Parameters

None

Returns

None