summaryrefslogtreecommitdiffstats
path: root/db-viewtable-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'db-viewtable-html.lsp')
-rw-r--r--db-viewtable-html.lsp12
1 files changed, 9 insertions, 3 deletions
diff --git a/db-viewtable-html.lsp b/db-viewtable-html.lsp
index 283d624..3bde35e 100644
--- a/db-viewtable-html.lsp
+++ b/db-viewtable-html.lsp
@@ -65,9 +65,9 @@ if form.value.connection then
formvalues.connection = form.value.connection
for n,v in pairs(form.value.connection.value) do v.type="hidden" end
end
-if form.value.fields then
+if form.value.keyfields then
formvalues.fields = cfe({ type="group", value={} })
- for i,f in ipairs(form.value.fields.value) do
+ for i,f in ipairs(form.value.keyfields.value) do
formvalues.fields.value[f] = cfe({ type="hidden" })
end
end
@@ -78,7 +78,13 @@ formvalues.redir = redir
<% for i,tableentry in ipairs(form.value.entries.value) do %>
<tr>
<% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %>
- <% formvalues.fields.value.id.value = tableentry.id %>
+ <%
+ if formvalues.fields then
+ for i,f in ipairs(form.value.keyfields.value) do
+ formvalues.fields.value[f].value = tableentry[f]
+ end
+ end
+ %>
<td>
<% if viewlibrary.check_permission("updatetableentry") then %>
<% htmlviewfunctions.displayitem(cfe({type="link", value=formvalues, label="", option="Update", action="updatetableentry"}), page_info, -1) %>