mattwhite

dojo.io.bind and Rich Text

I’m playing around with Dojo a lot at the moment and it’s getting better by the week but there are still “hinky” areas. One of the things which has been really bugging me is using dojo.io.bind in conjunction with the Editor2 widget against a textarea. (I think we’ve all been there haven’t we!)

If you run the widget against a textarea and submit normally then all works fine but there seems to be a bug in the binding of the widget and the textarea when submitting asynchronously. So to get around this you should simply use the following line before you call dojo.io.bind:

dojo.byId(“mytextarea”).value = dojo.widget.byId(“mytextarea”).getEditorContent();

But whenever I have tried that I get a null or object not found error in IE and Firefox so after a lot of reading I’ve come up with this as an alternative:

dojo.byId(“mytextarea”).value = dojo.widget.byId(“mytextarea”)._richText.
editNode.innerHTML;

As ever with Dojo it’s constantly changing so I’m not sure how long my hack will work (or indeed when the underlying bug will be fixed) but as of 0.4.1 today it seems to get around the problem.

Cool bit of software for the day

I needed a decent FTP client for the Mac as the built in support isn’t very good so a bit of an internet search later I downloaded Fetch. This is the way all software should be, it does one job very well, no bells or whistles just clean design and simple operation. A full featured free trial later and I’ve handed over the grand total of $25 for a full license because it just works.

Bulging Batteries

When I shut down my laptop last night I noticed that the battery had developed a bulge in it. Not a good thing as it can mean that it can be about about to explode! So I phoned Apple this morning to see what the process was for getting a replacement. They do a fairly good service with a new battery being couriered out to me within 3 days along with a box to return the old battery in.

On the down side this is now the second hardware related thing to go wrong with my Macbook Pro, and it’s only 9 months old, with the network port on the logic board frying over Christmas as well. I do use it a lot (like 12 hours a day or more!) but I’m still slightly disappointed as my previous Apple hardware has been a cut above it’s PC brethren. The most surprising thing about the call to Apple was the hard sell of the AppleCare plan that the support guy gave me, almost as though you should expect a hardware failure and why was I stupid enough not to have bought the extended warranty.

Not buying extended warranties is just a knee-jerk reaction for me as I used to work for a company which managed them for a major retailer so I know the enourmous profits that are made off these things. But given my experiences so far maybe I should rethink in this case.

Session JS File

Jake has been talking a lot recently about YUI-EXT, yet another Javascript framework. It looks nice but I am betting on Dojo becoming the standard, at least in the Domino world based upon the stuff demo’d at Lotusphere this year. The implication was that Dojo will, over the next few releases be used in iNotes and other official Domino web templates.

That is beside the point though. Jake has come up with a great idea for a NotesSession class to be available in Javascript and this doesn’t have to apply to any one framework, or indeed any framework at all. To be honest this had never occurred to me but, like all good ideas, it’s so simple I think I’m going to spend a little time putting something very similar into a couple of my apps.

If you do any serious Javacript in your apps I’d definitely recommend having a look. The benefits should become immediately apparent to you.

Welcome a new blogger

Actually Simon has been blogging for a while, I just didn’t know about it. But if you’re a Domino geek then it would be worth reading his posting about getting Ruby and Domino playing together using JRuby. Simon does this sort of thing so that you don’t have to!

London Meetup

A few of us are meeting up at the Market Porter near London Bridge on Thursday 15th March for a few (or more) beers after work. If you fancy coming along you’d be more than welcome.

All booked for ILUG

As pretty much everyone else in the Domino blogosphere has already mentioned, registration for ILUG has opened. Paul et al have managed to pull together an incredible speaker list and all for the enourmous fee of nothing!

Well I’ve managed to get into the hotel and got a flight for less than £50 return so for a tiny investment it’s going to be a great few days. Apparently there’s going to be a geek dinner on a large scale on the Friday night but I’m guessing there will be plenty of social gatherings during the week as well.