FETCH RECORD FROM POPUP, THEN PUT IN PARENT DETAILVIEW
I have been searching, and have not found anthing that works.
In my parent Grid, which has a grid part and detailview, I have a hyperlink to OPEN a new grid if record is not found (new grid is not linked).
the popup grid is searched by memberID. the following xbasic, followed by the javascript, is executed ONCLICK of memberId. Problem is, no matter what I try, I cannot get the xbasic to pass the selected row number back to the javascript so that I can reset the detailview to the selected record (partnetobject.detailview(#), even though I created them both in the same ONCLICK event.
The TABLE FETCH COMMANDS ARE WORKING, THE XBASIC IS GIVING ME THE CORRECT RECORD NUMBER THAT I NEED. I just can't get it back into the xbasic.
Any suggestions? The lines commented out are things I tried that did not work.
************************************************************
function serverside_9f316fa6fb904e1a90427291ecb2d18c as c (e as p)
serverside_9f316fa6fb904e1a90427291ecb2d18c = "//Replace this with the javascript to be returned by the function."
'This function will handle the Ajax callback.
'It must return a string of Javscript commands that will be executed in the Browser.
dim tbl as P
dim indx_name as P
dim global rec as N
dim global recno as N
dim memid as C
debug(1)
tbl=table.open("[PathAlias.ADB_Path]\members_master")
'e._currentrowDataNew.member_id 'contains the value of the newly selected (onclick) memberId to fetch
' IF MEMBER DOES EXIST, DO NOT ALLOW INSERT
indx_name = tbl.index_primary_put("Member_Id") 'put table in order based on new last_name (fieldname that was entered prior to search)
rec = tbl.fetch_find(e._currentrowDataNew.Member_id) 'see if record containing new lastname exists
if (rec > 0) then
tbl.fetch_goto(rec) 'this works great up to here!
recno=rec
'<<%str% window['rec']=rec
'%str%
'recno = <<%longstring% {grid.Object}.detailViewRefresh();
'%longstring%
'GRID1_GridObj.detailviewrefresh()
'parent.resynch()
'form.resynch("[PathAlias.ADB_Path]\members_master")
else
msgbox("Member does not currently exist, search in Voter Records")
end if
tbl.close()
end function
***** this is the JS in the same ONCLICK command, it is executed after the xbasic.
// this executes above xbasic, followed by below
/* serversidexbasic */
{grid.object}.ajaxCallback('G','{Grid.RowNumber}:all','serverside_9f316fa6fb904e1a90427291ecb2d18c','','_getData=true');
// nomatter what I try, I can't get the parent recno returned to use in {parentobject}.detailView(recno)
//Get a pointer to the parent Grid object that opened this Grid and execute a
var po = {grid.object}.getParentObject(); // works
//po.detailView(SESSION.RECNO);
//var recnum= po._selectedRow;
//if (window['rec']) rec = window['rec'];
//po.detailView(rec);
//po.detailViewRefresh();
// po.detailViewNewRecord() works great! but I want the "fetched" record, NOT a new record!
closeLastOpenedA5Window(); // this works
I have been searching, and have not found anthing that works.
In my parent Grid, which has a grid part and detailview, I have a hyperlink to OPEN a new grid if record is not found (new grid is not linked).
the popup grid is searched by memberID. the following xbasic, followed by the javascript, is executed ONCLICK of memberId. Problem is, no matter what I try, I cannot get the xbasic to pass the selected row number back to the javascript so that I can reset the detailview to the selected record (partnetobject.detailview(#), even though I created them both in the same ONCLICK event.
The TABLE FETCH COMMANDS ARE WORKING, THE XBASIC IS GIVING ME THE CORRECT RECORD NUMBER THAT I NEED. I just can't get it back into the xbasic.
Any suggestions? The lines commented out are things I tried that did not work.
************************************************************
function serverside_9f316fa6fb904e1a90427291ecb2d18c as c (e as p)
serverside_9f316fa6fb904e1a90427291ecb2d18c = "//Replace this with the javascript to be returned by the function."
'This function will handle the Ajax callback.
'It must return a string of Javscript commands that will be executed in the Browser.
dim tbl as P
dim indx_name as P
dim global rec as N
dim global recno as N
dim memid as C
debug(1)
tbl=table.open("[PathAlias.ADB_Path]\members_master")
'e._currentrowDataNew.member_id 'contains the value of the newly selected (onclick) memberId to fetch
' IF MEMBER DOES EXIST, DO NOT ALLOW INSERT
indx_name = tbl.index_primary_put("Member_Id") 'put table in order based on new last_name (fieldname that was entered prior to search)
rec = tbl.fetch_find(e._currentrowDataNew.Member_id) 'see if record containing new lastname exists
if (rec > 0) then
tbl.fetch_goto(rec) 'this works great up to here!
recno=rec
'<<%str% window['rec']=rec
'%str%
'recno = <<%longstring% {grid.Object}.detailViewRefresh();
'%longstring%
'GRID1_GridObj.detailviewrefresh()
'parent.resynch()
'form.resynch("[PathAlias.ADB_Path]\members_master")
else
msgbox("Member does not currently exist, search in Voter Records")
end if
tbl.close()
end function
***** this is the JS in the same ONCLICK command, it is executed after the xbasic.
// this executes above xbasic, followed by below
/* serversidexbasic */
{grid.object}.ajaxCallback('G','{Grid.RowNumber}:all','serverside_9f316fa6fb904e1a90427291ecb2d18c','','_getData=true');
// nomatter what I try, I can't get the parent recno returned to use in {parentobject}.detailView(recno)
//Get a pointer to the parent Grid object that opened this Grid and execute a
var po = {grid.object}.getParentObject(); // works
//po.detailView(SESSION.RECNO);
//var recnum= po._selectedRow;
//if (window['rec']) rec = window['rec'];
//po.detailView(rec);
//po.detailViewRefresh();
// po.detailViewNewRecord() works great! but I want the "fetched" record, NOT a new record!
closeLastOpenedA5Window(); // this works