When working with xtypes and listeners - you use the AEM Widget API. For information, see CQ5 Widgets API Documentation.
To learn how to work with xtypes and listeners -- see this community article:
http://helpx.adobe.com/experience-manager/using/dynamically-updating-aem-custom-xtype.html
In this use case -- an xtype object's listeners are used to update fields. The value selected from a drop down is used to set a text field. However - once you understand this -- you can do a lot using xtype and listeners.
The listeners property lets you specify an event handler for this control.
listeners: {
selectionchanged: {
scope:this,
fn: this.updateHidden
}
},
The only event handler that is defined is selectionchanged that is fired when a selection in the drop-down control is changed. In this situation, a method named updateHidden is invoked. The following code example shows the updateHidden method.
// called when a selection in the drop-down is made
updateHidden: function() {
var val1 = this.linkType.getValue();
this.linkText.setValue(val1);
}
.