Computed backgrounds
Posted by Theo Heselmans on October 23rd, 2007
I always try to make it obvious to users which fields are obligatory, and which are not. In the early days I did it (like many of you) by putting a special icon in front of a field. Lately I've been doing it by changing the background color of a field:
Did you notice the absence of those ugly field delimiters !
I use table cells, and color the background.
Now, let's get creative. Make 2 shared images. Each with a 1x1 pixel image. The first 'normal.gif' with the default color, the second 'special.gif' with the obligatory color.
Put a multi-value field 'Obligatory' at the top of the form, containing the names of the obligatory fields.
Now use a computed cell image. e.g.for the Company table cell:
@IF(Obligatory="Company";"special.gif";"normal.gif")
Important note: make sure the image formula computes to an existing image, or you might end up with an error or worse, a red box of death !
Too bad there is no @ThisNameParagraph, to get to the name of the (first) field in the paragraph.
@ThisValueParagraph might be useful too, e.g. in hide when formulas.
You can use the same 'Obligatory' field to do the field checking upon Querysave (or in a classic Input validation formula).
BTW. There is one place I still need to use field delimiters, and that's when a field is of type 'Dialog List'.
The reason: I want to show the 'entry helper button', and strangely enough, when you switch of 'Show field delimiters', the 'entry helper button' disappears too !
Too bad, as there is a separate 'Display entry helper button' checkbox. It should not be related !
Category: Domino/Notes | Technorati: Show-n-Tell Thursday, SnTT
Comments (4)
it's about time that Notes follows the webstandards so you could easily set a hexidecimal as background color, not an image
Make sure you set that background to "size to fit" rather than "tile." The performance difference is staggering.
That whole dialog list helper thing has actually led me to abandoning that style of field altogether. Instead, I use an ordinary text field with an entering event that brings up a custom dialog. It's a bit more work, but well worth it once I've packaged up all the controls.
@Nathan
Good tip that 'size to fit'. I have to do some performance testing on this too.
Regarding the custom dialog: I often use this too, but 'double clicking' an item in the list to select it, rather then selecting and clicking OK, is usually the user's request (and they're right).
I would like to make the table cell background color change based on the value entered.
Example:
Field Listbox ( Apple , Ice , Grape)
When I choose Apple the cell background should be Red
When I choose Ice the cell background should be White
When I choose Grape the cell background should be Green
Thankyou
Balaji