358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
iOS 8 Breaks XPages Mobile Controls
Fri, Sep 19th 2014 255
Apple’s iOS8 Breaks uploading Photos
Fri, Sep 19th 2014 225
Big NotesIn9 news coming next week
Fri, Sep 19th 2014 274
NotesIn9 154: Java based Debug Control Part 2
Mon, Sep 15th 2014 108
NotesIn9 153: Java based Debug Control Part 1
Mon, Sep 15th 2014 155
NotesIn9 155: Java based Debug Control Part 3
Mon, Sep 15th 2014 114
NotesIn9 152: JSON and Java
Sun, Sep 7th 2014 294
Top 10
NotesIn9 151: Bootstrap ProgressBars in XPages
Sun, Aug 10th 2014 411
NotesIn9 136: Using XPages with Bootstrap 3 and FontAwesome
Fri, Jan 17th 2014 364
NotesIn9 Celebrates 5 years of ScreenCasting and ALMOST 150 Episodes
Sun, Jul 27th 2014 361
Changes for NotesIn9
Sun, Sep 7th 2014 349
NotesIn9 148: Getting XPages to talk to your phone
Mon, Jul 28th 2014 316
NotesIn9 152: JSON and Java
Sun, Sep 7th 2014 294
NotesIn9 149: Database Resources and Design Definition
Tue, Jul 29th 2014 288
Shockingly I just did some cool CSS!
Thu, Aug 7th 2014 275
Big NotesIn9 news coming next week
Fri, Sep 19th 2014 274
iOS 8 Breaks XPages Mobile Controls
Fri, Sep 19th 2014 255


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
255


iOS 8 Breaks XPages Mobile Controls
Fri, Sep 19th 2014 4:15p   David Leedy
You can’t click.  You can’t do a thing.  I believe it’s a dojo thing but I’m not sure. I’m about to test FP2 and will update this post. This… is  BAD!! [read] Keywords: xpages dojo mobile
225


Apple’s iOS8 Breaks uploading Photos
Fri, Sep 19th 2014 2:21p   David Leedy
In the day job I have users that use an iPad to upload photos to an XPages application. I just learned today that this breaks with iOS8.  More information can be found here: http://www.mobilexweb.com/blog/safari-ios8-iphone6-web-developers-designers http://stackoverflow.com/questions/25790873/uploading-files-over-http-fails-on-ios-8-gm-safari http://blog.uploadcare.com/post/97884147203/you-cannot-upload-files-to-a-server-using-mobile-safari I’m hopeful this is a BUG that will be fix and [read] Keywords: domino xpages apple application bug mobile server
274


Big NotesIn9 news coming next week
Fri, Sep 19th 2014 11:40a   David Leedy
It’s time… [read] Keywords:
108


NotesIn9 154: Java based Debug Control Part 2
Mon, Sep 15th 2014 6:50p   David Leedy
In this show Greg Reeder, XPage developer returns for part 2 of his series to talk some Java programming and how you might be able to use it to build a logging control for errors and messages. This is the second of a 3 part series from Greg which I’m publishing all at once due to the length and complexity of the information. [read] Keywords: java
155


NotesIn9 153: Java based Debug Control Part 1
Mon, Sep 15th 2014 6:44p   David Leedy
In this show Greg Reeder, XPage developer and new contributor joins the show to talk some Java and how you might be able to use it to build a logging control for errors and messages. This is the first of a 3 part series from Greg which I’m publishing all at once due to the length and complexity of the information. [read] Keywords: java
114


NotesIn9 155: Java based Debug Control Part 3
Mon, Sep 15th 2014 6:03p   David Leedy
In this show Greg Reeder, XPage developer returns for part 2 of his series to talk some Java programming and how you might be able to use it to build a logging control for errors and messages. This is the third of a 3 part series from Greg which I’m publishing all at once due to the length and complexity of the information. [read] Keywords: java
294


NotesIn9 152: JSON and Java
Sun, Sep 7th 2014 5:18p   David Leedy
In this show Frank van der Linden, another brand new contributor comes on to give us a little demo of using JSON and JAVA in XPages.  If you look closely you might even see a little Connections going on. [read] Keywords: connections xpages java
349


Changes for NotesIn9
Sun, Sep 7th 2014 1:56p   leedy
Well if you’re seeing this you probably already know what the news is.  I’ve made some big changes to my blog. I’ve moved to a new host, upgraded to WordPress 4 and am playing with a new theme. I want to thank Chris Miller for hosting my blog since almost the very beginning of NotesIn9.  He really stepped in and saved me when I had problems with my original setup. In addition to the new theme, (which might change later) I’ve updated the About page and some of the links [read] Keywords:
241


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
411


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




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