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.

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-Lookup Add ValueChanged Binding

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

get_type()

Returns the widget type.

Example-Lookup Fetch Type

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

None

Returns

String

enable()

Enables the widget on the form.

Example-Enable Lookup

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

None

Returns

None

required()

Enables or disables client side validation.

Example-Lookup Required

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

Boolean

Returns

None

remove_valueChanged()

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

Example-Lookup Remove ValueChanged Binding

//For example, using:
var a = tpc.forms[0].TpcLookup.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].TpcLookup.remove_valueChanged(a);
Parameters

Function

Returns

None

set_textValue()

Sets the value of the widget by a text label.

Example-LOOKUP SET TEXT VALUE

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

String

Returns

None

disable()

Disables the widget on the form.

Example-Disable Lookup

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

None

Returns

None

clear()

Clears the value of the widget.

Example-Clear Lookup

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

None

Returns

None

get_addButton()

Returns the add button element associated with the widget.

Example-Lookup Fetch Add Button Element

tpc.forms[0].TpcLookup.get_addButton();
Parameters

None

Returns

jQuery Object     

get_container()

Returns the container element of the widget.

Example-Lookup Fetch Container Element

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

None

Returns

jQuery Object

get_editButton()

Returns the edit button element associated with the object.

Example-Lookup Fetch Edit Button Element

tpc.forms[0].TpcLookup.get_editButton();
Parameters

None

Returns

jQuery Object

get_element()

Returns the element associated with the widget.

Example-Lookup Fetch Element

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

None

Returns

jQuery Object

get_fetchValue()

Returns the value of the widget that is compatible with FetchXML filtering.

Example-Lookup Fetch Fetch Value

tpc.forms[0].TpcLookup.get_fetchValue();
Parameters

None

Returns

String

get_input()

Returns the input element of the widget.

Example-Lookup Fetch Input Element

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

None

Returns

jQuery Object

get_kendoInput()

Returns the Kendo DropDownList Object associated with the widget.

Example-Lookup Fetch Kendo Input

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

None

Returns

Kendo Object: Kendo.ui.DropDownList

get_kendoWindow()

Returns the Kendo Window Object associated with the widget.

Example-Lookup Fetch Kendo Window

tpc.forms[0].TpcLookup.get_kendoWindow();
Parameters

None

Returns

Kendo Object: Kendo.ui.Window

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 Lookup widget, these returned properties and their types are:

  • AddRecordPageUrl: String
  • AllowAddingRecords: Boolean
  • AllowEditingRecords: Boolean
  • CascadeFields: Array
  • ControlDataId: String
  • DisplayAttribute: String
  • EditRecordPageUrl: String
  • EnableVirtualization: Boolean
  • ReadOnly: Boolean
  • ValueAttribute: String
  • WindowHeight: Integer
  • WindowWidth: Integer

Example-Lookup Fetch Model

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

None

Returns

Object

get_value()

Returns the value of the widget.

Example-Lookup Fetch Value

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

None

Returns

String

get_windowPlaceholder()

Returns the modal window associated with the widget.

Example-Lookup Fetch Window Placeholder

tpc.forms[0].TpcLookup.get_windowPlaceholder();
Parameters

None

Returns

jQuery Object

hide()

Hides the widget from the form.

Example-Hide Lookup

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

None

Returns

None

show()

Shows the widget on the form.

Example-Show Lookup

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

None

Returns

None

set_value()

Sets the value of the widget.

Example-Lookup Set Value

//In the case of the CRM Lookup, values must be set in a particular way: "[EntityName];[RecordGuid]" tpc.forms[0].TpcLookup.set_value("account;0bb0d542-ac30-faad-7dbd-e9cccce27379"); tpc.forms[0].TpcLookup.set_value("​contact;550e8cb4-f874-be99-bd18-8bdf84750070");
Parameters

String

Returns

None

toggle()

Toggles the visibility of the widget.

Example-LOOKUP TOGGLE

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

None

Returns

None

readonly()

Sets the widget state to read only.

Example-Lookup READONLY

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

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

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

true, false

Returns

None