Hello,
You provided the urls for methods - that is great. If you will check the description at the top - it should be clear enough how every of method can be used:
addOnChange - Sets a function to be called when the OnChange event occurs.
example:
function onNameChanged(executionContext){
alert("name was changed");
}
//attach this function to onload event of the for and check "Pass execution context as a first parameter" checkbox
function onLoad(executionContext){
var formContext = executionContext.getFormContext();
formContext.getAttribute("name").addOnChange(onNameChanged);
}
What this code does is following - during the load of the form code attaches onNameChanged function as a handle for onchange event of "name" field on the for.
removeOnChange - Removes a function from the OnChange event hander for an attribute.
it does opposite to the addOnChange - removes the handler from field. Example:
function someFunction(executionContext){
var formContext = executionContext.getFormContext();
formContext.getAttribute("name").removeOnChange(onNameChanged);
}
fireOnChange - Causes the OnChange event to occur on the attribute so that any script associated to that event can execute.
if you want to trigger event handler for the field when field value changes - you can use this method. Example:
function someFunction(executionContext){
var formContext = executionContext.getFormContext();
formContext.getAttribute("name").fireOnChange();
}