Building a UI: using Placeholders in JavaScript
Posted by Theo Heselmans on January 1st, 2009
I've been doing some serious (Domino) web-development lately, and I just love to build things to make it easier for a user. In this case, the users needs to be able to construct the body of a notification email, using placeholders.
This how the final UI looked like:
By double clicking a placeholder item (or selecting it and clicking the button), the placeholder is inserted at the location of the cursor in the textarea on the left.
Later, when using the body content to actually send the emails, my code replaces those placeholders with the real ad hoc data.
My JavaScript skills are sufficient to the point that I can:
- create simple code
- read and understand most code
- adapt and tune most code
My biggest (JavaScript) skill is that I'm good at finding code on the web !
For this thing to work,
I found a great piece of a nicely working function 'insertAtCursor' written by Alex King.
After reading some of the (many) comments, I adapted the code a bit, so the cursor was still there in Firefox.
You can try the interface here:
I hope to be able to share more UI stuff with you in 2009 (browser and Notes client).
One of my new year intentions is to (finally) start using XPages (after learning as much as I can at LS).
Here's to hoping we can use XPages in the Notes client too !
Category: Domino/Notes JavaScript | Technorati: Lotus, Notes, Domino
Comments (0)
0 Responses
-
No Comments Found