Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Toma Bogdan am 03.06.03 - 08:15:31
-
I want to make a table on the web; also I need 2 buttons (ADD & REMOVE) which need to add and remove items from this table. how can I make this on the web (type of fields, some JS or LS code for actions) ?
thanks
-
A simple solution which might work for you:
You can have each row's contents as a seperate document. Then you can use the 'single category view' feature to display the <tr> ...</tr> stuff as embedded HTML view. The table header/footer goes into the form/page that holds the embedded view.
Adding/deleting/editing will then simply apply to the row documents using regular URL syntax.
-
this was also my ideea but I don't want to create docs for each line .... maybe there is another solution ::)
-
I'm afraid, that no other solution will be as clean, elegant and straigth forward.
For a single cell per row, you could populate a multi-value field (which transforms into a text area in the browser) and write the outer tags of a table in pass-through-HTML. The rows and cells could be calculated by some computed text acording to that field, i.e.:
<br>
<table border="1">
<tr>
<td>
<Computed Value>
</td>
</tr>
</table>
as pass-through-HTML and the computed text being calculated to
@Implode(Content + "[</td></tr><tr><td>]")
where Content is the name of the mult-value input field.
However, this will be hardly manageable with more complex table structures and even im my small example I always have one empty row at the bottom of my table. It's probably possible to avoid that as well, but as I said: Not clean, not elegant, not straight forward.
-
O.K., just in case: It works better this way:
<table border="1">
<Computed Value>
</table>
where Computed Value is
@Implode("[<tr><td>]" + Content + "[</td></tr>]")
Still not brilliant.
-
Of course you can also use a WebQueryOpen agent. Eg if the cells are kept in multivalue fields on a single doc, you can read them, construct your HTML table and write the results in a field for web display.
However there's much more work involved to make the Add/Delete stuff work properly then.
-
check this: http://www.codestore.net/store.nsf/unid/DOMM-4R2LUE?OpenDocument
-
maybe this one solves the problem
http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/f2acda4419a5e3cd00256c0e00314e05?OpenDocument&Highlight=0,Table
eknori