Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:07:08+00:00 2026-06-12T19:07:08+00:00

I have an XPage with a Dialog control from the Extension Library. The dialog

  • 0

I have an XPage with a Dialog control from the Extension Library.

The dialog works fine — opens, does what it needs to do, however, when I try to update the “parent” document, it does not work.

I have the XPage data source as Domino Document called document1. I added this after reading:
When I save a document from an extension library dialog box some values are blank

<xp:this.data>
<xp:dominoDocument var="document1" formName="speakerReq"></xp:dominoDocument
</xp:this.data>

On the dialog control, I have a Search button which calls a servlet and returns JSON that is parsed and built into an HTML table. The first cell is a link which calls a function from a client side JavaScript library when it is clicked. The function is to update the “parent” document with values from the returned JSON as well as close the dialog.

It can call the function when I test with just an alert() statement in that function, however, when I try to update the “parent” document, it does not recognize that.

I have tried to pass the “document1” object but once I get to the dialog, it says it does not exist, so the link is failing.

Here is the code snippet where the link is built:

        // Let's build the row...
        cell = document.createElement("td");
        resultLink = document.createElement("a");
        resultLink.setAttribute("class", "linkText");
        resultLink.setAttribute("href", "#");
        resultLink.setAttribute("onclick", "javascript:updateDocument(document1, '" + bpName + "', '" + bpEmail + "', '" + bpPhone + "', '" + bpTitle + "', '" + bpCountry + "', '" + bpLoc + "');");
        resultLink.appendChild(document.createTextNode(bpName));
        cell.appendChild(resultLink);
        row.appendChild(cell);

How do I get a handle on the document1 object on the client side so I can update those fields on the “parent” document as well as close the dialog?

Code:

function updateDocument(doc, name, email, phone, job, country, location) {

var thisField;

// Need to update the document with the selected values...
thisField = doc.getElementById("#{id:sr_Name1}");
thisField.value = name;

thisField = doc.getElementById("#{id:sr_Title1}");
thisField.value = email;

thisField = doc.getElementById("#{id:sr_Phone1}");
thisField.value = phone;

thisField = doc.getElementById("#{id:sr_Email1}");
thisField.value = job;

thisField = doc.getElementById("#{id:sr_Location1}");
thisField.value = location + " - " + country;

} 

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:07:09+00:00Added an answer on June 12, 2026 at 7:07 pm

    Seems you are mixing CSJS and SSJS up. The code snippet runs in the browser, but you try to execute server side code. This can’t work. You need to post back your data to the server and handle the data there. The XPages Wiki has some ideas you might find useful.

    Clarification:

    Rule of thumb: anything that lands as JavaScript in your browser cannot have SSJS in it. So you can use anything DOM, but NO session, database, document1 etc. SSJS libraries are invisible to CSJS, so you can’t call these methods. You can have a button in your page where you define both CSJS and SSJS. The client side would execute first and then do a refresh (partial or full).

    Also your code above: getElementById is CSJS -> can’t use that in a SSJS, while doc is as NotesDocumentDatasource -> doesn’t have getElementById.

    Furthermore: there is no “parent” element. The dialogbox is just another part of the local DOM (this is not NotesUIWorkspace.dialogbox). Check the XPagesWiki for samples

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a strange problem. I have a XPage with a repeat control where
I have this XAgent with seems to work fine but it opens it in
I have installed domino designer 8.5.2,and Extension library 8.5.2,dojo 1.6.1.Then i have developed the
I have an Xpage page with a single Notes document datasource. After saving a
I have an XPage which has just broken due to (what should have been)
I have a xPage application which shows list of emails of the currently logged
I have a xPage with following content: <xe:restService id=restService preventDojoStore=false> <xe:this.service> <xe:viewJsonService viewName=vwChartData contentType=text/json>
Using 8.5.3, I have an Xpage with a value picker that populates a dojo
in my xpage I have an editbox for user to enter the name of
In Xpage's CheckboxGroup, I have to get the values of both value and Label.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.