I need to set a variable within a TCL page that has its content appended within another TCL file.
As in:
File item-ae.tcl
#####
ad_page_contract { ...}
global item_id_list ""
...
new AjaxUpload(btnUpload, {
action: 'append-item',
data: { item_id: $('#item_id').val()},
name: 'appenditem',
...
####
Within the TCL file "item-ae.tcl", I have an AJAX code that requests "append-item.tcl" eventually.
The ajax chunk has a form that sends data ("item_id") which will be submited as a form to the file "append-item.tcl" and there the item_id value is appended in the list "item_id_list"
#####
ad_page_contract { ...} {
{item_id}
}
lappend item_id_list $item_id
####
Back to the TCL file "item-ae.tcl", I need the content of the variable "item_id_list" to have the "item_id" appended recently in the previous request file.
Which means to have "item_id_list" working as a global variable among two pages
Is that possible?
How would I do that?