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
An open letter to Mr. NotesIn9
Wed, Apr 2nd 2014 6:33a Mark Roden Dear Mr Leedy,
I regret to inform you that your blatant use of child labor has offended my child labor union. They do not feel like you have represented me in the correct light.
I trust that you will find this short response in the same light as your original offense.
Your very good friend Marky Roden
CC: everyone who has seen this video
And the gloves are off……
Mon, Mar 31st 2014 5:57p Mark Roden Picture this: I have been away for 5 days and during that time “someone” has been posting cryptic comments on twitter about how the next notesin9 is going to be different….and scaring me.
So I am waiting at the airport this afternoon, about to board my plane home and I get this link from this “friend” who tells me to watch the new video it and enjoy. I download it and watch it on the plane. People start to look at me funny as I start to snort and giggle at my phone. [read] Keywords: ibm
When the community comes together we get the right answer
To give a little more background as to why I decided to post: I was not to be antagonistic or instigate a storm in a tea cup. It was because for the third time in 2014 I had been told by a notes developer something along the lines of “I can’t learn XPages because I have read that you need to learn Java and I do [read] Keywords: notes
PATCHing a Document using Domino Data Service
Mon, Mar 24th 2014 7:11p Mark Roden Talk about frustrating – in a week full of slow progress and CORS cross domain hell I found this little annoyance after hours of staring and curing – once again the power of trial and error triumphs over my stupidity again.
I have a Domino Data Service running on the server and I want to update a document
This is the imaginary URL
returning the imaginary data just fine
"@href": [read] Keywords: domino
How to ad icons to individual items in a Select2 multi-value field
Tue, Mar 18th 2014 8:08p Mark Roden Select2 is one of the best user interface enhancers I have come across – if you do not know what it is then you need to go play with it.
It transforms SELECT boxes into dynamic, stunning, interactive UI elements and allows for all sorts of customizations and developer fun.
What I want to be able to do is select items from different categories within the select2 box and then add an icon displaying to the user which category they came from. In this article I will show how.
I want to [read] Keywords: css
My ongoing struggle with stupidity and what is not valid JSON
Sun, Mar 16th 2014 6:06p Mark Roden So this was a frustrating lesson to learn – and please feel free to be entertained by my apparent stupidity.
I was trying to create my own JSON with an xAgent – seems easy enough. I created a simple output which looked like this
and when I fed it through my AJAX code it failed.
//url: 'http://coppe [read] Keywords: ajax