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 7567759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:44:47+00:00 2026-05-30T14:44:47+00:00

I have a custom control with a field where the user will enter a

  • 0

I have a custom control with a field where the user will enter a document ID (not a note ID or UNID, just a unique number). This data source is named document1. When they exit the field, I perform a lookup and display either the document with that ID or a new document in an extlib Dialog control (data source bundleDoc). When bundleDoc is saved, I want to update a log field on document1 to indicate that a bundle document was added.

I can save bundleDoc and close (hide) the dialog but the code in my Save & Close button in the dialog can’t “see” document1. I can’t refer to it using document1.getItemValueString or by getComponent. The getItemValueString returns and empty string and getComponent throws an error because the return value is null.

I would have posted an image to help visually but I don’t have enough reputation yet. 🙁
What am I missing? Shouldn’t I be able to get to document1 from the dialog control since it is on the same XPage?

UPDATE: Two fields on the dialog form have computed default values that use getComponent to get their values from document1. So, at least when the dialog is loaded, it can see document1. Also, bundleDoc is not defined as a data source for the dialog control. I will try that tomorrow to see if it makes a difference.

UPDATE 2: Still not enough reputation to post a picture, but here is some code. This is one custom control that contains a dialog control. document1 is defined as the data source for the custom control and bundleDoc is defined as the data source for the panel in the dialog control that contains the table of fields for the bundle document.

The BundleID field in the dialog control has a computed default value using this:

if (bundleDoc.isNewNote()) {
    getComponent("inputBundleID").getValue();
} else {
    bundleDoc.getItemValueString("BundleID");
}

The formula for StorageLocationID is similar except that the component is inputStorageTrayID.

This is the code in the Save & Close button:

bundleDoc.save();
var newArr = new Array(document1.getItemValue("WorkLog"));
newArr.push("Added bundle " + document1.getItemValueString("BundleID") + " - " + session.getCommonUserName());
document1.setValue("WorkLog",newArr);
document1.save();
getComponent("dialog1").hide();

The error happens on the document1.save line but it does not get the BundleID from document1 (I set a sessionScope variable to the value of newArr and it showed ‘Added bundle – Anonymous’.

  • 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-05-30T14:44:49+00:00Added an answer on May 30, 2026 at 2:44 pm

    I think the problem was initially caused by caching issues because it started working the day after I posted the question.

    However, I had to do one more thing to get the page to work the way I wanted to. This is the XPage in Designer:

    enter image description here

    To write a value from the Save & Close button back to the WorkLog field, I had to save the document1 data source before opening the dialog. Then document1 was recognized throughout the Save & Close code and it was saved properly at all times.

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

Sidebar

Related Questions

I have a somewhat complex custom user control, created in C# .NET, which is
I have a custom user control which has some textboxes and some buttons. In
I'm dynamically adding a custom user control to the page as per this post
I have a custom user control DatePicker.cs. Inside of another piece of code I
I'm trying to have an asp.net custom control with a field like: <ErrorTemplate> <h1>Error</h1>
Currently I have a custom user control and within it is a little form
I have custom server control contains templatefield when an out button clicked the field
There are following object: 'FieldItem' custom control; 'Field' - ... XAML-object, which will contains
I have a Custom Control that has multiple textbox fields and a checkbox contained
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).

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.