I'm trying to use ad_form for the first time, and I can't get my -edit_data block to execute. At first I couldn't get the -select_query_name to work, which turned out to be a typo, so maybe this is too, but I can't find it.
In the .tcl file:
ad_form -name new_label -form {
label_id:key(v_bma_ip_labels_label_id_seq)
{label:text
{label "Label"}
{html {size 25}}
}
{descrip:text(textarea)
{label "Description"}
{html {rows 3 cols 50}}
}
} -select_query_name get_label -edit_data {
db_dml update_label { *SQL* }
} -after_submit {
ad_returnredirect "index"
}
In the .xql file:
<?xml version="1.0"?>
<queryset>
<fullquery name="get_label">
<querytext>
select
label_id,
label,
descrip
from
bma_ip_labels
where
label_id=:label_id
</querytext>
</fullquery>
<fullquery name="update_label">
<querytext>
update bma_ip_labels
set
label = :label,
descrip = :descrip
where
label_id = :label_id
</querytext>
</fullquery>
</queryset>
The form displays fine, with all the proper values, but when I click "Submit" it doesn't do the update, and doesn't go where -after_submit tells it to. Rather it comes right back to the edit page, with all the changes reset to their unchanged values. The logs only ever show the select_query_name query being run, even for a supposed update. That is the update_label query never gets run at all, so it's not as if it's failing and I'm seeing the results of an update that didn't work.
I've made sure all the files have been reloaded, and even restarted the server. This is OACS 4.6.3