358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
On SocialBizUg: Modern Domino: Bootstrap 3 Inheritable Layout
Fri, May 30th 2014 114
XMage, your XPrentice will surely miss you
Mon, May 12th 2014 134
On SocialBizUg - Web Worker Basics
Sun, Apr 13th 2014 124
Popover to Google Maps
Wed, Jan 1st 2014 134
My first impressions of using Titanium Appcelerator
Sun, Dec 8th 2013 150
Asymmetric Modernization Explained
Mon, Nov 25th 2013 135
2 Days with Domino 9.0.1 Mobile Controls - And I'm not happy
Wed, Oct 30th 2013 140
Top 10
Implementing a Dojo Scrollable pane with the XPages Mobile Controls
Mon, Jul 29th 2013 163
My first impressions of using Titanium Appcelerator
Sun, Dec 8th 2013 150
2 Days with Domino 9.0.1 Mobile Controls - And I'm not happy
Wed, Oct 30th 2013 140
Asymmetric Modernization Explained
Mon, Nov 25th 2013 135
Popover to Google Maps
Wed, Jan 1st 2014 134
XMage, your XPrentice will surely miss you
Mon, May 12th 2014 134
Easy Mobile Browser Detection
Tue, Nov 27th 2012 130
On SocialBizUg - Web Worker Basics
Sun, Apr 13th 2014 124
On SocialBizUg: Modern Domino: Bootstrap 3 Inheritable Layout
Fri, May 30th 2014 114
JQuery FullCalendar in XPages
Sun, Feb 17th 2013 100


XPages, Dojo Drag-n-Drop Part 4
Keith Strickland    

This is the final post in this series. In part 3 and 3.5 of this series we went over the AddOnLoad function calls which really is the heart and soul of the Drag-n-Drop functionality. Today we'll be going over the QuerySaveDocument and PostSaveDocument events that fire when the Layout is saved.

Since QuerySaveDocument fires first we'll go over that. This code makes the Left & RightSidebarContains fields contain multiple values instead of a single comma delimited string. I got this code from here. I'm not quite sure I understand why we have to do this but it's the only way I could get the fields to be true multi-value fields.

Now for the PostSaveDocument event. The main purpose here is to setup all the sidebar and page document fields to contain proper values, mainly the "Publish" (sidebar and page), "Container" and "SortOrder" (sidebar only). Currently we're really not using the "Container" field but this is being updated in the sidebar documents for future use. The container field just contains which sidebar area (right or left) this particular sidebar item is contained within. Also the purpose here is to enable the layoutbuilder to determine what was done if these documents are setup manually. We all know that people find ways to use our applications that we never thought of.

First off here, we get the values of the Right & LeftSideBarContains fields and convert that value into an array. We also get the value of the ContentContains field. Since this field only contains a single value theres no need to convert it into an array. We then loop through the sidebar arrays and get the appropriate sidebar document by the UNID and update the "Publish" field to "Yes". We also add that UNID to a temporary array so that when we're setting the sidebar documents that weren't used to "No" we know what we've already enabled. Now I'm sure there is a better way of doing this but at the moment this was all I could think of. Looking back it would probably be better to loop through the sidebar documents and look for the UNID in either of the two arrays, if found then set "Publish" to Yes, else set it to No. Lastly if the ContentContains value is not one of our generic lables for content we get the page whose UNID is in that field and set the "Publish" field to "Yes".

And that's it. We now have a drag-n-drop layout builder that updates our backend documents based on what was dragged and where it was placed. None of the code here is all that complicated, it's just that there is a lot of it. Looking back on this, I saw a tutorial that Jeremy Hodge done on the Notes In Nine video cast about using Java to manipulate the values of fields as they're changed. I think this would have been a better way to manage all of this as it would be more transparent to the end user and would allow more options when it comes to updating the other backend documents. But below is a screen cast of the end result. I'll also include a sample database with all this so you can better decipher my ramblings, but it may be a day or so before the sample db is available.

Other Resources:

Here's that video. The errors that pop up when the layout type is changed, they're trying to update a table I moved so please disregard. Also, while making the screen cast, the avatars for what was being dragged didn't seem to function very well also, when the recording wasn't going on the avatars worked perfectly. To better see what's going on, watch the video full screen.

Update: Here is the demo database



---------------------
http://xprentice.gbs.com/A55BAC/keithstric.nsf/d6plinks/KSTD-8B9LD5
Nov 16, 2010
38 hits



Recent Blog Posts
114


On SocialBizUg: Modern Domino: Bootstrap 3 Inheritable Layout
Fri, May 30th 2014 6:35p   Keith Strickland
I've got a new post over on SocialBizUg. Modern Domino: Bootstrap 3 Inheritable Layout [read] Keywords: domino
134


XMage, your XPrentice will surely miss you
Mon, May 12th 2014 3:45p   Keith Strickland
I am truly saddened and devastated by the news I received today of the death of Tim Tripcony. I would like to express my heartfelt condolences and sympathy to Tim's family and friends. I would also like to explain how Tim helped change both my personal and professional life. The loss of Tim has already left me feeling a rather large empty space where he once stood. Before I was hired at GBS I learned a lot from Tim's blog and the few chat sessions I had with him. I had never met him [read] Keywords: xpages development
124


On SocialBizUg - Web Worker Basics
Sun, Apr 13th 2014 11:26a   Keith Strickland
Over on SocialBizUg - Web Worker Basics [read] Keywords:
134


Popover to Google Maps
Wed, Jan 1st 2014 11:34a   Keith Strickland
Posted over on SocialBizUg - Popover to Google Maps [read] Keywords: google
150


My first impressions of using Titanium Appcelerator
Sun, Dec 8th 2013 11:48a   Keith Strickland
A couple of weeks ago I started messing with Titanium Appcelerator. Coming from Domino Designer and Eclipse the IDE will look very familiar. It's eclipse and it's based off of Aptana Studio. I guess the biggest issue to being productive is the learning curve for the API. But honestly when is that not the case? So starting to delve into this, Titanium apps are purely client side javascript based. You write the CSJS that builds the UI, Business Logic, Layout, everything. While this may [read] Keywords: domino ibm lotus notes notes client application dojo eclipse iphone javascript mobile oop openntf wiki
135


Asymmetric Modernization Explained
Mon, Nov 25th 2013 6:32a   Keith Strickland
Posted Asymmetric Modernization Explained over on SocialBizUg. [read] Keywords:




140


2 Days with Domino 9.0.1 Mobile Controls - And I'm not happy
Wed, Oct 30th 2013 1:42p   Keith Strickland
OK, so today is the 2nd day I've spent with the Mobile controls from Domino 9.0.1. I must say the lack of a 9.0.1 Beta is quite obvious. So some of the "improvements" IBM made to the mobile controls are the addition of onBeforeTransitionIn/Out onAfterTransitionIn/Out. While these events are sorely needed, the implementation IBM chose to use doesn't work is kind-of odd. So, a brief rundown of the transition events pre 9.0.1. I posted a while back about how to implement these methods i [read] Keywords: domino ibm application community dojo mobile network server
96


Make your Bootstrap site Responsive
Fri, Sep 20th 2013 2:50p   Keith Strickland
Just posted over on SocialBizUg a tutorial for putting together a responsive layout for your XPage Applications. [read] Keywords: applications
92


The Modern Notes Developer
Mon, Aug 19th 2013 8:09a   Keith Strickland
On SocialBiz User Group - The Modern Notes Developer [read] Keywords: notes xpages
163


Implementing a Dojo Scrollable pane with the XPages Mobile Controls
Mon, Jul 29th 2013 4:45p   Keith Strickland
Check out my first NotesIn9 video about adding a Dojo Scrollable Pane in order to get a fixed bottom tab bar with the Extension Library Mobile Controls. A big thanks to David Leedy for publishing my video. Hope you enjoy the video. [read] Keywords: xpages dojo mobile planetlotus planetlotus.org




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