Wiki source code of How to use Dynamic D2W

Last modified by Ravi Mendis on 2009/07/30 06:59

Hide last authors
Ravi Mendis 7.1 1 = How to use Dynamic D2W =
2
Ravi Mendis 22.1 3 In the Diva look example, we may add a movie to a Studio by clicking "add" on the Studio edit page:
Ravi Mendis 16.1 4
Ravi Mendis 24.1 5 [[image:attach:DynamicD2W.png]]
Ravi Mendis 16.1 6
7 As you can see from the screenshot (above) that adding a movie allows you to edit/insert a movie //inline//.
Ravi Mendis 24.1 8 This is achieved using a combination of //ajax// and //dynamic// D2W assignments.
Ravi Mendis 22.1 9
10 In this example we add a single rule to achieve this:
11
Ravi Mendis 24.1 12 |=(((
13 LHS
14 )))|=(((
15 assignment
16 )))|=(((
17 key
18 )))|=(((
19 RHS
20 )))
21 |(((
22 (pageConfiguration = 'ListEmbeddedMovie' and parentPageConfiguration like '*Edit*')
23 )))|(((
24 **ERDDelayedBooleanAssignment**
25 )))|(((
26 **componentName**
27 )))|(((
28 {"conditionKey" = "object.isNewObject";
Ravi Mendis 22.1 29 "falseValue" = "ERD2WDisplayString";
Ravi Mendis 24.1 30 "trueValue" = "ERD2WEditString";}
31 )))
Ravi Mendis 22.1 32
33 Note that the **ERDDelayedBooleanAssignment** is a somewhat complex rule in that it's RHS value is a dictionary (in plist format).
Ravi Mendis 24.1 34 What it says here is if the Movie object is new use an edit string component, otherwise just display the string.
Ravi Mendis 23.1 35
36 So the //component// is dynamically assigned - determined by the condition of the object listed. (i.e if it's new or not).