357 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
Latest 7 Posts
NotesIn9 PDF Edition: Using Resource Bundles to store config information in XPages
Mon, Aug 25th 2014 173
NotesIn9 151: Bootstrap ProgressBars in XPages
Sun, Aug 10th 2014 376
Shockingly I just did some cool CSS!
Thu, Aug 7th 2014 248
NotesIn9 150: Announcing fileVault for XPages
Sat, Aug 2nd 2014 161
NotesIn9 149: Database Resources and Design Definition
Tue, Jul 29th 2014 260
NotesIn9 148: Getting XPages to talk to your phone
Mon, Jul 28th 2014 283
NotesIn9 Celebrates 5 years of ScreenCasting and ALMOST 150 Episodes
Sun, Jul 27th 2014 325
Top 10
Tim Tripcony
Mon, May 12th 2014 838
NotesIn9 136: Using XPages with Bootstrap 3 and FontAwesome
Fri, Jan 17th 2014 664
Tim Tripcony – Rest in Peace my friend
Fri, May 16th 2014 603
The Great XPages Mystery Solved.
Thu, May 8th 2014 586
NotesIn9 138: XPages Combobox Improvements
Thu, Mar 13th 2014 575
NotesIn9 141: Java vs JavaScript Throwdown
Mon, Mar 31st 2014 559
NotesIn9 139: XPages Single Copy Design
Fri, Mar 21st 2014 546
XPages: The Best of Times,The Worst of Times
Wed, Apr 23rd 2014 480
Announcing the Eastern PA Meetup and XMage Memorial
Wed, May 14th 2014 478
NotesIn9 142: Adding a “Please Wait” to XPages
Mon, Apr 7th 2014 414

XPages Gut Check
David Leedy    

I got some bad XPages news today… where I’m doing something that works today… that I feel I should be able to do.. it’s not really that fancy.. but learned that it’s very possible that what I’m doing might not work in the future. :-(

Here’s the issue. If you look at this XPage from xpagescheatsheet.com:

You’ll see a list of contacts in a repeat control. Yes this is an UGLY page. But the inside of the repeat is being generated from a SSJS Object. Why? I wanted to seperate my data from the UI structure. I’ve included that code at the bottom of this post.

What’s a SSJS Object? We’ll I’m just a small town Notes Client Developer at heart. But there is a way to use SSJS similar to a LotusScript Custom Class. I like that. It’s “comfy”. So my SSJS Object can basically have properties and methods/functions.

I demonstrated this technique in my Introduction to XPages Video (Part 2). Skip to minute 42ish to see what I’m talking about.

Anyway – what I’ve learned today.. is that this type of object – which works totally fine in sessionScope today… does not work in viewScope. (I’ve not ever tried that actually). In addition I learned that it’s very possible that this technique will no longer work in sessionScope in the future.

Why? I don’t know. It has to do with “Serialization”. Honestly I don’t know what that means. viewScope is strict about this.. sessionScope “overlooks” this… for now.

The best solution is to “Suck it up, Learn Java and use Managed Beans”. And while I agree that is the best way to go, I feel a little bummed that I’m forced to go the Java path and that SSJS can’t handle something that LotusScript did so very well.

Anyway… this might not be a huge deal.. I don’t know.. Maybe I’m the only one really trying to do this. I am certainly not the best XPages/JavaScript dev in the land. Far from it actually. I just liked learning and working with SSJS in a similar way that I used LotusScript. It helped me with the transition.

I will say that I did reach out to someone from IBM, and very quickly got a nice response giving me details on this and even a potential workaround. I’ve not fully digested that information yet, but I very much appreciate the IBMers that took the time to get involved!

I’ll be playing with this stuff this weekend, but I think the moral is that XPages development, unfortunately, needs more Java skills then I originally thought, and more then I would have wanted. :(

Here is the code structure of the SSJS object:

var contactDoc = (function contactDoc(key) {

// Key really needs to be a string here. Convert it before it gets passed in.

//Pull data from External Datbase
// Here are the Database and View Names
var dbName = “FakeNames.nsf”;
var viewName = “ByName”;
// I assume that the database we’re looking up is in the SAME PATH as the current db
var path = database.getFilePath().split(database.getFileName())[0];
var fullDB = path + dbName
var lookupDB:NotesDatabase = session.getDatabase(database.getServer() , fullDB);
//var vLookup:NotesView = lookupDB.getView(viewName);

//print(“key=” + key);

var size = @Length(key)

if (size > 15)
//This is a Unid
var unid = key;
var contactDoc:NotesDocument = lookupDB.getDocumentByUNID(unid);
var contactKey = contactDoc.getItemValueString(“number”);

var temp = 1
var status = true
else if (size>1 && size <= 15)

// Key must be an @Unique or ProjectKey
var lookup:NotesView = lookupDB.getView(“ByNumber”);
// print(lookup.getSelectionFormula());
var contactDoc:NotesDocument = lookup.getDocumentByKey(key, true);
var unid = contactDoc.getUniversalID();
var contactKey = contactDoc.getItemValueString(“number”);
var status = true
var temp = 2
var status = false
var contactKey = “”
var temp = 3

return {
getUNID: function() {
return unid;
getKey: function() {
return contactKey;
getFirstName: function() {
return contactDoc.getItemValueString(“firstname”);
getLastName: function() {
return contactDoc.getItemValueString(“lastname”);
getFullName: function() {
return this.getFirstName() + ” ” + this.getLastName();


Jun 10, 2011
37 hits

Recent Blog Posts

NotesIn9 PDF Edition: Using Resource Bundles to store config information in XPages
Mon, Aug 25th 2014 2:46p   David Leedy
I’m really excited to have a NEW contributor today.  Please welcome Dan Soares to the show!  Well kinds of at least.  I’ve been trying to get him on for a LONG time and while I’ve yet to get a video I have received from him a great article and sample database on using resource bundles in XPages. Thanks Dan! P.S. If your company blocks videos either from this site or YouTube, please print this article out on the company printer, read it on company time and have a little chu [read] Keywords: xpages application database

NotesIn9 151: Bootstrap ProgressBars in XPages
Sun, Aug 10th 2014 6:51p   David Leedy
In this show I demonstrate how to build some XPages custom controls to make a Bootstrap ProgressBar and stacked ProgressBar. I also mention Daniel Friedrich’s blog at http://xpagesandme.wordpress.com/.  I highly recommend you check that out. [read] Keywords: notes xpages

Shockingly I just did some cool CSS!
Thu, Aug 7th 2014 11:23a   David Leedy
Let’s face it…  I suck at CSS…  You know it.  I know it.  My dog knows it.  However with the magic that is StackOverFlow I just did some useful CSS that I wanted to share. In an app I wanted to have 3 buttons in a row.  Since this is an iPad app I wanted to make the buttons myself so the tab zone is bigger.  I wanted to put some space in between the buttons so I first had: margin-right: 15px; This got annoying because the last button didn’t need to have that margin [read] Keywords: css

NotesIn9 150: Announcing fileVault for XPages
Sat, Aug 2nd 2014 1:18p   David Leedy
This is a different show today.  I’m going to be speaking at MWLug at the end of August.  In this show I’m going to do a little demo of what I intended to present at MWLug.  I’m not going to tell you HOW to do it yet, you’ll need to come to see that.  Or wait for it to hit a future NotesIn9. In addition to the commercial, I’ve taken a small clip from my show 100 (which ran WAY too long).  In this clip I give suggestions on how to get more involved in the XPages [read] Keywords: notes xpages community

NotesIn9 149: Database Resources and Design Definition
Tue, Jul 29th 2014 6:55a   David Leedy
In this show IBM Champion and everyone’s second favorite Doctor returns to NotesIn9.  That’s right, Dr. Marky Roden is in the house with a GREAT tip on ways to speed up Domino Designer by using Design Definition to better control your database resources. We last saw the good Doctor back on September 13th, 2012, Episode 74,  talking about using jQuery. Don’t miss todays demo.  You never know if he’ll disappear for another 684 days again. === Also yesterday I mentioned t [read] Keywords: domino ibm notes database

NotesIn9 148: Getting XPages to talk to your phone
Mon, Jul 28th 2014 6:12a   David Leedy
Today we get another great contributor in the form of Oliver Busse. His website is oliverbusse.com.  He’s going to do a really neat demo of how to intergrate XPages with Pushover.net to send messages to a phone that has the PushOver App installed. I think that it’s always nice to see how to mix XPages with other services. [read] Keywords: xpages


NotesIn9 Celebrates 5 years of ScreenCasting and ALMOST 150 Episodes
Sun, Jul 27th 2014 7:03p   David Leedy
On July 11, 2009 I uploaded the first ever NotesIn9 to YouTube.  The topic was this brand new concept in XPages called “Repeat Controls”. 5 years and 260,000ish downloads later and with the help if MANY people I’ve published 147 episodes so far and WILL hit 150 this week, and maybe even more. Not too shabby for a little show based mostly on XPages I think. As always I want to thank all the contributors to the show.  Without them I could never have gotten this far. Thanks for [read] Keywords: notes xpages

NotesIn9 147: Using dGrowl with XPages
Tue, Jul 22nd 2014 6:30a   David Leedy
In this show Brad Balassaitis returns to Ni9 to give us some great instruction on how to start using the “dGrowl” project with our XPages applications.  This is a tool that lets you popup messages back to the user. It’s a somewhat common effect and I really really like it.  Actually before I got this demo from him I was attempting to do something similar inside Bootstrap4XPages and now I might try and switch to dGrowl for the additional features. In addition to using dGrowl t [read] Keywords: notes xpages applications dojo

NotesIn9 146: Going Mobile with Bootstrap
Tue, Jul 8th 2014 11:14a   David Leedy
In this show, we get another great new contributor joining the NotesIn9 family.  Please welcome Sean P McManus to the show. His blog is: http://spmcmanus.net  I’m really excited to get Sean on as he gives us a great demo on using Bootstrap for an XPages mobile focused application. Sean manually added Bootstrap to his application.  Another option is to use a great project on OpenNTF to do this for you via an update site. http://bootstrap4xpages.openntf.org/ http://bootstrap4xpages.com/ A [read] Keywords: notes xpages application java mobile openntf

NotesIn9 145: Simple Feedback in XPages
Thu, May 29th 2014 4:57p   David Leedy
This is the last show I have from Tim Tripcony.  This is probably the simpliest demo he’s done for Ni9 but no less important.  It’s a demo of a way to return a message to a user based on an action. Tim actually gave me this demo maybe a year ago and I just totally forgot about it and I assume he then did as well. While I hate the thought of forgetting about it I think it makes this show a little special.  I was so happy to discover it when I went through our shared dropbox. #cod [read] Keywords: xpages

Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition