Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Checkbox Columns in Table on Web

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#DominoCheckboxColumns or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/DominoCheckboxColumns


Checkbox Columns on a lotus notes domino web page are a bit of a palaver, as they do not match up nicely in even columns. This is a bit of a problem and was an issue for a customer, there are a few different options for solving this, some using the javascript DOM etc but here is mine. It is pretty simple an works well when saving and reopening the document.





 

Put on the notes form pass thru html:

<table border=0 rowpadding=0 rowspacing=0 CELLSPACING=0 CELLPADDING=0  style='border-collapse: collapse;' ><tr>

then put the checkbox field "Call_Type" as before, but with properties  HTML Style

display:none;

and put in an properties html id eg:

two_col_checkbox

Then you need a computed field with pass thru ticked:


lookup:=@DbLookup("""""keywords""Call Type";2);
r:=@If(@IsError(lookup);"Could not find keyword 'Call Type'";lookup);
st:=" style='  font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: normal;' "
cols:=2;
list:= ""
@For(n:=1;n<=@Elements(r);n:=n+1;

a := @If(@Modulo(n;cols)=0;
"<td "+st+"><small><input style='vertical-align:middle;' type=\"checkbox\" name=\"Call_type\" "+@If(@IsMember(r[n];Call_type);" checked """)+" value=\""+r[n]+"\" id=\"two_col_checkbox\" >"+r[n]+"</small></td></tr><tr>"
"<td "+st+"><small><input style='vertical-align:middle;' type=\"checkbox\"   name=\"Call_type\" "+@If(@IsMember(r[n];Call_type);" checked """)+" value=\""+r[n]+"\" id=\"two_col_checkbox\" >"+r[n]+"</small></td>" );

list:= @If(list=""a;list:a)

);

@Implode(list;" ")+@If(@Modulo(n;cols)>0;"</tr>""")

then finish off web page with:

</table>

This worked well in Internet Explorer 7 and Firefox 3.0.7 and should work in all browsers.

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Lotus Notes and Domino 6 Programming Bible by Brian Benz, Rocky Oliver
Covers all the programming techniques, concepts, and languages used with Notes and Domino, as well as the many new features of Domino 6 Thoroughly examines the Notes and Domino role with Java, XML, Web services, and other IBM products and technologies Provides extensive code and examples, many geared to the needs of administrators High-profile authors, known to their audience through conferences and articles Companion Web site shows example applications from the book running on a live Domino server and provides code download.
See at: Amazon.co.uk | Amazon.com |