Skip to main content
Nintex Community Menu Bar

creating custom javascript control using VS2015 template.

custom properties in defination xml 

 

 <Prop ID="Link1"  friendlyname="Link 1" type="string" category="Detail" setFunction="VerticalTabs.VerticalTabClientControl.getValue"  refreshdisplay="true">

 

when I try to get value in js file using the following function

(function ($) {
//TODO: if necessary, add additional statements to initialize each part of the namespace before your VerticalTabClientControl is called.
if (typeof VerticalTabs === "undefined" || VerticalTabs == null) VerticalTabs = {};

VerticalTabs.VerticalTabClientControl = {

//internal method used to get a handle on the control instance
_getInstance: function (id) {
//alert("_getInstance(" + id + ")");
var control = jQuery('#' + id);
if (control.length == 0) {
throw 'VerticalTabClientControl '' + id + '' not found';
} else {
return control 0];
}
},

getValue: function (objInfo) {
debugger
alert("getValue() for control " + objInfo.CurrentControlId);
var instance = VerticalTabs.VerticalTabClientControl._getInstance(objInfo.CurrentControlId);
return instance.value;
},

}

}

 

 

here objInfo.CurrentControlId return undefind and instance.value is 0 instead of actual value in textbox link1.

 

 

 

help me what is going wrong.?

 

 

Hi Nilesh_Zala,


 


This article describes how to add custom JavaScript to an existing custom control - see link below.


 


Adding Custom Javascript&colon;


https://help.k2.com/onlinehelp/k2smartforms/devref/4.7/default.htm#Adding_Custom_Javascript.html


 


Considerations and Best Practices for Custom Controls:


https://help.k2.com/onlinehelp/k2smartforms/devref/4.7/default.htm#Considerations_and_Best_Practices_for_Custom_Controls.htm


Reply