Monday, 6 November 2017

Notifying the Containing Page About Property Value Change EX02_08

This page will using pieces created for Multi Selecting Related Object - Custom Objects and Junction Objects EX02_07

In the previous examples we have seen how the components can accept an attribute which is a property in the containing page controller.

In this example, the component will notify the containing page controller when the property value has changed.

An interface will be used that defines the method to be used to notify the page controller. This will allow the component controller to notify any page controller that implements the interface. Click here to learn more about the interfaces in salesforce.

Setting up an Interface

Name: EX02_08INotifiable


Component Controller

Name: Ex02_08NotifyingMultiSelRelCompContrlr

Component

Name: Ex02_08NotifyingMultiSelRelComp


Page Controller

Name: EX02_08NotifiableAccountGroupController

Implements EX02_08INotifiable


VisualForce Page

Name: Ex02_08NotifiableAccountGroup


Result


On clicking save, you'll see a yellow message on top of New Account Group.