357 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Web Components – Entering the ShadowDOM….
Wed, Jul 9th 2014 177
Speaking at MWLUG 2014: Write once, run anywhere – Angular.js in XPages
Tue, Jul 8th 2014 224
Hi Chicago – what changed?
Wed, Jul 2nd 2014 250
Angular.js in XPages #6 – A People Manager CRUD application
Sun, Jun 1st 2014 409
Angular.js in XPages #5 – Routing
Sun, May 25th 2014 305
WebSockets comes to XPages!! Awesome – Awesome – Awesome
Tue, May 20th 2014 452
Angular.js in XPages #4 – Using Domino Data
Sun, May 18th 2014 385
Top 10
Arguably the most dangerous thing you could ever do in XPages – let other people use your eval() in their SSJS
Tue, Jun 18th 2013 1016
Why learning JavaScript is more critical to XPage developers than Java
Wed, Mar 26th 2014 919
An open letter to Mr. NotesIn9
Wed, Apr 2nd 2014 605
EXTJS in XPages #14 – Grid editing and saving data via REST CRUD
Thu, Aug 1st 2013 573
Adding custom HTTP headers to Domino R9 using IBM HTTP Server (IHS)
Sun, Apr 20th 2014 541
EXTJS in XPages #13: Totaling your columns with a groupingSummary
Sun, Jun 30th 2013 536
Angular.js in XPages #1 – Using the right IDE for development
Sun, Apr 27th 2014 498
And the gloves are off……
Mon, Mar 31st 2014 479
Why using XPages Partial Refresh is sometimes easy for developers and bad for users
Tue, Mar 4th 2014 470
Prototypal inheritance of SSJS across the whole server in XPages
Sun, Mar 2nd 2014 457


jQuery in XPages #7 – Pines Notify
MarkyRoden    

In this article I will demonstrate how to implement a cool notification technique using Pines Notify.  This small (7k min) js library provides a wealth of flexibility and a feature set second to none. It can use multiple different CSS libraries (bootstrap, jQueryUI and others) so integration into your site is quick and simple.

Introduction

Pines Notify is a notification popup capability which is easily integrated into a website. Like most jQuery plugins there is a methods to instantiate the capability and the ability to pass in multiple parameters.  There are certainly other popup style plugins but this is easy to grasp and the examples are very good.

We are going to look at how to make some complex function popups like these…

Examples of Pines Notify popups

Examples of Pines Notify popups

Demonstration

There are two demonstration pages this week

The first demonstration is a basic port of the Pines Notify buttons from the original example into an XPage.

The second demonstration shows how the Pines Notify could be used in a real application

Download 

Click on the link to download the complete jQuery in XPages demonstration database (including Pines Notify).

Pines Notify

Pines Notify provides a basic shell for popup creation and the capability for multiple custom configurations. A “popup” by default is created on the top right of the screen and disappears after a fixed period of time. The the position, CSS, length of time shown, transparency, contents, callbacks and other features can be controlled through the use of parameters. There are too many to mention in one article but they can all be seen at the example website.

Sample Notification

Sample Notification

Adding Pines Notify to an XPage

The Pines Notify download contains the .js files (readbale and minified) and a basic css file. These are easily added to our database as files in the WebContent folder.

Adding Pines Notify js and css fields to our database

Adding Pines Notify js and css fields to our database

Once we have added the js and css files to the database they can be added to our XPage as a resource(s)

	<xp:this.resources>
		<xp:script src="js/jquery.pnotify.min.js" clientSide="true"></xp:script>
		<xp:styleSheet href="css/jquery.pnotify.default.css"></xp:styleSheet>
	</xp:this.resources>

jQuery UI and jQuery

Pines Notify uses the jQuery library and jQuery UI CSS for display. These are added to the XPage as additional resources

	<xp:this.resources>
		<xp:script src="js/jquery-1.7.1.min.js" clientSide="true"></xp:script>
		<xp:styleSheet href="css/jquery.custom-theme/images/jquery-ui-1.8.18.custom.css"></xp:styleSheet>
	</xp:this.resources>

Using Pines Notify

Pines Notify has a basic format for activating. Here is a sample button from the website:

<button class="btn source" onclick="$.pnotify({
 	pnotify_title: 'Regular Notice',
 	pnotify_text: 'Check me out! I'm a notice.'
});">Regular Notice</button>

In this format the button does not work correctly when added to an XPage as it causes a page refresh when clicked. To turn this into an functioning button we must use an <xp:button> like this one

<xp:button value="xPages Lower Timer" id="button1" styleClass="btn source">
<xp:eventHandler event="onclick" submit="false">
	<xp:this.script>
		<![CDATA[$.pnotify({
			pnotify_title: 'Regular Notice',
		 	pnotify_text: 'Check me out! I'm a notice.'
		});]]>
	</xp:this.script>
</xp:eventHandler>
</xp:button>

The Pines Notify examples website gives us the code we need to create each button

Taking the sample code from the Pines Notify examples page

Taking the sample code from the Pines Notify examples page

And to convert this to our XPages button we just need to copy and paste this code and insert it into the <![CDATA[ code section above. Using this we can quickly and easily convert the examples into functioning XPages buttons.

Pinning Notifications

By default all Notifications have the ability to "pin" them to the screen. Should they contain information the user wishes to retain, they can do so

Pinning your notification

Pinning your notification

Closing Notifications

By default all notifications can be closed before they fade out using the X in the notification

Stacking notifications

Pines Notify notifications always stack on top of each other, so you never have to worry about position or overlaying issues, they will organize themselves nicely.

Showing all notifications

By default there is a bar added to the screen which allows user to see the last and/or all previous notifications.

Showing all previous notificaitons

Showing all previous notificaitons

Working this into XPages functionality

Javascript alert boxes have been used since the start of the web but they require a user click and an unnecessary interaction from the user if the point of the notification is just that – to notify the user of something.

In our XPages applications we could potentially notify the user after:

  • Successful REST update from the server
  • partialRefresh completion
  • form submission
  • Pager completion
  • General application workflow progress
  • Validation failure

really the possibilities are endless and really up to you the developer.

Examples

My demonstration site examples page has illustrated a number of buttons taken directly from the website and I have also added some notifications to the other jQuery in XPages examples (linked in through the menu).

On my second Demonstration page There are 4 simple examples of real application uses for Pines Notify

Dojo Toaster Widget

On the XPages server without the need for jQuery you can use the dojo toaster widget to provide a notification capability. You should take a look at Chris Toohey’s well written article on Mastering the Dojo Toaster for XPages to get a comparison.

Thanks

To Alan Hurt for pointing me in the direction of this plugin :)




---------------------
http://xomino.com/2012/04/24/jquery-in-xpages-7-pines-notify/
Apr 24, 2012
64 hits



Recent Blog Posts
177


Web Components – Entering the ShadowDOM….
Wed, Jul 9th 2014 9:18p   Mark Roden
Web Components – the future You should first ground yourself on Web Components and read this article on Web Components and concepts, ShadowDOM, imports, templates, custom elements by Todd Motto. Then listen to this Podcast (thanks to Steve for pointing it out) - Web Components with Peter Gasston Once you have read/listened you will have some idea and concept about Web Components and how they are the future….. But what I wanted to show briefly was how to enable the ShadowDOM in C [read] Keywords: agent javascript podcast
224


Speaking at MWLUG 2014: Write once, run anywhere – Angular.js in XPages
Tue, Jul 8th 2014 10:55a   Mark Roden
I am very fortunate and excited to announce that I have been accepted to speak at MWLUG 2014. MWLUG will always have a fond place in my heart because I had my first speaking session there back in 2012 and had such a fantastic time it pushed me to do more. I will speak speaking about Angular.js and the opportunity it avails us as Web Developers. We all know IBM Domino is arguably to world’s most secure and mature NoSQL database. So we will take a look at how we can use it like a NoSQL [read] Keywords: domino ibm xpages application applications database development server
250


Hi Chicago – what changed?
Wed, Jul 2nd 2014 7:16a   Mark Roden
Well it has been on the cards now for 6 months but we finally did it. My family and I moved from Virginia to Chicago and I have started working out of the PSC office in Schaumburg, IL. I was asked nearly 18 months ago if I would consider moving, but for mostly family reasons it took a year or so to organize and agree this was the right thing to do for my career and just as importantly for the family. Working at home has been wonderful for the past two years. But it was also a little limiting [read] Keywords: office
409


Angular.js in XPages #6 – A People Manager CRUD application
Sun, Jun 1st 2014 6:58p   Mark Roden
In this article I will bring together everything discussed in the first 5 articles and demonstrate how to create you first basic CRUD application using Angular.js and XPages. Previous articles Angular.js in XPages #5 – Routing Angular.js in XPages #4 – Using Domino Data Angular.js in XPages #3 – The first app Angular.js in XPages #2 – Setting up a Webstorm / Domino development environment Angular.js in XPages #1 – Using the right IDE for development Introduction In the last article w [read] Keywords: domino ibm ods R8 xpages application database development firefox iphone javascript properties server xml
305


Angular.js in XPages #5 – Routing
Sun, May 25th 2014 6:52p   Mark Roden
In this article I will show how angular using routing to create a bookmarkable URL string and how that fits together with additional controllers. This will start us on the path to creating our basic CRUD application. This article is based on the Routing and Multiple views tutorial  Routers Way back when the world was young (in internet terms a couple of years ago), when single page apps were all the rage, it was noticed that there was a significant drawback to only having one URL index.html; [read] Keywords: ibm xpages ajax application database xml
452


WebSockets comes to XPages!! Awesome – Awesome – Awesome
Tue, May 20th 2014 6:49p   Mark Roden
In this article I will introduce and discuss the OpenNTF WebSockets OSGI plugin by Mark Ambler. The websocket plugin posted to Mark Ambler is based on the http://java-websocket.org/ project. I realize I am not the first person to play with a websocket server on top of a domino database. I know of at least 4 other people who have at least done their own POC for this. But this is the first time I have got my hands on it :) I’m a little excited…… Playing websockets in XPages wit [read] Keywords: agent domino ibm notes rich text sametime xpages application community database integration java javascript network openntf server twitter xml




385


Angular.js in XPages #4 – Using Domino Data
Sun, May 18th 2014 6:36p   Mark Roden
In this article I will demonstrate how to use Angular.js to access Domino Data and display it in place of the hard coded data we used in the previous article. Introduction This article is based off the Angular developer tutorial on XHR and dependency injection . It is essential you go and read that article before continuing. It explains how dependency injection works, why it is used and about Angular services. Modifying the controller In our previous article we used a hard coded json string [read] Keywords: agent domino ibm ldd lotus lotusscript ods xpages ajax application database development java security server
390


Angular.js in XPages #3 – The first app
Sun, May 11th 2014 6:40p   Mark Roden
In this article I will recreate one of the simple Angularjs.org developer tutorials and relate it to how we would build an equivalent XPages application. Create the database As described in the previous article, set up a Domino database with an ODS. Then link your Webstorm to the new ODS structure. Download the Angular code from https://angularjs.org/ it will be an 8M download. Opening the zip file you will see a lot of “angular files”. These are “Dependency files” [read] Keywords: domino ods xpages application applications database development dojo google java server xml
328


Mastering XPages v2 – Review
Sat, May 10th 2014 8:55a   Mark Roden
In this article I will put forth my case as to why you need to buy Mastering XPages v2 – even if you already own v1 Introduction Maybe this book should be entitled – “So you think your an XPages expert? You are not a Master !” Clearly I am not a Master – and couldn’t possibly hope to be one and that is why *I* need this book….. The writing style Perhaps not the most obvious place to start but to me a significant one. There are many styles of writing for [read] Keywords: xpages application applications blogger community css development dojo java javascript mobile properties server
336


jQuery Promises – Taking action .when() multiple ajax calls are complete
Wed, May 7th 2014 6:52p   Mark Roden
jQuery.when() – “Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events” https://api.jquery.com/jQuery.when/ Wouldn’t it be nice to be able to know when two ajax calls are both complete – and then process the data returned from both, at the same time ? Callbacks Off the top of my head I would normally achieve this using a callback – and I have done so in some of my ExtJS in XPage [read] Keywords: xpages ajax




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