Re: Display A Dialog box Xbasic during ajax call back
Just to let everybody here know. This thread really helped me and I wanted to say THANK YOU. I keep notes for myself about how to do something, and thought I'd just share my notes about this one.
'HERE IS HOW TO DO A MESSAGE BOX THAT HAS DATA IN IT. You will need to pass in data via parameters from Xbasic function to a javascript function.
Here is an example of an Xbasic function. You would probably set the variables to some result set info from sql query, or error message?
'
Here is an example of the javascript function that opens an OK message box with the data in it:
Here is an example of the javascript function that opens a Yes/No message box with data in it:
Just to let everybody here know. This thread really helped me and I wanted to say THANK YOU. I keep notes for myself about how to do something, and thought I'd just share my notes about this one.
'HERE IS HOW TO DO A MESSAGE BOX THAT HAS DATA IN IT. You will need to pass in data via parameters from Xbasic function to a javascript function.
Here is an example of an Xbasic function. You would probably set the variables to some result set info from sql query, or error message?
Code:
function TestMsgBoxWithData as c (e as p) dim Data1 as n Data1 = 45 'would probably be something like Data1 = rs.data(1) from a result set dim Data2 as c Data2 = "hello" 'would probably be something like Data1 = rs.data(2) from a result set 'call a javascript function to show the message, in this one, we are passing in 2 parameters TestMsgBoxWithData = "JSshowMessageData('" + Data1 + "','" + Data2 + "');" end function
Here is an example of the javascript function that opens an OK message box with the data in it:
Code:
function JSshowMessageData(Data1, Data2){ var _msg = '<div style="height: 1.5in; width: 2in; padding: 15pt;">Here is the message.<br><br>This is Data1: '+Data1+'.<br>This is Data2: '+Data2+'.</div>'; A5.msgBox.show('Resulting Message',_msg,'o',function(button){ if(button == 'ok'){ //alert('OK button clicked'); }else{ //alert('Action Cancelled by user.') } }); }
Code:
function JSshowMessageData(Data1, Data2){ var _msg = '<div style="height: 1.5in; width: 2in; padding: 15pt;">Here is the message.<br><br>This is Data1: '+Data1+'.<br>This is Data2: '+Data2+'.<br><br>Is it OK to do something?</div>'; A5.msgBox.show('Resulting Message',_msg,'yn',function(button){ if(button == 'yes'){ alert('programmer needs to put some action here'); }else{ //alert('Action Cancelled by user.') } }); }
Comment