361 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Multiple Chrome Incognito browsers share the same data
Sun, Nov 23rd 2014 173
x$ – now a part of XPages Extension Library
Tue, Nov 18th 2014 241
Got non-XPages design elements? You really should use WebContent.
Mon, Nov 17th 2014 266
XPages and Bluemix: How to create a Websockets message without being connected to the application
Sun, Nov 16th 2014 258
One way to make a responsive XPages viewPanel
Tue, Nov 11th 2014 307
Creating an XPages Websockets chat client using Bluemix
Sun, Nov 9th 2014 1144
Finding your localStorage values – Chrome Developer Tools
Thu, Nov 6th 2014 152
Top 10
Creating an XPages Websockets chat client using Bluemix
Sun, Nov 9th 2014 1144
Create your own Watson Q and A example with Bluemix, Webstorm and Jazz Hub
Sun, Oct 12th 2014 523
Integrating the Bluemix Watson Translation service into an XPages application
Sun, Oct 19th 2014 470
Binding jQuery code to an XPages partialRefresh using DOM Mutation events
Wed, Oct 29th 2014 333
One way to make a responsive XPages viewPanel
Tue, Nov 11th 2014 307
Arguably the most dangerous thing you could ever do in XPages – let other people use your eval() in their SSJS
Tue, Jun 18th 2013 294
Oh duh, that is why Node Package Manager (npm) is so cool
Tue, Oct 14th 2014 279
Got non-XPages design elements? You really should use WebContent.
Mon, Nov 17th 2014 266
Simple examples of how Google Developer Tools can aid Mobile Development
Thu, Oct 30th 2014 262
XPages and Bluemix: How to create a Websockets message without being connected to the application
Sun, Nov 16th 2014 258


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
26 hits



Recent Blog Posts
173


Multiple Chrome Incognito browsers share the same data
Sun, Nov 23rd 2014 7:15p   Mark Roden
In a previous post I talked about how going porn-mode on your browser is great for a developer. What I didn’t realize until today is that incognito mode is not as unique as I want it to be. We use localStorage in one of the applications we are developing and I had issues when I was opening up multiple Chrome Incognito mode browsers, assuming they were unique….I wanted to compare separate instances in separate windows Mr. Genius (Toby) pointed out to me that localStorage is shared a [read] Keywords: applications
241


x$ – now a part of XPages Extension Library
Tue, Nov 18th 2014 9:16p   Mark Roden
I am very flattered to find out that not only is my x$ OpenNTF xSnippet being used more widely than I realized (over 600 downloads). It now being used in the latest release of the OpenNTF Extension library. If you look here – http://bootstrap4xpages.com/xsp/.ibmxspres/.extlib/responsive/xpages/js/xsp-mixin.js and search for it you will find //jQuery selector that works with XPages IDs //See - http://openntf.org/XSnippets.nsf/snippet.xsp?id=x-jquery-selector-for-xpages function x$(id [read] Keywords: xpages community openntf
266


Got non-XPages design elements? You really should use WebContent.
Mon, Nov 17th 2014 7:20p   Mark Roden
Recently I was able to help explain an issue Russ Maher was having with his application png files - http://xpagetips.blogspot.com/2014/11/got-png-you-may-get-problems.html. It got me thinking that as modern web developers (which is what XPage developers need to be), we should not be using Domino database elements for “web elements”. Back before R8 we all used the Database Files, Style sheets and Database Images as a way to reference files as part of the database. I now believe w [read] Keywords: domino R8 xpages application applications css database development server
258


XPages and Bluemix: How to create a Websockets message without being connected to the application
Sun, Nov 16th 2014 6:32p   Mark Roden
In this article I demonstrate how to create a Websocket message to be broadcast, from a website which is not connected to the Websocket directly. This will be achieved by using a http POST request of the message to a node.js server hosted on Bluemix and having that server then emit a Websocket message out to the application. Introduction In the previous article I demonstrated how to create an XPages chat client using a Bluemix hosted node.js server. I was able to do this by porting the node. [read] Keywords: ibm xpages ajax application javascript security server
307


One way to make a responsive XPages viewPanel
Tue, Nov 11th 2014 7:41p   Mark Roden
In this article I will demonstrate a method for hiding columns using CSS and making an XPages view Panel pseudo-responsive. What is Responsive Design? Responsive design is an approach to web page creation that makes use of flexible layouts, flexible images and cascading style sheet media queries. The goal of responsive design is to build web pages that detect the visitor’s screen size and orientation and change the layout accordingly. http://whatis.techtarget.com/definition/responsive-des [read] Keywords: xpages css mobile xml
1144


Creating an XPages Websockets chat client using Bluemix
Sun, Nov 9th 2014 7:53p   Mark Roden
In this article I will demonstrate how I was able to take an example Bluemix, node.js based, websocket chat program and re-purpose it to be used in XPages. Introduction Earlier this year I was very excited to find the Websockets in XPages project on OpenNTF published by Mark Ambler. The concept behind that project is to be able to create a notes document in a queue which is processed and then send out to all users. As much as I promised to help out and use the project, life and a business need [read] Keywords: domino ibm notes xpages ajax application applications css database dojo interface javascript mobile openntf server xml




152


Finding your localStorage values – Chrome Developer Tools
Thu, Nov 6th 2014 8:05p   Mark Roden
Just a quick tip – if you use localStorage and you need to find out what values you have in localStorage you can see them through developer tools easily. F12 to pull up developer tools Resources Local Storage is right there PS A similar feature will be release in the next Firefox (34) developer tools – https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector [read] Keywords: firefox
215


Because developers make mistakes – Webstorm Local History
Wed, Nov 5th 2014 10:24p   Mark Roden
Similar to Eclipse, Webstorm has a local history capability, allowing the developer who realizes they made an idiot mistake an hour ago, to go back to it and save their day. We’ve all been there and while committing to source control is a must for modern development, there are those times in between commits and then those when you are just too lazy to go through the repo looking for it. Local History Local History is always enabled in Webstorm – for the official help check here. U [read] Keywords: development eclipse
165


Conditional style loading in IE10+
Sun, Nov 2nd 2014 8:12p   Mark Roden
I learned this recently when trying to load a conditional stylesheet into an XPage. IE9 worked but IE11 failed on me and I couldn’t see why. It was only a small change so I ended up putting it in the main stylesheet as a media query. Apparently IE10 and above does not understand conditional HTML code like this http://msdn.microsoft.com/en-us/library/ie/hh801214(v=vs.85).aspx So to load a style conditionally in IE11 you can do it like this @media screen and (-ms-high-contrast: a [read] Keywords: css microsoft xml
262


Simple examples of how Google Developer Tools can aid Mobile Development
Thu, Oct 30th 2014 7:36p   Mark Roden
In this article I will show some simple examples of how Google Developer Tools can be used to help in mobile (responsive) development. Introduction Google Developer Tools (F12) within Chrome is one of those things which you *know* is way more powerful that you have ever cared to look at but this week I was introduced to a very cool new feature – thanks to @simonreid123. The ability to control the veiwport and size of the viewing window, as well as being able to throttle the speed of page [read] Keywords: development google iphone mobile network twitter




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