Skip to main content

C2040-922 Real Exam Questions

Developing IBM Lotus Domino 8.5.2 Applications: Advanced XPage Design

66 questions available · Page 1 of 7

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

Peter wants to enhance the view controls used in his application so that they can display rich content from the underlying document collection. He wants to do this in an efficient manner as the application has thousands of documents and is accessed by hundreds of concurrent users.

Which of the following approaches should John take to add this enhancement to his application most efficiently?

  1. A

    Modify the Domino view to include the rich text field and add a new column to his view controls that automatically binds to this field.

  2. B

    Add a computed column to the view control that opens each document, set the column content type to HTML, and bind the rich text contentfrom each document using JavaScript code.

  3. C

    Add an action to each column that will retrieve the rich text content from the underlying document when clicked, assign it to a computed fieldwith content type set to HTML, and then display that field.

  4. D

    Nothing - XPages view controls cannot display rich content.

Show answer and explanation

Correct answer: C

Question 2 Single choice

Rachel needs to enable her XPages application for multi-language use.

Where should she go to enable localization?

  1. A

    It is not possible to enable localization at application-level in XPages.

  2. B

    In Lotus Notes, open up the Application Properties and on the Advanced tab click 'Enable localization'

  3. C

    In Domino Designer, open up the Application Properties and on the Advanced tab click 'Enable localization'

  4. D

    In Domino Designer, open up the Application Properties and on the XPages tab click 'Enable localization'

Show answer and explanation

Correct answer: D

Question 3 Single choice

Dominic wants to implement the open source CSS framework called Blueprint in his XPages application.
He does not want to include any other CSS framework resources which may exist on the Domino server.

What is the best way to include all of the required CSS files in the XPages in his application?

  1. A

    In each XPage in the application add the required CSS files to the Resources section

  2. B

    Create a new theme which extends webstandard and then add each Blueprint CSS file via a resource definition

  3. C

    Create a new theme which extends oneui and then add each Blueprint CSS file via a resource definition

  4. D

    Create a new theme which does not have an extension property and then add each Blueprint CSS file via a resource definition

Show answer and explanation

Correct answer: D

Question 4 Single choice

John has a managed bean which is defined as follows:

The bean has a property called 'miles' which allows a distance in miles to be entered and converted to kilometers. John wishes to have a user enter a value via an edit box and use the managed bean to convert the value from miles to kilometers.

What should the value of the edit box's value attribute be in order to utilize the managed bean?

  1. A

    <xp:inputText id="inputText1" value="#{view.distanceConverter.miles}"></xp:inputText>

  2. B

    <xp:inputText id="inputText1" value="#{bean.MyBean.setMiles()}"></xp:inputText>

  3. C

    <xp:inputText id="inputText1" value="distanceConverter.miles"></xp:inputText>

  4. D

    <xp:inputText id="inputText1" value="#{distanceConverter.miles}"></xp:inputText>

Show answer and explanation

Correct answer: D

Question 5 Single choice

Michelle is editing an existing XPage: ?The page has a "tags" Edit Box with Type Ahead enabled, which provides suggestions for possible tags or keywords to add to the document. ?The HTML source of the Edit
Box includes a dojoType attribute. ?After the edit box there is a panel named "tagsHint" explaining the concept of tags. ?Now Michelle wants to hide the "tagsHint" panel when values are already present in the "tags" field. ?She adds an Output Script control containing the following code:
var tags = dijit.byId("#{id:tags}");
if( tags.value.length > 0 ){ // already set some tag var tagsHint =
XSP.getElementById("#{id:tagsHint}"); tagsHint.style.display = "none"; } ?When she opens the page in a
web browser, the JavaScript Error Console reports the error: tags is undefined at the line:
if( tags.value.length > 0 ){ // already set some tag

What is the problem with the sample code?

  1. A

    There is no initial value in the tags field, so it is not possible to find the length of the value.

  2. B

    The dijit is not yet loaded; the code in the Output Script control should be in an "addOnLoad" listener
    function.

  3. C

    The script should be in the "onload" event of the XPage control corresponding to the HTML "body" tag.

  4. D

    The first line should be: var tags = XSP.getElementById("#{id:tags}");

Show answer and explanation

Correct answer: B

Question 6 Multiple choice

Jeremy wants all of the dijit.Dialog boxes in his application to call a client side JavaScript function called "validateForm" whenever they are hidden.

What is the best solution?

  1. A

    Create a custom Dojo control and use that instead of the standard dijit.Dialog in the application using the following code:/*** Custom Dojo Control*/dojo.provide('com.myco.widget.Dialog');dojo.require('dijit.Dialog');(function() {dojo.declare
    ("com.myco.widget.Dialog", dijit.Dialog, {onHide: validateForm})}());/*** Initialization code*/var dialog =
    new dijit.Dialog();

  2. B

    Whenever he initializes a new dijit.Dialog, add an onHide event like so:var dialog = new dijit.Dialog

    ({onHide: validateForm});

  3. C

    In the "Close" or "Cancel" button of each dialog add a call to validateForm in the onClick event.

  4. D

    Create a custom Dojo control and use that instead of the standard dijit.Dialog in the application using the following code:/*** Custom Dojo Control*/dojo.provide('com.myco.widget.Dialog');dojo.require('dijit.Dialog');(function() {dojo.declare
    ("com.myco.widget.Dialog", dijit.Dialog, {onHide: validateForm})}());/*** Initialization code*/var dialog =
    new com.myco.widget.Dialog();

  5. E

    Create a custom Dojo control and use that instead of the standard dijit.Dialog in the application using the following code:/*** Custom Dojo Control*/dojo.provide('com.myco.widget.Dialog');dojo.require('dijit.Dialog');(function() {dojo.declare
    ("com.myco.widget.Dialog", dijit.Dialog, {onHide: validateForm})}());/*** Initialization code*/var dialog =
    new com.myco.widget.Dialog();

  6. F

    Create a custom Dojo control and use that instead of the standard dijit.Dialog in the application using the following code:/*** Custom Dojo Control*/dojo.provide('com.myco.widget.Dialog');dojo.require('dijit.Dialog');(function() {dojo.declare
    ("com.myco.widget.Dialog", dijit.Dialog, {onHide: validateForm})}());/*** Initialization code*/var dialog =
    new com.myco.widget.Dialog();

  7. G

    Create a custom Dojo control and use that instead of the standard dijit.Dialog in the application using the following code:/*** Custom Dojo Control*/dojo.provide('com.myco.widget.Dialog');dojo.require('dijit.Dialog');(function() {dojo.declare
    ("com.myco.widget.Dialog", dijit.Dialog, {onHide: validateForm})}());/*** Initialization code*/var dialog =
    new com.myco.widget.Dialog();

Show answer and explanation

Correct answers: D, E, F, G

Question 7 Single choice

John needs to access data which is in a relational database from his XPages application.

What is the best option for accessing the data?

  1. A

    As long as there is a JDBC driver available for the database then John can write Java to access the database

  2. B

    As long as there is a JDBC driver available for the database then John can write Java or Server Side Javascript to access the database.

  3. C

    The relational data source would need to have a web service added to it to allow access to the data.

  4. D

    It is not possible to access relational data from an XPage

Show answer and explanation

Correct answer: B

Question 8 Single choice

Pat wishes to create a new XPages UI control which will take user input.
At a MINIMUM which of the following does he need to do?

  1. A

    Create a UI Component extension Java Class that extends UIInputComponent, create an xsp-config file to define the tag, create a Java Class which will serve as a renderer, in order to render the tag as HTML markup.

  2. B

    Create a UI Component extension Java Class that extends UIInput, create an xsp-config file to define the tag, create a Java Class which will serve as a renderer, in order to render the tag as HTML markup.

  3. C

    Create a custom control with an edit box and reuse the custom control within the XPages

  4. D

    Create a UI Component extension Java Class that extends UIInputComponent, create an xsp-config file to define the tag, create a Java Class which will serve as a renderer, in order to render the tag as HTML markup. Then create a managed bean definition in faces-config.xml.

Show answer and explanation

Correct answer: B

Question 9 Single choice

Wayne needs to debug some client side JavaScript code in an XPage to find why a feature is not working as expected.

Which of the following actions would be the best option to determine the problem?

  1. A

    Wayne can activate the Source pane for the XPage in Domino Designer, set breakpoint(s) on the JavaScript code by double-clicking in theside-gutter and then preview the application

  2. B

    Wayne can install FireBug or FireBug lite in the browser, set breakpoints in the JavaScript code and then run and debug the application

  3. C

    Wayne can insert print() and_dump() statements directly in the JavaScript code and use the information sent to the console window to helpdebug the problem

  4. D

    Wayne can open the Java perspective in Domino Designer, find the Java code for the XPage in the "local\xsp" source folder, set breakpoint(s)in the code using the standard Java tooling and then preview the application

Show answer and explanation

Correct answer: B

Question 10 Single choice

Titus has created a JSON string that he will pass to the browser.

What method could he use to convert the string to an object?

  1. A

    dijit,fromJson()

  2. B

    dojo.fromJson()

  3. C

    dojo.toJson()

  4. D

    dijit.toJson()

Show answer and explanation

Correct answer: B