Hi all! I have 14 years of programming experience but I am completely new to Alpha Anywhere, xBasic and JavaScript so please excuse my ignorance! I hope what I'm about to say makes sense and that someone can offer some helpful advice. And honestly, it should be relatively simple!
I'm trying to use set a session variable to use throughout my application. Basically, when I click on a grid row, I need the id of the record (which is also available in detail view) and on detail view there is an image that when clicked, I need to pass the id so it can be used in a SQL update statement. So the bottom line is, on the DETAIL view, when I click an image, I want to pass the ID to the new web component.
First thoughts were to set the session variable in the OnDetailViewRender server side event. However, it is firing when the GRID is loaded and not when I click on a row to display the DETAIL view. It doesn't fire at all when the DETAIL view is launched. If I could figure this much out, I can probably get what I want to work.
Next thing I tried was the client side OnRowSelect event. I can get the id of the record clicked from the grid (log_nbr):
var rn = {grid.object}._selectedRow;
var log_nbr = {grid.Object}._getValue("G",'LOG_NUMBER',rn); //NOTE: get an error when I use "D" so left it as "G"
now I want to set log_nbr to a session variable for use on the other screen.
I see that session variables are not available client side without setting the PUBLISH SESSION VARIABLES property on the grid so I did set that to SESSION.LOG. I can initialize SESSION.LOG to anything I want (like in OnGridInitialize SESSION.LOG = 123) but I need to set it in the OnRowSelect to the value of log_nbr and I can't figure out how. SESSION.LOG = log_nbr: causes an error "session is undefined".
So I'm clearly doing something wrong or misunderstanding how the session variable works. Can anyone help?
Thanks in advance.
I'm trying to use set a session variable to use throughout my application. Basically, when I click on a grid row, I need the id of the record (which is also available in detail view) and on detail view there is an image that when clicked, I need to pass the id so it can be used in a SQL update statement. So the bottom line is, on the DETAIL view, when I click an image, I want to pass the ID to the new web component.
First thoughts were to set the session variable in the OnDetailViewRender server side event. However, it is firing when the GRID is loaded and not when I click on a row to display the DETAIL view. It doesn't fire at all when the DETAIL view is launched. If I could figure this much out, I can probably get what I want to work.
Next thing I tried was the client side OnRowSelect event. I can get the id of the record clicked from the grid (log_nbr):
var rn = {grid.object}._selectedRow;
var log_nbr = {grid.Object}._getValue("G",'LOG_NUMBER',rn); //NOTE: get an error when I use "D" so left it as "G"
now I want to set log_nbr to a session variable for use on the other screen.
I see that session variables are not available client side without setting the PUBLISH SESSION VARIABLES property on the grid so I did set that to SESSION.LOG. I can initialize SESSION.LOG to anything I want (like in OnGridInitialize SESSION.LOG = 123) but I need to set it in the OnRowSelect to the value of log_nbr and I can't figure out how. SESSION.LOG = log_nbr: causes an error "session is undefined".
So I'm clearly doing something wrong or misunderstanding how the session variable works. Can anyone help?
Thanks in advance.
Comment