Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Sorting documents via Notes and the Web (continued)

Ten Little Indians
As you probably know if you've worked with views sorted on numeric numbers before, Notes does not sort a list of pure numbers as you would expect it to (in other words, it sorts based on ASCII order of the characters themselves). For instance, Notes will sort a list of numbers from 1-10 as follows: 1, 10, 2, 3, 4, 5, etc. The way to trick Notes into behaving in a more numerically correct manner is to create a calculated column that adds a 0 in front of numbers below 10 and then sort ascending on that column. This way all of the items in a list of 1 to 99 items have two characters and will sort as desired. If you are going to have up to 999 items that will need to be sorted in a view, then you would need to add two zeros in front of numbers less than 10 and one zero in front of numbers from 10 to 99. This way every item would then have three characters and will sort as expected.

The Client
As you can imagine, sorting documents using the Notes client is very straightforward. You create two agents, one to move the selected document up (MoveDocUp) and one to move the selected document down (MoveDocDown). Then you assign buttons on the action bar to each of these agents. I've included copies of both agents in the sample database that is available at http://dan.velasco.com, so I'm not going to describe them in detail here. Instead, let's jump directly into the more difficult task of how to sort the documents on the Web. DominoPower, Ho!

A Room With a View
The secret to moving the documents up and down on the Web is in setting up a view and a view template that will enable you to select the documents you want to move and indicate if you want to move them up or down. Then you send this information to a "catcher" form that captures all of this information and then immediately runs an agent in order to change the order of the documents as you desire.

In this way, the user can just select one item at a time (a radio button) and click a checkbox to indicate if they want the document to move up or down. You can see how this all looks in Figure A.

FIGURE A


Simply select the document you want to move, indicate the direction and press the return key. Roll over picture for a larger image.

The view that you see above is composed of five columns with the formulas that are listed below in Table A:

Col. # Formula
1 @If(Sort_Number < 10;"0" + @Text(Sort_Number);@Text(Sort_Number))
2 Sort_Number
3 "[</center><BR><center><input type=radio name=DocUNID value=\""+@Text(@DocumentUniqueID)+"\"></center>]"
4 "[<font face=\"Arial\" size=\"-1\"><B>Move Up &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B></font><input type=checkbox name=\"Direction\" value=\"Up\"><BR><font face=\"Arial\" size=\"-1\"><B>Move Down &nbsp;</B></font><input type=checkbox name=\"Direction\" value=\"Down\">]"
5 "[<BR><font face=\"Arial\">" + Movie_Title + "</font>]"


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Lotus Technologies > Notes (84 articles)
   A walk down Memory Lane with Lotus Notes
   An application for scanning physical mail and distributing it virtually
   Managing Notes deployments with Teamstudio Build Manager
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login