!--a11y-->
Programming Context State Changes 
The states, which are stored in the different contexts, are changed according to the events triggered by the user in the event handlers of the view controllers Welcome and Question.
The UI element properties bound to the view context (such as text of the TextView UI element or visible of the Button UI element) must be adjusted to each new situation on the user interface and the navigation in the list of QuizData node elements is necessary to display the desired question-answer pair on the user interface.
Add the code lines contained in the tables to the appropriate user coding areas of the individual view controllers.
You must initialize the view context in the Welcome view controller again by selecting the Start Quiz button (display the welcome message, hide the exit button for exiting the application). When terminating the quiz, the exit button and a goodbye message must be displayed after selecting the End Quiz button in the Answer view.
The text messages are stored in two string variables welcomeMessage and endMessage, which are only visible in the view controller.
Implementation in the Welcome view controller |
... |
When the user selects the Next Question button, the QuestionMark view is called. In the context, you must reference to the subsequent QuizData node element to display the next question text on the user interface using data binding. The following code moves the lead selection of the QuizData value node to the next position and therefore points to the next available node element of the type QuizData.
wdContext.nodeQuizData().moveNext();
If the lead selection points to the last node element, the Next Question button must be hidden by assigning the value WDVisibility.BLANK to the NextButtonVisibility value attribute.
We recommend to deactivate the Show Answer button by deactivating the corresponding action ShowAnswerPressed.
Implementation in the Question view controller |
/** declared validating event handler */ |
You have
successfully developed an extended Web Dynpro application and already become
familiar with several components of the Web Dynpro programming model.
