Wiki source code of How to use Dynamic D2W
Last modified by Ravi Mendis on 2009/07/30 06:59
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = How to use Dynamic D2W = | ||
2 | |||
3 | In the Diva look example, we may add a movie to a Studio by clicking "add" on the Studio edit page: | ||
4 | |||
5 | [[image:attach:DynamicD2W.png]] | ||
6 | |||
7 | As you can see from the screenshot (above) that adding a movie allows you to edit/insert a movie //inline//. | ||
8 | This is achieved using a combination of //ajax// and //dynamic// D2W assignments. | ||
9 | |||
10 | In this example we add a single rule to achieve this: | ||
11 | |||
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"; | ||
29 | "falseValue" = "ERD2WDisplayString"; | ||
30 | "trueValue" = "ERD2WEditString";} | ||
31 | ))) | ||
32 | |||
33 | Note that the **ERDDelayedBooleanAssignment** is a somewhat complex rule in that it's RHS value is a dictionary (in plist format). | ||
34 | What it says here is if the Movie object is new use an edit string component, otherwise just display the string. | ||
35 | |||
36 | So the //component// is dynamically assigned - determined by the condition of the object listed. (i.e if it's new or not). |