Commit 18d3f4a3 authored by Ted Trask's avatar Ted Trask

Update viewtable to handle null keyfield

parent e4129fde
......@@ -68,8 +68,10 @@ end
local reversekeyfields = {}
if form.value.keyfields then
formvalues.fields = cfe({ type="group", value={} })
formvalues.nulls = cfe({ type="group", value={} })
for i,f in ipairs(form.value.keyfields.value) do
formvalues.fields.value[f] = cfe({ type="hidden" })
formvalues.nulls.value[f] = cfe({ type="hidden", value="false" })
reversekeyfields[f] = i
end
end
......@@ -92,7 +94,11 @@ allowupdate = allowupdate and viewlibrary.check_permission("updatetableentry")
<%
if formvalues.fields then
for i,f in ipairs(form.value.keyfields.value) do
formvalues.fields.value[f].value = tableentry[f]
if not tableentry[f] then
formvalues.nulls.value[f].value = "true"
else
formvalues.fields.value[f].value = tableentry[f]
end
end
end
%>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment