logo

The Accidental Client Coder

Hands up if you've ever fallen foul of this little annoyance. You're working on a database in Designer 6 that was created in R5. You make a change to some of the JavaScript in the form only to find it has no effect at all in the browser. After trying again and again and adding a few alert()s here and there you remember what it is. In Domino 6 the form's events are duplicated for the Web and the Client. By default, when you edit some JavaScript, you are editing the Client code.

This only happens when you open an R5 database in Domino 6. If you create a new database in Domino 6 and add JavaScript to an event it is tied to the Web by default, which is good, for me at least

JavaScript code in Domino designer 6

This isn't a bug of course. It's just an annoyance that catches me out almost all the time. The clues are there, I'm just too stupid to see them. You can see in the shot above that the JS Header is stripy, whereas the onload event is yellow. Stripy tells me there's code in both the Web and Client sides. Not only this but there's a drop-down which clearly lists the client the code is for. A yellow circle denotes Web-only code and green is for Client code.

This isn't a "how rubbish is Domino" post. It's as much me admitting to being stupid as anything else. But am I stupid? Surely I'm not the only one who does this. It can't just be user stupidity. Some of it has to be that this has been badly executed. Surely!

On a lighter note I am sat here, in our worthless corner of the world, sipping tea through the gaps in my yellow teeth* reading this. Brilliant stuff. Thanks Watski. I love the stereotypes that different nations have of each other.

* I do love tea but I don't sip it. I tend to slurp or gulp it. My teeth aren't yellow, but then they aren't exactly dazzling either. They're a normal off-white. The food I eat isn't that bad. It's a mix of continental styles, with roast dinners and fish-n-chips reserved for the odd "treat".

Comments

    • avatar
    • JT
    • Tue 19 Oct 2004 04:15

    1. Yep. I do this all the time. Very annoying and usually the last thing I remember to check (after restarting the browser, clients, http task etc..).

    2. Bloody hell. An American who knows that Wales is a constituent part of Great Britain and not somewhere in England. Maybe I need to revise my stereotypical view of them!

    Cheers. Great site.

    JT

  1. That 'gotcha' gets me too. What makes it worse is if you want to use a formula behind a web button - you switch to the client option to enter it as the web option is for javascript only.

  2. Yeah, it sucks... I know we should notice it, but we had times that 3 developers were looking at the code, not understanding why changes were not reflected in the browser when suddenly I notice the "Client" option... And it happens again... and again... and again... this mistake is hard to learn :-)

    • avatar
    • Barry
    • Tue 19 Oct 2004 06:54

    this "gotcha" has gotten me more than once, too.

    • avatar
    • Doug
    • Tue 19 Oct 2004 06:57

    I'll join this band wagon too. This one gets me more often than I care to admit. :-)

  3. Sorry to spoil the party, but I really only faced this problem once or twice in the beginning of R6 development. Keeping my fingers crossed. ;-)

    But what did happen to me once (unfortunately when teaching a Designer course) was the following:

    I demonstrated the "Common JavaScript" selection, entered some code for the client, then changed to "Web" and the programming pane was empty. I could effectively enter different code for Notes client and Web browser, despite of Designer telling me that it all went into "Common JavaScript".

    After changing both events to client specific JS and then reverting to Common JS again, the problem was gone. Still a little worrying.

  4. Deja Vu, I hope you didn't spent 3 hours putting alerts in like I did, and this was a week after my R6 update class. I can't say stupid, just old dog new tricks.

  5. Never happens to me. I prefer using Page for my javascript. If i can, i use a 1 page for my html, 1 page for my javascript and 1 page for my CSS.

    I find it alot more easier to debug and structure.

    My only compliant is that the domino designer does not color code your comments in a page!

    • avatar
    • Karen
    • Tue 19 Oct 2004 09:26

    This one has bitten me more times than I care to remember. And it's a usability issue that could and should be addressed.

    As for that Ohio project, ouch... hurray for free speech and all, but don't associate the rest of us Americans with the obnoxious few listed there.

    • avatar
    • +Tim+
    • Tue 19 Oct 2004 10:41

    Just a brief "me-too"! These things just drive me nuts, plus things like onLoad events that don't work on subforms, plus... oh whats the point? the list could be endless... Anybody fancy a top-ten list (complete with 0900/SMS voting scheme - no? can't stand those either!!) (end rant)!

    • avatar
    • Derek
    • Tue 19 Oct 2004 11:39

    our team too...a few of us were griping about it only yesterday

  6. Following Jakes rule for some time now (don't let domino render the HTML) I stopped using design elements on forms to hold javascript and only use libraries or passthru HTML script on pages where function calls are visible at a glance. Saves all sorts of hassles. :-) Makes for less than attractive form markup, but it's far easier to track down where a change needs to be made and much easier to manage when you don't let the conveniences of the design client lure you away from a centralized code management model. Just my 2p.

    • avatar
    • Niklas Adolfsson
    • Wed 20 Oct 2004 02:19

    This little annoyance has fooled me more than once! :-(

  7. You could always change the colour of the script for Client and Web, that way you would have a larger prompt to remind you which you are programming in ...

    Interesting how the neo-nazis are so indignant -- and so personally offensive. Obviously they are concerned with the merits of Bush and his re-election; no able to rebut with facts they resort to argumentum ad hominem trying to scream down any dissenting voices. It's a shame in the USA, where free speech is the cornerstone of society.

    Oh, teeth gradually become more and more yellow with age: the dentine hardens and this makes the teeth seem less white. What they correspondents should be concentrating on is the crooked teeth of the UK, not the colour.

    • avatar
    • Steve Smillie
    • Thu 21 Oct 2004 08:13

    I read this blog from Jake a few days ago and thought "I have seen that before and I should remember that problem next time it occurs". Then this morning I was working on some changes to an application and I couldn't figure out why the browser wasn't showing my changes. After a half hour of trying, it hit me that I had a case of this problem. Even when recently reminded this can still get you!!!

    • avatar
    • Giles
    • Fri 22 Oct 2004 07:34

    OK, I'm feeling better now knowing that I'm not the only idiot out there!! :)

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Tue 19 Oct 2004

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content