|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 </B></font><input type=checkbox name=\"Direction\" value=\"Up\"><BR><font face=\"Arial\" size=\"-1\"><B>Move Down </B></font><input type=checkbox name=\"Direction\" value=\"Down\">]" |
| 5 |
"[<BR><font face=\"Arial\">" + Movie_Title + "</font>]" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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. |
|
|
|
|
|
|
|
|
|
|