C2040-922 Free Dumps Study Materials
Question 2: Frank is attempting to add some functionality to an existing XPage: ?The XPage has a
Date Time
Picker edit box named "graduationDate" where users must enter their graduation date.
?Frank looks at
the HTML source of the XPage and sees that the edit box has the HTML attribute:
dojoType="ibm.xsp.widget.layout.DateTimeTextBoxContainer" ?Frank has added a combo
box where
users should choose their type of Job, from the options "Intern", "Graduate" or "Experienced".
?Frank
wants to add an onchange listener to the combo box, that checks the value of the graduation
date and
gives a browser alert popup dialog like "Intern and Graduate positions only available in the
first 2 years
after graduation". ?Frank has looked at the HTML source of the XPage and sees that the
Date Time
Picker edit box has a dojoType attribute. Which of the following code snippets should Frank
use to
retrieve the graduation date before triggering the alert dialog:
A. var graduationDate = getComponent("graduationDate").getValue();
B. var graduationDate = XSP.getElementById("#{id:graduationDate}").value;
C. var graduationDate = dojo.byId("#{id:graduationDate}").value;
D. var graduationDate = dijit.byId("#{id:graduationDate}").getValue();
Correct Answer: D