Apple WebObjects 3.5 Manuel d'utilisateur Page 102

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 218
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 101
Chapter 6 Creating Reusable Components
102
Parent1’s Declarations File (excerpt)
ALERT: AlertPanel {
...
parentAction = "respondToAlert";
exitStatus = usersChoice;
};
Parent2’s Declarations File (excerpt)
ALERT: AlertPanel {
...
parentAction = "okCancel";
exitStatus = result;
};
Parent3’s Declarations File (excerpt)
ALERT: AlertPanel {
...
parentAction = "alertAction";
exitStatus = choice;
};
In summary, parent and child components communicate in these ways:
A parent component can, in its declarations file, set child component attributes
by:
Assigning constant values
Binding an attribute to the value of a variable declared in the parent’s code
Binding an attribute to the return value of a method defined in the parent’s
code
A child component can communicate actions and values to a parent component
by:
Invoking the parent’s callback method
Setting variables that are bound to variables in the parent, as specified in the
parent’s declarations file
Synchronizing Attributes in Parent and Child Components
Because WebObjects treats attribute bindings between parent and child
components as potentially two-way communication paths, it synchronizes the
values of the bound variables at strategic times during the request-response
loop. This synchronization mechanism has some implications for how you
design components.
Vue de la page 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 217 218

Commentaires sur ces manuels

Pas de commentaire