This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Dec 9, 2011, 12:15 AM
8 Posts

dialog - run code before close

  • Category: Extension Library
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags: dialog extension close
  • Replies: 3
 I have created an xpages where I select documents in a view so I can update a number of fields on them.
  - server side script with full update works fine using this code in a button.
 
var view = getComponent("viewPanel4");
var doccol = view.getSelectedIds();
for (i=0; i < doccol.length; i++){
var docid = doccol[i];
if (docid  != null) {
var doc:NotesDocument = database.getDocumentByID(docid);
doc.replaceItemValue("assignTo","Joe Blow");    
doc.replaceItemValue("assignCompany","JB Plumbing");     
doc.save(true);
}   
}   
 
But I want the value that I'm updating to come from a dialogbox So I can prompt the user to select who the records are assigned to.
 
The dialogbox come up and works fine. I set a bunch of viewscope variables to store the values but the values don't get added to the documents that I have selected in the view.
var d = getComponent('dialog1')
d.show() 
 
To close the dialogbox and set the fields I am having a problem.
 
var view = getComponent("viewPanel4");
var doccol = view.getSelectedIds();
for (i=0; i < doccol.length; i++){
var docid = doccol[i];
if (docid  != null) {
var doc:NotesDocument = database.getDocumentByID(docid);
doc.replaceItemValue("assignTo",viewScope.get("dlgAssignedTo");
 doc.replaceItemValue("assignCompany",viewScope.get("dlgAssignCompany"); 
doc.save(true);
}   
}
var c = getComponent("dialog1")
c.hide("viewPanel4") 
 
I'm sure I'm missing something pretty simple but I don't know why as soon as I add the dialog in the mix the records no longer update. I've tried setting them with a straight string   doc.replaceItemValue("assignTo","Joe Blow");    
doc.replaceItemValue("assignCompany","JB Plumbing");     
but that isn't working so I don't think it has anything to do with the session variables. 
Any suggestions Please 
Thanks 
Dec 9, 2011, 8:15 AM
261 Posts
Re: dialog - run code before close
I'm assuming you're using an xe:dialog component for the modal dialog?
 
The only possible problem I see in your code is in getting the new values from the viewScope variables. Why don't you access the controls in the dialogs directly? You could start with a basic implementation using an input control and do a getComponent("inputControlId").getValue();
 
Mark
Jan 23, 2014, 8:58 PM
9 Posts
Did you Ever Find a Solution to This?

Hi Mel:

I know it has been a couple of years, but I'm curious to know if you were ever able to solve this problem. I have run into a very similar problem also.

Jan 23, 2014, 8:58 PM
9 Posts
Did you Ever Find a Solution to This?

Hi Mel:

I know it has been a couple of years, but I'm curious to know if you were ever able to solve this problem. I have run into a very similar problem also.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal