Wiki source code of Using ERD2WWizardCreationPage

Last modified by Pascal Robert on 2012/02/11 08:03

Show last authors
1 [[ERD2WWizardCreationPage>>url:http://wocommunity.org/documents/javadoc/wonder/latest/er/directtoweb/pages/ERD2WWizardCreationPage.html||shape="rect"]] and the subclass [[ERNEUWizardCreationPage>>url:http://wocommunity.org/documents/javadoc/wonder/latest/er/neutral/ERNEUWizardCreationPage.html||shape="rect"]] are page-level components for editing an entity in a wizard-style user interface. The attributes to edit (including attributes of related entities via relationships), and even page and section titles are all provided by the rules file.
2
3 Assume there is an entity {{code language="none"}}Employee{{/code}}, with a to-one relationship {{code language="none"}}contactDetails{{/code}} to an entity {{code language="none"}}ContactDetails{{/code}}. The following rule:
4
5 {{code borderStyle="dashed"}}
6
7 100 : (task = 'edit' and entity.name = 'Employee') =>
8 displayPropertyKeys = ("[Page 1]","(Personal Details)",firstName,lastName,"[Page 2]","(Address)",
9 "contactDetails.address1","contactDetails.address2",
10 "contactDetails.address3","contactDetails.suburb","contactDetails.state",
11 "contactDetails.postcode","(Contact)","contactDetails.email",
12 "contactDetails.phone","contactDetails.fax")
13
14 {{/code}}
15
16 will create a wizard with the following properties:
17
18 * Two pages, entitled "Page 1" and "Page 2"
19 * Page 1 will have a single section entitled "Personal Details", with fields for {{code language="none"}}firstName{{/code}} and {{code language="none"}}lastName{{/code}} attributes.
20 * Page 2 will have two sections, "Address" and "Contact", where each of those sections will have fields for the attributes of the {{code language="none"}}ContactDetails{{/code}} entity retrieved via the {{code language="none"}}contactDetails{{/code}} relationship as listed in the rule above.
21
22 The changes are saved after hitting the Save button on the final page.