controller.afterSetData

Reading Time: 1 minute

Triggered when a control sets a field value. Used for handling user interactions or modifying the layout based on the interactions.

Parameters
Name Type Descripton
name {String} the name of the field
value {FIELD_VALUE_OBJECT} the new value of the field
Returns

none

Example

Show a special offer for female customers when the gender field and the special offer control are on the script page.

// First: set the correct layout on load
$('page').onLoad = function() {
     vcc.getController('page', 'offer_for_women').hidden =
             !vcc.isSelected('gender', 'female', 'export_value');
};

// Then: change the layout when the gender changes
$('page', 'gender').afterSetData = function() {
     vcc.getController('page', 'offer_for_women').hidden =
             !vcc.isSelected('gender', 'female', 'export_value');
};

There are no comments yet.
Subscribe to our newsletter
or Contact us!
Please note that by subscribing to our newsletter, you agree to receive regular email messages from VCC Live® about service related news and updates. By subscribing to our newsletter, you also agree that VCC Live® will use your data in accordance with the applicable Privacy Policy until you unsubscribe from the newsletter.