354 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
NotesIn9 142: Adding a “Please Wait” to XPages
Mon, Apr 7th 2014 246
Wow! Show 141 Recap/
Wed, Apr 2nd 2014 219
NotesIn9 141: Java vs JavaScript Throwdown
Mon, Mar 31st 2014 344
NotesIn9 139: SourceTree Deep Dive
Mon, Mar 24th 2014 207
NotesIn9 139: XPages Single Copy Design
Fri, Mar 21st 2014 341
NotesIn9 138: XPages Combobox Improvements
Thu, Mar 13th 2014 367
NotesIn9 137: XPages and Web Services
Tue, Mar 4th 2014 294
Top 10
NotesIn9 136: Using XPages with Bootstrap 3 and FontAwesome
Fri, Jan 17th 2014 462
NotesIn9 138: XPages Combobox Improvements
Thu, Mar 13th 2014 367
NotesIn9 141: Java vs JavaScript Throwdown
Mon, Mar 31st 2014 344
NotesIn9 139: XPages Single Copy Design
Fri, Mar 21st 2014 341
NotesIn9 137: XPages and Web Services
Tue, Mar 4th 2014 294
NotesIn9 142: Adding a “Please Wait” to XPages
Mon, Apr 7th 2014 246
Wow! Show 141 Recap/
Wed, Apr 2nd 2014 219
NotesIn9 139: SourceTree Deep Dive
Mon, Mar 24th 2014 207
NotesIn9 135: Using Java in XPages Part4
Thu, Jan 16th 2014 185
NotesIn9 134: Using Java with XPages Part 3
Tue, Jan 14th 2014 171


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)
//print(size);

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”);
//print(key);
var status = true
var temp = 2
}
else
{
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();
}

}
});



---------------------
http://feedproxy.google.com/~r/NotesIn9/~3/X7kmLW2LCNE/
Jun 10, 2011
20 hits



Recent Blog Posts
246


NotesIn9 142: Adding a “Please Wait” to XPages
Mon, Apr 7th 2014 7:47a   David Leedy
In this show it’s back to XPages and demos!  I will do a quick recap on the last show as 141 seemed REALLY popular but then it’s back to work.  In this show I demo a quick tip on how you can use CLIENT SIDE JavaScript to show the user the server is processing. [read] Keywords: notes xpages javascript server
219


Wow! Show 141 Recap/
Wed, Apr 2nd 2014 5:25p   David Leedy
I’ll admit I was a little nervous about the last show.  It’s been a long time since I got a little “Rowdy” on the show.  Maybe too long. First I want to thank everyone for all the feedback via comments, Twitter, Facebook, etc.  I think this is the first NotesIn9 that someone (Russ Maher) actually live tweeted while watching. Thanks for the kind feedback to my kids as well.  We all had a good time making the show.  Though I am worried they might actually want to Union [read] Keywords: domino xpages community facebook sharepoint twitter
344


NotesIn9 141: Java vs JavaScript Throwdown
Mon, Mar 31st 2014 3:48p   David Leedy
This is a VERY DIFFERENT NotesIn9.  It’s less of a normal show and more if a response to a recent blog post regarding one persons opinion on the value of Java in XPages and the Value of the UI vs the backend. Actually this show is more of a really long “rant”. This show could absolutely suck.  I pretty much broke all my rules and tried to have fun with it.  I do give my thoughts on things so maybe there’s at least a little value there. There’s no Demo.  There is [read] Keywords: xpages java javascript
207


NotesIn9 139: SourceTree Deep Dive
Mon, Mar 24th 2014 6:23a   David Leedy
In this episode Paul Withers comes back on the show for a deeper look at using SourceTree and Git Flow. This comes from the session he did with Declan Lynch at IBM Connect.  In that session they ran out of time so this should fill in some of the missing pieces that they didn’t get to cover. I use SourceTree and HG Flow which is the Mercurial version of Git Flow in my Day Job all the time.  While there are some quirks due to Designer and you do need to be careful and understand what̵ [read] Keywords: ibm notes iphone
341


NotesIn9 139: XPages Single Copy Design
Fri, Mar 21st 2014 1:08p   David Leedy
In this show, Andrew Barickman, a great new contributor comes on to talk to use about the performance benefits of the “Single Copy Design”.  He focuses on the performance benefits, not only for a web application but also for XPages In the Notes Client – XPiNC. [read] Keywords: notes notes client xpages application
367


NotesIn9 138: XPages Combobox Improvements
Thu, Mar 13th 2014 1:12p   David Leedy
In this show I take a look at using a Combobox inside XPages.  I’m going to demo how to use Java – but it’s NOT scary Java – I show you everything. We’re going to show the user a pretty value in the combobox but get a hold of and store the key value for our use. I’m also going to show how you can create categories inside the combobox. That’s kinda cool I think depending on your situation. [read] Keywords: xpages java




294


NotesIn9 137: XPages and Web Services
Tue, Mar 4th 2014 11:50a   David Leedy
In this show, new contributor, Fredrik Norling comes on to give a neat demo on how to use Web Services with XPages. The demo database and code will be available on his website as well as OpenNTF.org. [read] Keywords: notes xpages database openntf
462


NotesIn9 136: Using XPages with Bootstrap 3 and FontAwesome
Fri, Jan 17th 2014 11:50a   David Leedy
Ok enough Java.  We need something that even Marky Roden might like! In this show Tim Tripcony returns to end out “Tim Tripcony week” on NotesIn9.  He’l give a demo on how you can start using Bootstrap 3 and Font Awesome with your XPages applications.  He’ll do so by using themes and a content delivery network. Really good stuff!! [read] Keywords: xpages applications java network
185


NotesIn9 135: Using Java in XPages Part4
Thu, Jan 16th 2014 6:54a   David Leedy
Tim Tripcony returns again for another great show in his Java series.  Today he’ll be introducing the concept of a “MimeBean”.  A “MimeBean” gives the ability to save Java Objects inside a notes field.  It opens up many new possibilities for storing data in your applications. Not to be missed! [read] Keywords: notes xpages applications java
171


NotesIn9 134: Using Java with XPages Part 3
Tue, Jan 14th 2014 6:42a   David Leedy
n this show Tim Tripcony continues his series of exploring the use of Java with your XPages application.  Today’s show discusses linking buttons to Java, dealing with ReadOnly properties and how to deal with explilcit getters and setters – but only when you want to! There’s even a little more Bootstrap goodness in here! [read] Keywords: xpages application java linking properties




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