0
votes

I have an Xpage consisting of a few custom controls - application layout, content (dojo_data grid), and a custom control that shows some user data, which the user can change.

Everything works fine in the 9 client, but on the web I get the following error message:enter image description here

The log shows this:

CLFAD0134E: Exception processing XPage request

I have a save button in the custom control with the user data, which has SSJS:

var usrNme = session.getCommonUserName();
var v:NotesView = database.getView("(employeesByFullName)");
var doc:NotesDocument = v.getDocumentByKey(usrNme);

var tmpOfficePhone = employee.getItemValueString("HR_OfficePhone")
doc.replaceItemValue("HR_OfficePhone",tmpOfficePhone);

var tmpCellPhone = employee.getItemValueString("HR_CellPhone")
doc.replaceItemValue("HR_CellPhone",tmpCellPhone);

var tmpExtension = employee.getItemValueString("HR_Extension")
doc.replaceItemValue("HR_Extension",tmpExtension);

var tmpDirectDial = employee.getItemValueString("HR_DirectDial")
doc.replaceItemValue("HR_DirectDial",tmpDirectDial);

var tmpPersonalEmail = employee.getItemValueString("HR_PersonalEmail")
doc.replaceItemValue("HR_PersonalEmail",tmpPersonalEmail);

doc.save();

var x= "alert('Your changes have been saved.')";
view.postScript(x);

I have partial update selected, and whatever I pick to update I still get the error, just with slightly different verbiage. Example: I put everything in a panel and do a partial update on the panel, and I get the error for the panel.

It ALWAYS works in the client, but never works in a web browser.

Can anyone tell me what is going on?

2
Check your XPages logs on the server under the data\IBM_TECHNICAL_SUPPORT folder for further details.Simon O'Doherty
Bryan, I can highly recommend that you install XPages Log File Reader as it gives you very easy access to those log files: openntf.org/main.nsf/project.xsp?r=project/…Per Henrik Lausten

2 Answers

1
votes

You want to remodel your application and use data binding instead of going after the document and controls manually. You might want to start with a tutorial, but here is the gist of it:

  1. Add a DominoDocument data source to your page
  2. Specify the form of your documents (that's actually only needed for convenience in Designer and for the case where you need/want to use .computeWithForm
  3. Design your form by binding your various controls to the DominoDocument data source. By default that binds it to a new empty document. Usually that's a good choice (see below)

Now, to actually edit an existing document with that XPage, do one of the following:

  • Open the Classic Form and specify in the beany head properties: Open XPage instead (there are 2 propeties: one for client one for browser). When you open a document with its classic URL it will open in XPage (?OpenDocument and ?EditDocument)
  • Add a viewControl to an XPage (the same page or a different one) where you show the documents to select. In the viewControl specify your XPage to be used to open documents
  • compute in what ever way you want the url to include documentID= which switches from new to display/edit mode (watch the URLs the view control is computing)
  • Switch the form to "Existing document" and compute the docid (uniqueid) of the document as property. Could be a lookup a scopeVariable or whatever you deem fit.

Let us know how it goes. Check out the XPages Cheatsheet for condensed information about all this.

0
votes

Thank you very much Simon. I was not aware of this place for errors. What I discovered was this:

Script interpreter error, line=6, col=5: 'doc' is null
     4: 
     5: var tmpOfficePhone = employee.getItemValueString("HR_OfficePhone")
->   6: doc.replaceItemValue("HR_OfficePhone",tmpOfficePhone);
     7: 
     8: var tmpCellPhone = employee.getItemValueString("HR_CellPhone")

The doc was null because I had a bad piece of code to get set the document. I had been using session.getCommonName but should have been using:

var usrNme = @Name("[CN]",session.getEffectiveUserName());

After replacing this line of code, everything worked. Thanks!!!