9. Application Design Review Data Model End User Surveys * Response Doc Survey Document * Parent Doc Questions/Answers * Response to Response Doc Base Survey Questions * Response Doc
15. Application Design Review â Questions design Read Mode Table Repeat Control Edit Mode Table Panel Control
16. Application Design Review â Repeat Control Repeat Control Properties The Collection name âdocidâ will contain the docUNIDs for each survey question .
17. Application Design Review â Repeat Control Repeat Control iteration formula Note the mixing of @Commands with JavaScript Tip: A Repeat control iteration formula must return an array. When using @DbLookup, an array is not returned if a single match is found. Force the result to an array by using @Explode.
18. Application Design Review â Panel Control A Panel Control is repeated for each question Each Panel control will be bound to each question response document using the âdocidâ variable from the Repeat control.
19. Application Design Review â Tables for Read/Edit Within the Panel control there are 2 tables. Each has a visibility formula to show/hide the different tables if the document is in read mode or in edit mode.
20. Application Design Review â Web Controls The controls are bound to the fields from the panel document
31. Application Design Review â Take Survey design Web Controls â Visibility formulas The Web Controls are visible only if the value of the âAnswerTypeâ field is equal to the type of control.
32. Application Design Review â Take Survey design Web Controls â Data binding All the Web Controls are bound to the same âAnswerâ field on the response document. Only one control is visible at a time so there is no conflict.
33. Application Design Review â Take Survey design Web Controls â Values formula (only pertains to multivalue controls)
34. Application Design Review â Take Survey design Web Controls â Required field computed value formula The field's Required property are set based on the âRequiredâ field
35. Application Design Review â Take Survey design Web Control â Display Error control binding The Display Error control dynamically shows errors based on the âAnswerTypeâ field. The Editable controls are named to match the choices.
36. Application Design Review â Take Survey design Panel Control â Visibility formula The Panel control, which contains the bound Web controls, is repeated for each question. When the survey is set to only show one question per page, the only panel is visible is the one for the current question .
37. Application Design Review â Take Survey design Submit Survey Button â onclick event simple actions The Submit Survey button onclick event fires off 2 simple actions. It sets the status to âCompleteâ and then saves the survey and redirects the user to the 'ThankYouâ XPage.
38. Application Design Review â Take Survey design Save and Return Later Button â onclick event JavaScript The Save and Return Later button onclick event fires off 3 simple actions. It sets the status to âOpenâ, and records the last question# answered, then saves the survey and redirects the user to the 'ReturnLaterâ XPage. Note that the âNo data validationâ is checked thus allowing us to save an uncompleted survey.