One of my co-workers, Neil Enet, asked me the other day if it was possible to set up a view but prohibit the users from opening the documents. I tossed out the idea of using an HTML table with all the HTML for the rows and cells being computed in one column of a view.
"<tr><td>" + approverName + "</td><td>" + approvalType +"</td><td>" + description"</td></tr>"
Unfortunately, that’s pretty clunky and not very satisfying. So, as we talked, I said, “Hey, how about you create an XPage with a view and just don’t make any of the columns clickable?” So, he did.
I asked Neil to comment on it, and he had some great thoughts:
My first XPage. I’ve never competed on a race before, but I imagine the feeling of winning one as being pretty similar to seeing this XPage for the first time. And OK, let’s be honest, it’s a pretty simple XPage. “Simple” might be too much of a word, actually. It’s just a view. ONE view.
The process was extremely easy. I just dragged the View Control, linked it to the view in Notes that I wanted, and voilà. I changed the font size and color of each column, and that felt like an even more awesome achievement.
The funny thing is I’m sure that if I never had the need to create a view like this, where users weren’t able to open documents, this wouldn’t have been so fulfilling. I can see myself saying: “Great, I just created a view, and you can’t open any docs. What’s the big deal about THAT?” But it turns out that that’s exactly what I needed. So simple! And to think that Old Notes didn’t allow me to do this, and that I had to go down the “terrifying” XPages way. Ha!
I can’t think of a better way to start playing with XPages. I now know I can do one, and I know I’m being very naive if I say “XPages is a piece of cake”, but there it is on my system, and I’m sure it will not be the only one.
I’m looking forward to creating more complex XPages, and it’s very very exciting. I might just take a picture of my XPage and put it next to my wife’s here on my desk. And when people walk by and ask me what that is, I’ll answer: “That’s the most simple XPage in the world. But you know what? It’s MY simple XPage.”
<?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core"> <xp:viewPanel rows="30" id="viewPanel1"> <xp:this.facets> <xp:pager partialRefresh="true" layout="Previous Group Next" xp:key="headerPager" id="pager1"> </xp:pager> </xp:this.facets> <xp:this data> <xp:dominoView var="view1" viewName="COPApprovals"></xp:dominoView> </xp:this.data> <xp:viewColumn columnName="$11" id="viewColumn1" style="font-weight:bold;color:rgb(0,0,160)"> </xp:viewColumn> <xp:viewColumn columnName="$10" id="viewColumn2" style="font-weight:bold;color:rgb(0,64,0)"> </xp:viewColumn> <xp:viewcolumn columnName="$12" id="viewColumn3"> </xp:viewColumn> </xp:viewPanel> </xp:view>
Then, to get users to access it from their Old Notes, using an Outline Entry to open the URL….
targetXpage := "internalApprovals.xsp"; server := @Subset ( @DbName; 1 ); path := @Subset ( @DbName; -1 ); fserver := @Name([CN]; server); fpath := @ReplaceSubstring(path; "\\"; "/"); url := "notes://" + fserver + "/" + fpath + "/" + targetXpage; url
And now, Neil has developed his first XPage, users will be able to see status on their documents and everyone will be happy. (Well, I’ll be happier once he goes back in and names the columns in the old view, gives better IDs to the XPage viewColumns, puts it all onto an application layout control and makes everything pretty, but, it works!)
So, if you’re still in fear of XPages, you needn’t be. Go forth and be LOST IN XPAGES with the rest of us!