Hi,
I am trying to setup an argument to use in a filter condition for a field in a FormView control. I am using a list editor on the field, and trying to populate the edit list with values from a field of another table.
I have setup an argument called idofsite which I have made equal to the siteid session variable:
idofsite = :siteid
I have also setup a client side data cache (which is used in the editor of the formview control) which does a query on the locations table qualified with a filter:
"WHERE site_id = :siteid.
:siteid is setup as a session variable which contains the value selected in the site dropdown.
As per a previous post, I am using a ajax callback and an xbasic function to setup the value in the session variable :
------------------------
JS code...
Code:
//Get the value in the site dropdown
var val = {dialog.object}.getValue('site');
//Ajax callback
{dialog.object}.ajaxCallback('','','setMySessionVariable','','__val='+val);
The xbasic function...
Code:
function setMySessionVariable as c (e as p)
dim value as c
value = e.__val
session.siteid = value
end function
------------------------
I can run the query from the client side data cache SQL genie, and it runs fine by manually entering the siteid value. However, it won't run from code. It always returns the values based on the default siteid value.
So the ajax callback/xbasic function doesn't appear to be properly setting the value of the session variable (siteid). Help muchly appreciated.
Regards,
Greg
I am trying to setup an argument to use in a filter condition for a field in a FormView control. I am using a list editor on the field, and trying to populate the edit list with values from a field of another table.
I have setup an argument called idofsite which I have made equal to the siteid session variable:
idofsite = :siteid
I have also setup a client side data cache (which is used in the editor of the formview control) which does a query on the locations table qualified with a filter:
"WHERE site_id = :siteid.
:siteid is setup as a session variable which contains the value selected in the site dropdown.
As per a previous post, I am using a ajax callback and an xbasic function to setup the value in the session variable :
------------------------
JS code...
Code:
//Get the value in the site dropdown
var val = {dialog.object}.getValue('site');
//Ajax callback
{dialog.object}.ajaxCallback('','','setMySessionVariable','','__val='+val);
The xbasic function...
Code:
function setMySessionVariable as c (e as p)
dim value as c
value = e.__val
session.siteid = value
end function
------------------------
I can run the query from the client side data cache SQL genie, and it runs fine by manually entering the siteid value. However, it won't run from code. It always returns the values based on the default siteid value.
So the ajax callback/xbasic function doesn't appear to be properly setting the value of the session variable (siteid). Help muchly appreciated.
Regards,
Greg
Comment