361 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Would you like to play the Tree on a Truck game?
Tue, Nov 25th 2014 107
NotesIn9 168 – Updating Source Control for Page Controllers
Thu, Nov 13th 2014 210
NotesIn9 167: Learning XPages Part 8 – Working towards CRUD
Wed, Nov 12th 2014 184
NotesIn9 166: Learning XPages Part 7 – Company Controller
Tue, Nov 11th 2014 211
NotesIn9 165: Learning XPages Part 6 – Forms, Views and XPages
Tue, Nov 11th 2014 326
XPages and iOS8 Update #6 – The Fix is HERE!!!
Tue, Nov 4th 2014 309
XPages and iOS8 Update #5 – GOOD NEWS!!!
Fri, Oct 31st 2014 333
Top 10
NotesIn9 161: Designer Plugins
Tue, Oct 21st 2014 363
New iOS8 and Safari problem discovered.
Fri, Oct 24th 2014 342
XPages and iOS8 Update #5 – GOOD NEWS!!!
Fri, Oct 31st 2014 333
NotesIn9 165: Learning XPages Part 6 – Forms, Views and XPages
Tue, Nov 11th 2014 326
NotesIn9 160: Learning XPages Part 1 – Installing Designer
Sun, Oct 19th 2014 322
XPages and iOS8 Update #6 – The Fix is HERE!!!
Tue, Nov 4th 2014 309
NotesIn9 159: Introduction to Select2 in XPages
Wed, Oct 15th 2014 300
NotesIn9 164: Learning XPages Part 5 – Application Properties
Thu, Oct 23rd 2014 255
NotesIn9 162: Learning XPages Part 3 – Source Control
Tue, Oct 21st 2014 235
NotesIn9 163: Learning XPages Part 4 – Access Control Lists
Wed, Oct 22nd 2014 230


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



Recent Blog Posts
107


Would you like to play the Tree on a Truck game?
Tue, Nov 25th 2014 11:42a   David Leedy
It’s the time of year again. Every year my family plays a simple game to get into the holiday spirit.  It’s competitive and borderline cut-throat at times but at the core it’s simple.  We count the number of Christmas Trees that we see on cars and trucks.  By count I mean the first one who sees it and calls it gets a point.  And by calls it I mean the first person who shouts “TREE!” get’s that tree as a point.  It’s actually loads of fun while still [read] Keywords: xpages mobile
210


NotesIn9 168 – Updating Source Control for Page Controllers
Thu, Nov 13th 2014 2:58p   David Leedy
In today’s show I take a brake from the Learning XPages series and do a little demo on updating a project in source control.  So it kind of goes with the Learning XPages series but really isn’t part of it. The Learning XPages series is going on a little break while I work on a more important holiday project – but hopefully that project will turn into shows as well. As always let me know if you have any comments or questions. Thanks! [read] Keywords: notes xpages
184


NotesIn9 167: Learning XPages Part 8 – Working towards CRUD
Wed, Nov 12th 2014 2:26p   David Leedy
In this show I continue on to the goal of CRUD. CRUD stands for Create, Read, Update and Delete. By the end of this show we should be able to achieve all 4 actions against the Company document. I’ve not done anything to really make this app look pretty yet.  Honestly I’ve given the UI very little thought so far.  I’m trying to just focus on the core functionality at the moment so the UI stuff doesn’t distract.  I do want to better integrate Bootstrap to clean up the UI [read] Keywords: xpages
211


NotesIn9 166: Learning XPages Part 7 – Company Controller
Tue, Nov 11th 2014 7:12p   David Leedy
In this show I demonstrate how to setup and set using a Java “Page Controller”.  This is a technique that Jesse Gallagher came up with and I absolutely love.  Without a doubt it saved me a TON of work on a recent day job assignment.  There’s a little effort involved in setting it up but it’s so worth it in the long run. [read] Keywords: xpages java
326


NotesIn9 165: Learning XPages Part 6 – Forms, Views and XPages
Tue, Nov 11th 2014 6:20a   David Leedy
In this show we finally start coding.  Horaay!  I’m going to create a form and a couple views to start setting up how the data for the applicaiton will work and then I’ll go right into some Java which will act as a bridge between our application and the data that gets stored into the database itself. This show should be particularily good if you’re interested in starting to use Java with your XPages applications. Note: This episode was filmed a couple weeks ago when I was w [read] Keywords: xpages application applications database java
309


XPages and iOS8 Update #6 – The Fix is HERE!!!
Tue, Nov 4th 2014 6:15a   David Leedy
IBM has officially released an Interim FixPack to correct the Mobile Controls issue!  Horaay!  As I said in a previous blog we got this a tad early and have deployed it and that has corrected all the XPages specific issues of iOS 8 devices talking to our Mobile Controls application. Also in this fix are some other key security fixes for issues that’s been discussed heavily recently. Here’s the link.  Go get it! http://www-01.ibm.com/support/docview.wss?uid=swg21657963 It looks lik [read] Keywords: admin domino ibm xpages application mobile security twitter
333


XPages and iOS8 Update #5 – GOOD NEWS!!!
Fri, Oct 31st 2014 11:30a   David Leedy
Pete Janzen just tweeted this: I’m happy to say that we’ve been testing this fix for a little while and 2 days ago put it into production.  Yay!  This does seem to fix all the known XPages / Mobile Controls / iOS 8 issues. Sadly not that our Mobile Controls app works on iOS 8 we discovered a new issue that I blogged about the other day.  But that’s strictly an Apple problem.  Nothing to do with XPages. Sounds like it’ll be available next week. Big thanks to IBM for [read] Keywords: ibm xpages apple mobile




342


New iOS8 and Safari problem discovered.
Fri, Oct 24th 2014 6:10a   David Leedy
First let’s be clear what I’m posting about. This is NOT an IBM or XPages issue. This is specifically iOS8 and Safari. I posted on StackOverFlow with all the details. The skinny: I have an XPages app that uses a bluetooth Opticon Scanner No problems in iOS7 and Safari. iOS8 and Safari do NOT work well with the scanner. Characters are dropped. It’s not reliable. Using Chrome on iOS8 seems to work fine. I’ve no idea why or what the issue is. I posted on StackOverFlow and i [read] Keywords: ibm xpages apple bug mobile
255


NotesIn9 164: Learning XPages Part 5 – Application Properties
Thu, Oct 23rd 2014 6:41a   David Leedy
In this show we actually go into Designer and create a new database that we’re going to be working with for our application and I have a little discussion on some of the application properties that are useful for XPages Developement. Some Notes: This show is I believe the first in the new larger Full HD resolution of 1980×1020. This will let me get more on the screen but might be harder to see if you typically use a smaller device. Please let me know how this size works for you. Als [read] Keywords: notes xpages application database properties
230


NotesIn9 163: Learning XPages Part 4 – Access Control Lists
Wed, Oct 22nd 2014 6:12p   David Leedy
In this show I gave a brief introduction to Database properties and most importantly to Access Control lists for the database. There’s nothing really* here for the experienced Notes developer but if you’re new to the platform you might find the talk on the Access Control lists interesting. * Well there might be one little thing. [read] Keywords: notes xpages database properties




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