Home | Blog Roll | Link Roll | Colophon/About


Archive for April, 2006

Tag Team Wrestling, New Media Style

Wednesday, April 26th, 2006

Once can be an interesting accident, twice is a trend so my ears rose when , first, The Economist has a special survey out on the New Media : Among the audience, in the stores now(! run, the free online is limited, althought it also has some web only extras). I’ve almost finished it, and It does a (mostly) great job of explaining Blogs, Wiki’s, PodCasts, the New Media (and now the old media is trying to figure it out) in a way that (I think) those not plugged can start to understand. (If it is possible to understand swiming, when standing on the side of the pool.)

The (second) is this months Wired Mag (may 2006) having “The Wired guide to the Online Video Explosion” (not yet now online). Bunch of stuff that was new to me, and made me want to re check out the stuff I was familar with. Now it add another 6 hours in my 32 hour day.

Mix, Mash, Link, Feed and Cast away!

SnTT : LotusScript Required Field Validation without pain

Wednesday, April 26th, 2006

Updated : Revisited with 300% less Pain! and much better code.

I’m missed the last couple of weeks but I’m back for another , and doing a followup on my first post , and the disscsion that in generated and doing required field Validation without pain. What I wanted some some good, but quick way to validate that the required field have been filled.

Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document

Dim fieldList(1 To 130, 1 To 2) As String

fieldList (1,1) ="FirstName" ' Field Name
fieldList (1,2) ="First Name" ' Field Label

fieldList (2,1) ="LastName"
fieldList (2,2) ="Last Name"

fieldList (3,1) ="StreetAddress"
fieldList (3,2) ="Street Address"

If ValidateForm ( Doc, "Admin Profile", FieldList )Then
Continue = True
Else
Continue = False
End If
End Sub

%INCLUDE "LSCONST.LSS"

Function ValidateForm (Doc As NotesDocument, FormName As String, FieldList As Variant ) As Integer
On Error Goto processError

Dim errPre As String
Dim errMsg As String
Dim msgTitle As String

msgTitle = "Validation Error saving " + FormName + " Request"

errPre ="The following field(s) are blank , or incorrect, and must be inputted before saving:" & CRLF & CRLF

'Dim item As notesItem

Dim x As Integer
For x = 1 To Ubound ( FieldList, 1)
ErrMsg = errMsg + VaildateFieldNotEmpty (Doc,FieldList(x,1), FieldList(x,2) )
Next

If Not errMsg = "" Then
Messagebox errPre & errMsg, MB_OK+MB_ICONSTOP, msgTitle
ValidateForm = False
Else
ValidateForm = True
End If
Exit Function

processError:
Messagebox "System Error " & Err() & ": " & Error$ & ", line: " & Erl
ValidateForm = False
Exit Function

End Function

Function VaildateFieldNotEmpty (Doc As NotesDocument , FieldName As String , Msg As String) As String

Dim CRLF As String
CRLF= Chr$(13)

If doc.GetFirstItem (FieldName).text = "" Then
VaildateFieldNotEmpty = CRLF+Msg
Else
VaildateFieldNotEmpty = ""
End If

End Function

So the first routine is the QuerySave, on the form, which bulds array of FieldName and FieldLabels to check for very basic required field validatation.

The second and third routines could be on the form but should be in a script library. The
%INCLUDE “LSCONST.LSS” needs to be in the declaration section.

The third routine takes the Document and FieldName and tests to see if the field is empty, if it is then it passes back the fields label (or it could be another message). My test seems to work for most fields in my - brief - testing, but some work is need for more robost testing.

The second routine, loops though the passed array and builds a string of field labels (or messages) and if not empty display a dialog box with one list of field requiring content. It also tell the QuerySave that it failed.

All this works in conjuction with my earlier : @If(@Command([FileSave]);@Command([FileCloseWindow]);””)

It also will work with any induvuial field Valiation, which get checked after the QuerySave if that is successful. You could also do more completed validation (of the A must be greater that B, or C must be odd) after this, in the query save.

If your doing Domino web work take a look at Rich’s , although (evil thought) I wonder if something like this could work in the notes client javascript support? You still need back end validate though. (which leads to another evil thought - 2 in one morning? !!) about using RSJ templates to generante the javascript for validatation based on the RubyOnRails meta data … hmm)

another update : has posted a javascript based form validation in , the the comments (below) by have nudged by own thinking. A mild revision to follow.

DemoCamp 5 : More Geek Show and Tell in Toronto

Wednesday, April 26th, 2006

Last months was a big succuess and the momentum continued this month with , this time at a UoT location. Good write up’s by Chris Nolan (who did a Demo himself) and (he of the accordion) did his usual bang up job, describing the demo’s. And Pirate Radio shares 4 things I learned at DemoCamp 5.

Some UoT Students presented their work project to build a better buildent board system for , based on Java. It looks like they got some real world experiance in building an application, wheather that is is a good thing or not is another question.

As mentioned, Chris did a demo of the new feature in RubyOnRails 1.1 of RJS Templates : Rails JavaScript, a way to have your Ruby generate Javascript, particular all those fine Ajax’y things. (see . He also had a big shout out for the firefox extension for your javascript debugging needs.

David Janes of BlogMatrix showed of some cool use of micro formats, small peices of xml that do just one thing, like dates, places and can be built up. He also showed of a new site for a one time client.

Update : BlogMatrix is Python based, with should warm the cockles of

A team from Unspace showed a slick demo of live datagrid editing, and even slicker website built on Rails (the care lease website is now live at http://www.ReLeaseMe.ca/), and building on Chris’s own demo (to the annoyance of several java-heads in the crowd). “This app cried out to be built in Rails”!

is a web based spreadsheet, database (the best of both) built with sqeak (a variation of smalltak). Wow.

Adam Goucher’ did a presentation of a web front end for ldap (an HP product called Select Access. It was a tough sell to a group that has never given much thought to the problems of managing tens of thousand of resources (like web pages, directories and files ) for thousands of people (or at least authenticated identifies). He also has guts to do a demo with only 3 hours to pull it together.

Then we all went off to (another irish) pub (via Thomas).

It’s also worth noting that there is a lot of geek events going on in the next month it T.O. And the buzz hasn’t felt this good for 10 years.

The Death and Life of Saint Jane

Tuesday, April 25th, 2006

Via the New York Times and the Globe and Mail: , the urban expert and social activist who wrote The Death and Life of Great American Cities, died today (April 25th) at the age of 89, after having suffered what appeared to be a stroke.

Having lived in lived in the Toronto nieghboor of the Annex since 1968, she was involed with a successful fight to stop the and has had a deep influence on this city. She was appointed as an officer to the Order of Canada in 1996.

A sample of her always thoughtful and original output :

The Death and Life of Great American Cities (1961): Cities rely on access to sidewalks and parks, high-density housing with a mix of incomes, uses and ages of buildings, and hands-off planning.

The Economy of Cities (1969): Urban economies are based on replacement of imports with indigenous products. Cycles of trade and entrepreneurship are vital to urban life.

The Question of Separatism: Quebec and the Struggle for Sovereignty (1980): Like Norway’s separation from Sweden, Quebec’s from Canada can be good for both parties if they maintain separate currencies.

Cities and the Wealth of Nations: Principles of Economic Life (1984): National economies are in fact the economies of urban regions, and national economies work best when cities are given maximum autonomy. Backward cities should trade with one another and consider secession.

Systems of Survival: A Dialogue on the Moral Foundations of Commerce and Politics (1992): Human societies rely on two distinct systems of morality: “commercial” and “guardian.” Both are vital, but troubles arise when the two are combined.

Her insight will be missed. The Toronto star has this to say : Jane Jacobs, 89: Urban legend, as well as T.O. owes debt to Jacobs and Letter of protest Jacobs’ last act. More : CBC has , and some amazing archival material of and this recent peice from Ideas, as well as the stuff I’ve been hearing on CBC Radio like As it Happens.

and here is Jane Jacobs on Cities .. and Here a Taddle Creek Mag essay from a couple of years ago : Pillar of Community via .

And the wolves are out, aready! The Sunday New York Times, “Week in Review” section has “Out growing Jane Jacobs“, attacking her messy, cluttered, and small scale solutions. Jason Kottle about . (it also has a companion audio slideshow).

The “contrasts in scale” that the NYT article talks about would seem to be contrasts in one (mono culture) use vs multi use and externally imposed vs internally arisen. And I’m not so sure the JJ would dislike what has become of “her” SoHo and Greenwich Village neighboors. Then, and now, they are have vastly more density, life, and variety, than most (any?) suburban or small town place. Anywhere as successful as SoHo is bound to become more expense to live. Although if that goes to far, it value will drop, and it will re-grow elsewhere if possible. And what to make of Mr Ouroussoff’s claim about “Los Angeles, whose beauty stems from the heroic scale of its freeways”? “Cars before People” is alive and well!

also worth a read is The upside of ‘density packing’ (Living closer together helps the environment, shortens commutes, and promotes affordable housing.) (via Kottke’s links) which does not mention Jane Jacob per see, but arrives to the same place.

Words that don’t mean what they say : “In Camera”

Sunday, April 23rd, 2006

From the Latin “in chambers”, a legal term meaning “in secret”. Ironicaly something “In Camera” is not done with the camera’s on.

Kurzweil’s handheld reader

Friday, April 14th, 2006

Via : Joho the Blog we have news of ’s handheld reader, combining a 5 megaxpixel camera and a PDA that lets you snap a picture of some text and have it read back to you … and when this becomes available in a Cameraphone watch the look of to the horror in the faces of magazine / book shop owners everywhere! (see .)

Using Javascript in a Lotus Notes Client app

Wednesday, April 5th, 2006

For this tip, I’m talking about JavaScript in the Notes Client. JavaScript has been available to the Notes Client since R5. R5 and R6 both use Version 1.3. (Question: what about R7?) One thing to be aware of is that with R6, the javascript “attaches” differently to the object, so you can’t develop in R6 designer and run in R5 Client).

In this case I had a request to add a “Check All” action to act on a check box field. I was thinking I would need to get the get the field values in LotusScript, change the values, and then refresh the uidocument … till I remembered “JavaScript”!

Always use the right Tool for the job at hand. So I was able to quickly add a button and add the following script, given that I had a check box field called - what else - “Checkbox” :

for (i = 0; i < document.forms[0].Checkbox.length; i++)
document.forms[0].Checkbox[i].checked = true ;

and I also created a “Uncheck” button like this :

for (i = 0; i < document.forms[0].Checkbox.length; i++)
document.forms[0].Checkbox[i].checked = false ;

For those unfamiliar with JavaScript a word of caution, it is very, very, case sensitive; Field names must be exactly right.

JavaScript provides a great way to do UI work, whether on the Web or with in your Notes Client. Yet another tool in the kit of your Lotus Notes Developer.


Close
  • Social Web
  • E-mail
E-mail It