332 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
XPages Forum has been updated!
Fri, Jun 7th 2013 426
NotesIn9 115: XPages Data View Control Part 1 – Implementation
Wed, Jun 5th 2013 192
Live XPages Webinar today at 10 am EST on OpenNTF
Tue, Jun 4th 2013 187
I love what I do, and what I do is XPages
Fri, May 31st 2013 350
NotesIn9 Live coming to the OpenNTF Webinar Series!
Fri, May 24th 2013 187
NotesIn9 114: Using Wrappers with XPages
Thu, May 23rd 2013 274
NotesIn9 113: Learning to use XPages Mobile Controls
Wed, May 22nd 2013 219
Top 10
XPages Forum has been updated!
Fri, Jun 7th 2013 426
NotesIn9 107: Launch Attachments from a View Control
Wed, Apr 10th 2013 404
Treasure Map to Learning XPages and a NotesIn9 Episode Guide
Tue, Apr 23rd 2013 399
NotesIn9: 109 Selecting Multiple Documents with XPages Mobile Controls
Mon, Apr 22nd 2013 394
NotesIn9 106: Intro to Java Controller Classes
Mon, Apr 8th 2013 387
NotesIn9 108: XPages Mobile Controls Problem and Solution
Thu, Apr 18th 2013 383
I love what I do, and what I do is XPages
Fri, May 31st 2013 350
jQuery Mobile Seems incompatible with XPages in Domino 9.0
Sat, Apr 20th 2013 348
NotesIn9 112: XPages Mobile Controls Part 3
Fri, May 17th 2013 311
NotesIn9 is Back!
Sat, May 11th 2013 310


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
23 hits



Recent Blog Posts
426


XPages Forum has been updated!
Fri, Jun 7th 2013 6:52a   David Leedy
I know of 2 main resources to try and get specific help on XPages issues.  StackOverFlow.com and the XPages Forum. While StackOverFlow (SO) is clearly the best place to go with a specific question, it’s not the best place for every situation.  SO is geared more to very specific questions.  It’s not a place for higher level discussions. This is where the XPages Forum comes in.  It’s a specific site on developerWorks for XPages focused questions and talk.  I was very excite [read] Keywords: ibm ldd lotus xpages community development
192


NotesIn9 115: XPages Data View Control Part 1 – Implementation
Wed, Jun 5th 2013 7:08a   David Leedy
In this show Brad Balassaitis comes back on to give a great demo on how to get started using the Data View Control.  There’s a lot of power in the Data View Control and I highly recommend checking it out. In other news, recently I did a webinar for OpenNTF.org called “Getting Started with XPages”.  I presented that with Marky Roden and we want to thank those who attended. Niklas Heidloff has now posted the video, audio and slides to the presesentation.  Here’s the link [read] Keywords: xpages openntf
187


Live XPages Webinar today at 10 am EST on OpenNTF
Tue, Jun 4th 2013 7:03a   David Leedy
Today Marky Roden and I will be doing a Getting started with XPages Webinar for OpenNTF. This is a rare event because I typically don’t do many webinars do to lack of time.  But one does not simply pass on the chance to speak with Mark Roden. This session is geared for the person new to XPages or thinking about jumping into XPages.  We assume you know something about Notes Client or Domino Web development.  It really is true beginner / getting started focus but there might be some thing [read] Keywords: domino notes notes client xpages development openntf
350


I love what I do, and what I do is XPages
Fri, May 31st 2013 7:38a   David Leedy
So I’m sitting here in Midway airport in Chicago.  Kinda bored really so I thought I’d throw out some random crappy post because really, there’s probably not enough of those on the Internet. I’ve been rather busy recently, traveling to Anaheim, Washington D.C, Las Vegas, Orlando, Chicago, and I’m shortly going back to Las Vegas. Why am I doing all this travel?  For my day job, and let me tell you I have the best job in the world.  I get to work with completely aw [read] Keywords: ibm notes notes client xpages applications development java mobile openntf
187


NotesIn9 Live coming to the OpenNTF Webinar Series!
Fri, May 24th 2013 6:49a   David Leedy
One June 4th I will be participating in a Webinar from OpenNTF.org called “Getting Started with XPages”.  I’m really excited to be presenting with Dr. Marky Roden.  It’s always nice to be able to present with good friends. In addition to being an outstanding developer Marky also happens to be a stellar presenter. So it should be a fun time. I love doing what I can to support OpenNTF.  It’s a great community run website that is one of the best resources available [read] Keywords: xpages community email openntf
274


NotesIn9 114: Using Wrappers with XPages
Thu, May 23rd 2013 8:59a   David Leedy
In this show yet another NEW contributor comes on to share content with the community.  Today, Stephan Wissel, IBMer and blogger at wissel.net comes on the show for a discussion on a programming design pattern called “Facade” and how you might want to use this in your XPages development. [read] Keywords: xpages blogger community development




219


NotesIn9 113: Learning to use XPages Mobile Controls
Wed, May 22nd 2013 11:03a   David Leedy
In this show NotesIn9 not only gets a SUPER new contributor, but it also gets it’s first Nerd Girl!  In today’s show Kathy Brown comes on to do a demo on using the XPages Mobile controls from the Extension Library / Update Pack 1.  These controls are also built into Domino 9.0. In the demo she uses Designer to show you how to get started building a mobile app with the XPages Mobile Controls. I hope you like it. [read] Keywords: domino xpages mobile
311


NotesIn9 112: XPages Mobile Controls Part 3
Fri, May 17th 2013 6:58a   David Leedy
In this show Peter Presnell returns to conclude his 3 part series on XPages Mobile Controls.  Today he’ll cover outlines and Data Views. I also talk about the current OpenNTF.org Appathon Contest.  There’s a lot of prize money available so be sure to check that out as well. [read] Keywords: xpages mobile openntf
270


NotesIn9 111: Mobile Controls Part 2
Tue, May 14th 2013 7:21a   David Leedy
Peter Presnell comes back  today with Part 2 of his series on XPages Mobile controls.  In this show he’ll go through all the current controls provided with Ext. Library / UpdatePack / Designer 9 and define what they are and go through their key properties. [read] Keywords: xpages mobile properties
216


NotesIn9 110: Mobile Controls Part 1
Mon, May 13th 2013 8:01a   David Leedy
NotesIn9 is back!!  Yay! In today’s show, Peter Presnell, a past contributor comes on to start a 3 part series on Mobile controls.  In Part 1 he will give us a very basic introduction to the concepts around the mobile controls.  In Part 2 he’ll go through each design element. [read] Keywords: mobile




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