354 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
On SocialBizUg - Web Worker Basics
Sun, Apr 13th 2014 79
Popover to Google Maps
Wed, Jan 1st 2014 106
My first impressions of using Titanium Appcelerator
Sun, Dec 8th 2013 165
Asymmetric Modernization Explained
Mon, Nov 25th 2013 81
2 Days with Domino 9.0.1 Mobile Controls - And I'm not happy
Wed, Oct 30th 2013 125
Make your Bootstrap site Responsive
Fri, Sep 20th 2013 88
The Modern Notes Developer
Mon, Aug 19th 2013 78
Top 10
My first impressions of using Titanium Appcelerator
Sun, Dec 8th 2013 165
2 Days with Domino 9.0.1 Mobile Controls - And I'm not happy
Wed, Oct 30th 2013 125
Easy Mobile Browser Detection
Tue, Nov 27th 2012 121
JQuery FullCalendar in XPages
Sun, Feb 17th 2013 106
Popover to Google Maps
Wed, Jan 1st 2014 106
Make your Bootstrap site Responsive
Fri, Sep 20th 2013 88
Implementing a Dojo Scrollable pane with the XPages Mobile Controls
Mon, Jul 29th 2013 82
Asymmetric Modernization Explained
Mon, Nov 25th 2013 81
On SocialBizUg - Web Worker Basics
Sun, Apr 13th 2014 79
Dojo Mobile ScrollablePane implementation
Sun, Apr 21st 2013 78


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



Recent Blog Posts
79


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


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


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
81


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


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
88


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




78


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


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
60


Add Custom Style Classes to IBM Renderers
Tue, Jul 16th 2013 7:25a   Keith Strickland
I've published an article over on SocialBizUG describing how to take over an IBM Renderer to include your own style classes. Check it out, hopefully you'll find some use for it. [read] Keywords: ibm
73


Mobile First Development
Fri, May 10th 2013 9:06a   Keith Strickland
At Red Pill Development, Peter Presnell has encouraged our development efforts to use a "Mobile First" approach. The process is that you design your mobile interface first, get everything working properly and then move on from there to Tablet and then Web Browser interfaces re-using as much as possible from the previously working mobile implementation. This approach has several advantages: It forces you to research, gather requirements and only display and write code for the things you [read] Keywords: application development interface mobile properties widgets




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