yekinabud:
I did think about using some HTML, but I couldn’t figure out how to persist the data from the HTML field.
Yea, outputting html with a calculation is not a trivial thing. Most times it’s just easier to punch in the html into the html column at the form.onShow() event.
You can speed this process up by making this column data local so it’s not stored back to the server. Just set the html display column to have no data provider.
Easier than a calc to script but you have to manage the display when the data shows up. So you’re exchanging tradeoffs.
yekinabud:
So if I’ve got a bunch of treatment_time records relating to a medicine record, I understand how you could calculate the appropriate display of checked, un-checked or hidden check-boxes, but how would you grab the mouse clicks on the table cells and populate the treatment_time records (e.g. insert/update columns like time=1/2/3/4/…, display=hidden/un-checked/checked).
You can fire methods from within html using a special javascript call in an href tag:
<a href="javascript:methodName(argument1, argument2...)">Run Servoy method</a>
html code in Servoy is generally a frustrating thing to deal with when coming up with complex displays. The default java html renderer has its issues. But once you’ve figured out the limits you can do some fairly impressive things with html.
So my recommendation if you want to save yourself time and frustration would be to use Patrick’s table bean. If you want to get adventurous, here’s the html output for the attached pic to give you some ideas.
<html>
<head>
<style type="text/css" media="screen">
</style>
<title></title>
</head>
<body>
<table>
<tr>
<td width="126" align="left">
<a href="javascript:REC_row_selected(1)">Rentfield Enterpri</a>
</td>
<td width="56" align="left">
<a href="javascript:REC_row_selected(1)">Active </a>
</td>
<td width="21" align="left">
<a href="javascript:REC_row_selected(1)">1 </a>
</td>
<td></td>
</tr>
<tr>
<td class="rowSelected" width="126" align="left">
<a href="javascript:REC_row_selected(2,1)">Servoy </a>
</td>
<td class="rowSelected" width="56" align="left">
<a href="javascript:REC_row_selected(2,1)">Active </a>
</td>
<td class="rowSelected" width="21" align="left">
<a href="javascript:REC_row_selected(2,1)">7 </a>
</td>
<td class="rowSelected"></td>
</tr>
<tr>
<td width="126" align="left">
<a href="javascript:REC_row_selected(3,1)">Cibex Central Corp</a>
</td>
<td width="56" align="left">
<a href="javascript:REC_row_selected(3,1)">Inactive</a>
</td>
<td width="21" align="left">
<a href="javascript:REC_row_selected(3,1)">8 </a>
</td>
<td></td>
</tr>
<tr>
<td width="126" align="left">
<a href="javascript:REC_row_selected(4,1)">ABC Company </a>
</td>
<td width="56" align="left">
<a href="javascript:REC_row_selected(4,1)">Active </a>
</td>
<td width="21" align="left">
<a href="javascript:REC_row_selected(4,1)">26 </a>
</td>
<td></td>
</tr>
<tr>
<td width="126" align="left">
<a href="javascript:REC_row_selected(5)">Data Mosaic </a>
</td>
<td width="56" align="left">
<a href="javascript:REC_row_selected(5)">Inactive</a>
</td>
<td width="21" align="left">
<a href="javascript:REC_row_selected(5)">33 </a>
</td>
<td></td>
</tr>
</table>
</body>
</html>