London Developer Co-operative

It’s over six months since I went fully independent for work, and it’s certainly been both entertaining and probably the most challenging thing I have ever done.

One of the biggest hurdles when dealing with large companies, as I do, is bidding for larger projects against the established large consultancies. Partly because of this, but also because it offers some great opportunities to work with some very smart people, several of us in the UK have grouped together to set up the London Developer Co-operative.

Basically we have some really great people such as Ben Poole, Rob Wills and Mark Myers, each with well over ten years experience with various different technologies (although with an obvious bias towards Lotus) who are able to win business in their own right and then use the rest of the group to back them up with extra resource, consulting help or holiday / sickness cover.

The hope is that over the next few years we’ll be able to establish ourselves as a serious alternative to the huge “big 6” by offering better service, deeper technical skills, quicker responsiveness and cheaper consultants. Time will tell.

I'll be speaking at Lotusphere

Twitter was all a-flutter last night as the Lotusphere session acceptance and rejection emails were being sent out. It takes a long time for them all to get out and my first one didn’t arrive until after 10pm when I had already turned off the computer for the night. So this morning I woke up to find that I had not one, but two sessions approved. This is a massive (and very pleasant) surprise for me as I’ve not spoken at Lotusphere before. So for the next month I’ll be working like a mad man to put together two sessions, and this is what they’re about:



and



I really can’t wait until January now. Hope to see you there 🙂

Time for a pre-Christmas LotusBeer

So it’s been a couple of months since UKLUG finished up and before we really get into the Christmas party season I thought it would be a good idea to organise a London LotusBeer event.

At the moment the plan is to meet at the, now traditional, Market Porter for a pint or two and then go on for some dinner at some nearby fine quality curry house to be decided upon based on our state of innebriation.

So pencil Wednesday 3rd December into your diary for about 6pm. All the usual London based suspects will be there, but if you’ve never managed to make it along please do join us to say hello.

Capturing KeyPresses in Client Side Javascript in an XPage

It’s a silly little one this, but it’s caught me a couple of times.

When you’re writing client side Javascript in an XPage for a field or a button (for example) when the Javascript is rendered out to the browser it’s actually stored in a function which Dojo then links to the specific event being worked with after the page loads. What wasn’t obvious to me and took a few minutes to work out was if you want to catch a specific event like a key press, how do you get hold of the event object? I’m not going to go into the joys of how different browsers implement event handling, you can read more about it here.

Once you look at the source HTML that the XPage generates the solution is blindingly obvious, the object that you want to refer to is called “theEvent”. So if you want to do something when the return key was pressed, for example, then you may have something like this:

In the onkeypress event of the field you’d add:

if (getKeyPressed(thisEvent) == 13)
  doSomething();

And in a separate script library there’ll be the following code:

var nn=(document.layers)?true:false;
var ie=(document.all)?true:false;
function getKeyPressed(e) {
  var evt = window.event? event : e;
  var iKey = (evt.charCode)?evt.charCode: ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));
  return iKey;
}

TaskJam teaser

I have absolutely no idea where this year has gone, but October has certainly been a busy month.

In IdeaJam and LinkJam news, Bruce has been beavering away on some tour videos that demonstrate all of the key features of our current *Jam products. You can go watch them here and here. You get to see a bit of behind the scenes footage of how you administer your Jam application which may be interesting if you have nothing better to do of a Halloween evening (is that tautology, not sure).

While Bruce has been lost in Camtasia I’ve been alternating my time between the January ’09 release of IdeaJam and our new product called TaskJam which Bruce has already mentioned, there are some really cool features coming for IdeaJam (and not just in XPages) but if I told you I’d have to kill you at the moment 🙂

TaskJam is very much a work in progress, as with LinkJam it’s started from the fact that none of the internet based To Do list applications match our needs exactly, so given that Domino is nice and easy to develop, especially with XPages, why not just write our own? TaskJam will be slightly different from IdeaJam and LinkJam in that it will be a pure XPages application, and even more importantly it will be free (as in beer). This is just a teaser post at the moment, you’ll hear a lot more on a certain week in January (bet you can’t guess which), but to whet your appetite, here’s a screenshot of where I was yesterday evening:

As a testament to the speed with which you can develop an XPages app, I started from scratch and have so far spent 18 hours working on the code. It’s already basically feature complete, I just need to do all of the tidying up behind the scenes, document it, write the admin elements etc (all the boring bits in other words) which always take an inordinate amount of time. Hopefully the app will prove to be a useful tool for the Lotus community.

Two free XPages workshops

I’ve been at Staines today working with Tim Clark and Chris Freestone preparing for two XPages workshops which will be held at IBM Hursley at the end of November and start of December. I’ll be helping out on the first (and possibly the second one) and they should be pretty good, especially if you want an introduction to getting started with XPages.

The first session details are:
25-27 November 2008
IBM Innovation Centre, Hursley
Cost is FREE
Registration is from the IIC events pages

The second session details are:
9-11 December 2008
Hursley Technical Exploration Centre
Registration: Please email hurtec@uk.ibm.com to resgister.
Cost: Free

Hope to see you there.

Have you checked out the Domino Designer "Wiki"?

The content of the Domino Designer Wiki is really starting to get very useful. If you don’t check there when you have a dev problem then you really should add it to your list of “go to” places. It still doesn’t gell with what my understanding of a wiki is (a wiki should be editable and have automatic cross linking in my view) but setting that aside it’s useful stuff so go have a read.

Tips for referencing elements in XPages JavaScript

I managed to hit a bit of a wall with my IdeaJam on XPages development this week. Up until now I haven’t really needed to write any client side JavaScript which is impressive in itself compared to how much client side scripts we have in IdeaJam classic. But I have reached that point where I want to add some interactivity without round-tripping to the server.

In classic Domino it’s very easy to write script that refers to specific elements of the HTML because you get to control the IDs of those elements. But with XPages it is not possible to predict what the name of an element will be when it reaches the browser. So you are provided with a couple of functions to help you out. When you’re writing client side Javascript in an XPage client side event (like clicking a button) it’s very easy, the syntax you use to reference an element is “#{id:myElement}” in place of the id. So for example you could use:

dojo.byId(“#{id:myDiv}”).style.display = “none”;

But the thing that I didn’t know about until John Mackey gave me some help was that there is a second way of getting the ID of an element. My specific problem was that I wanted to have a script run when the page finishes loading and that script needed to go and work on several different elements. It’s easy enough to make a script run “onload”. You can actually write JavaScript directly into the source XML of the XPage, so I have added, at the top of my XPage something like this:

<script language=”Javascript”>
XSP.addOnLoad(function () {
initLocal();
}
);
</script>

This will tell Dojo to call the function “initLocal()” when the page has finished loading, no problem there. But my initLocal function needs to reference an element on the page and I can’t use the “#{id:myElement}” format as that only gets evaluated in events that are provided for you by the XPage, enter the “getClientId()” function. You can add a computed field to the XPage that has JavaScript embedded within it in the following format:

var out=”<script language=\”Javascript\”>\n”;
out += “var myElementId = \”” + getClientId(“myElement”) + “\”;\n”;
out += “function initLocal(){\n”;
out += “myFunction(myElementId);\n”;
out += “}\n”;
out += “</script>”;
out

And by the time it makes it out the the browser it has been translated into:

<script language=”Javascript”>
var myElementId = “view:_id1:_id2:content:_id4:myElement”;
function initLocal(){
myFunction(myElementId);
}
</script>

So in the initLocal function I call another function which is held in a Client Side JavaScript library and I pass in the element ID so that the function can reference the element on the page with proper separation between UI and business logic. So it’s all a bit round the houses but this way of doing things does work well and hopefully you won’t need to go through the pain that I have in working this stuff out.

Finally a big thanks to John Mackey for his help, this is when the Lotus community really proves it’s worth