In this article I will demonstrate a technique for dynamically expanding and contracting viewPanel rows. This provides a nice clean interface for the user and allows content to be made visible as necessary. This article also highlights many of the core jQuery capabilities.
When moving from a notes client application to the web often times view columns can be large and unwieldy
A boring notes view
Unwieldy data view on an XPage
What we are going to do is not only neaten up the display but provide some simple user interactivity to allow access to data as needed. Here is a quick video of the capability in action.
You can see a working example of the capability on the xomino site. In Firefox and Chrome the fade effect look just fine but due to issues with alpha filters fade does not work consistently in IE.
How does it work?
As you can see from the pictures above, once we put our view into an xPage and display it on the web, the entire contents of the data field are displayed on the page. This can make for an irritating session with customer who don’t want to have to scroll page after page to find their information but want the same view to be available through the notes client.
Once solution would be to determine the medium through which your data is being viewed and truncate it accordingly. But I went another route and made a compromise where the data is available if the users wants it (adding functionality to the page without them having to click and open the document) but does not take up a large amount of space.
I added jQuery and jQueryUI (CSS not code) to my database through the WebContent folder and to my XPage like this
Select all the 4th column Table cells in the viewPanel and cycle through each of them
//select all elements (one in this case) where the id ends with (id$=) viewPanel1
//within that select all rows (tr)
//within that select all the table cells (td)
//within that select only the cells which are the 4th child element (:nth-child(4))
//cycle through each of them (.each(function(i)) where i is the nth item in the cycle
$("#[id$='viewPanel1'] tr td:nth-child(4)").each(function (i)
Because we have fixed the column width we are able to accurately ascertain the height of the cell contents on the page
As we then cycle through the viewPanel TD cells we determine if the cell contents are larger than 100pixels. If they are then we surround the contents with a wrapper with a fixed height.
//$(this) means each jQuery object (representing the TD as we cycle through the column
//.append is as it sounds - append to the end this SPAN (with the arrow in it)
//.children(:first) selects the first SPAN within the TD we are working on and
//.wrap means surround the SPAN with the DIV
$(this).append('<span class="ui-icon ui-icon-arrowthick-1-s"></span>').children(":first").wrap('<div class="wrapper" />')
ok trying to visualize what is going on we start with something which looks like this
We .append() another span
We then .wrap() the :first Child of the TD with a Div
And there you have it. We have looked at a broad range of jQuery capabilities and brought them all together to create a great looking interface for the end user. All these capabilities are part of the jQuery core and I only used jQueryUI to get the cute up and down arrows. If you wanted to use an icon there is nothing stopping you removing the jQueryUI dependency.
We have looked at jQuery Selectors
attribute selector $(“#id$=
class selector $(‘.wrapper
We have looked at DOM traversing and manipulation techniques
We have looked at attaching events to DOM elements
We have looked at object properties
We have looked at multiple visual manipulation capabilities
Oh duh, that is why Node Package Manager (npm) is so cool
Tue, Oct 14th 2014 9:07p Mark Roden I am in the process of playing with Bluemix and part of the reason or this is to learn more about node.js. It is really cool to learn something new and also to broaden the mind. But I digress – Node Package Manager (npm) makes using node.js so simple it is mind boggling…
Without going into masses of detail on node.js (which I might at some point) here is the simple example of what I am trying to do and why npm is so cool. Node Package Manager (npm) allows you to install any node [read] Keywords: application
Opening an XPage in XPiNC and passing Query_String parameters
Tue, Sep 30th 2014 7:22p Mark Roden I was very pleasantly surprised to find this works – coincidentally – twice this week someone has asked this question – can I open an XPage in XPiNC directly? I thought the answer was no……and not for the first (and/or last) time I was wrong.
The answer lies here – http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Domino_Designer_URLs_for_XPages
To prove it I created a plain XPage and added the firebugLite custom control
The following XPiNC URL
notes://copper/882579C [read] Keywords: ldd
What is a social presence worth?
Sun, Sep 21st 2014 7:51p Mark Roden We had an interesting discussion internally at work about what exactly does our “Social Presence” do for us? I put time and thought to it and it turns out to be a question I can answer on many levels. I am still not entirely sure what the answer is.
What does being social mean?
Being social means sharing through ideas, code, concepts, dreams….anything really – but sharing it. Within the XPages community we have a multitude of people who are social for many different r [read] Keywords: domino