Categories
Notes In 9 Podcast XPages

NotesIn9: 031 Styling NamePicker with oneUI

In this show guest contributor John Jardin comes on to talk about using oneUI to style the Name Picker from the XPages Extension Library.

Thanks again to John for taking the time to contribute this tip. I’m really exicited to have him and a couple more great guests lined up for some upcoming shows.

Categories
Learning XPages Podcast XPages

NotesIn9 029: Combine URL Parameters with Excel Exporting

In this show I’m going to combine 2 tips from the XPagesCheatSheet which can be freely downloaded at xpagescheatsheet.com.

I take the Export to Excel example, and demonstrate how you can improve that by getting and using a parameter from the URL so the exported Excel document has only a subset of records.

Categories
Learning XPages Notes In 9 Podcast XPages

NotesIn9: 030 – Formatting Numbers in XPages

This is just a quick little show today to demonstrate a couple of ways to deal with formatting numbers on an XPage.

Nothing really fancy today. πŸ™‚

Categories
Extended Edition Notes In 9 Podcast XPages

NotesIn9: EE 008 – XPages: One Man’s Journey

NotesIn9 Week continues with this episode in which Graham Acres comes on as a guest to talk about how he got started using XPages. I want to thank Graham very much for taking the time to record this presentation for NotesIn9.

Graham will talk about his journey into learning this new technology and then will show off a couple of interesting demo’s and tips.

When I first heard of this presentation, which I think he did for a Canadian user group, I thought that this might be really inspirational. Everyone who starts out learning XPages struggles with it. The first several weeks are the hardest. The way to get past that is to not get frustrated. Realize there is a roadmap to improving your skills and that you’re not alone out there. There are now a lot of great resources out there for XPages information. Here’s just a couple:

XPages.Info
XPagesWiki.com
XPages Forum
XPages Blog
Designer Wiki
XPagesCheatSheet.com
XPages101.net
XPages.TV
OpenNTF.org
TLCC.com

Again, a big thanks to Graham for his presentation.

Categories
Extended Edition Notes In 9 Podcast XPages

NotesIn9: EE 009 – Using Java HashMaps and TreeMaps with XPages

In this show I talk and demo ways to use Java HashMaps and TreeMaps with your XPages applications.

 

UPDATE: April 11, 2016 –

I was just now reviewing this older show. Β I see one thing in the code that might work but I don’t think is quite right.

var myList:java.util.HashMap = new java.util.HashMap

That appears to be missing the “()” at the end. Β It really should look like this:

var myList:java.util.HashMap = new java.util.HashMap()

 
and of course it’s a Map and not a List so a better variable name might have been “myMap”.

Categories
Learning XPages Notes In 9 Podcast XPages

NotesIn9: 28 XPages and CGI Variables

In this show I demo one way to access CGI variables inside your XPages applications.

I hope it’s helpful.

Categories
XPages

XPages Gut Check

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();
}

}
});

Categories
Notes In 9 Podcast XPages

NotesIn9 026: Collapsing and Expanding Views in XPages

Here’s a quick little show that I threw together last night. Was talking to someone who had a question on how to do a Collapse All/Expand All for a view control and it turns out to be WAY more difficult then it should. I’ll maintain there are better UI constructs to do this but he wanted to stick with a view control. So here goes.


Some links from the show:

Original Forum thread from 2009

JavaDoc Information

Stephan Wissel’s solution

Categories
Learning XPages Notes In 9 Podcast XPages

NotesIn9 025: Selecting Documents from inside a Repeat Control

When you use a view control there is a simple action for working with selected documents. In SSJS there is a method, getSelectedIDs (or something like that), that let’s you get a handle on any selected documents. However neither of these solutions exist for documents inside a Repeat Control.

In this show l will demonstrate how have a repeat control and get a handle on any documents that the user selects.

I’m TRYING to improve the site… It’s slow going.

P.S. This is the 25th episode of my normal NotesIn9 show. πŸ™‚ All the XPages shows, the XPages Jumpstart and the Extended Editions can be found easily at xpages.tv

P.S. Ok. I’ll admit it. I did have a thought on doing some April Fools Joke here. Maybe a Rick Roll – but then I thought that the “Rick Roll” has run it’s course. Maybe that “Friday” song should be the new Rick Roll? But don’t worry. This video is safe! πŸ™‚

P.P.S If you have a Mac… and Kids… a great April Fools prank is to ssh into the mac from an iPad or other device and use the “Say” command. Great fun. I had my kids thinking their Mac was Watson’s cousin. πŸ™‚

Categories
Learning XPages Notes In 9 Podcast XPages

NotesIn9: 23 – The Great XPages Race

This is a special show that I started last night to basically respond to a couple of blog posts from Jake Howlett at codestore.net.

Post 1
Post 2

I believe that XPages is RAD. I pretty much did the building in 3:45 give or take a second or two. It might be interesting to spend another 5 minutes to add things like security, validation and mobile controls to make it truly production ready.

Again – this is just an all in fun kinda thing. There are pros and cons to any platform.