Page 1 of 1

how open same form after some calculation

PostPosted: Thu Jul 19, 2012 10:20 pm
by hardina09
In my application,I am having two forms : 1. FormA and 2. FormB
FormA, displays data in tableview (locked) format based on below query :

Code: Select all
  foundset.loadRecords('select id from orderdetails where emp_id=? and jobStatus= ? ',[varEmpId,'OPEN'])


for each row of table has stop button which indicates once hit STOP button jobStatus would be changed to CLOSE for that row in DB table and pop-ups form FormB in modal dialog window which consist of text fields and a save button, so that remaining information is entered. Once hits save button in FormB. Does two task: 1. Updates information for that row in DB table and 2. Show the same form FormA. which displays all data where jobstatus='OPEN'.

In FormA onShow event I am loading foundset to display data in table format.

how to close modal dialog for FormB and then reload or reshow back the same form FormA with all the data where jobStatus = ' OPEN' , so that I can get exact result.

I hope I explained it properly...

Re: how open same form after some calculation

PostPosted: Thu Jul 19, 2012 11:17 pm
by omar
Hi Hardina,

If I understand correctly, you want to return to form A after saving in form B (which is a popup). I think the easiest way is to destroy form B and you will automatically return to form A. But of course you want to refresh the foundset so it doesn't show the record that was just closed right?

I would seperate the logic for refreshing/requerying form A in a seperate (public) form method (called something like requery()). So then you can call it from the onShow in form A and from the save method in form B. Then all the code you need after saving in form B is:

Code: Select all
   var win = controller.getWindow();
   win.destroy();
   forms.FormA.requery();


Hope this is what you mean?

Re: how open same form after some calculation

PostPosted: Fri Jul 20, 2012 4:04 pm
by hardina09
Great Omar. Worked as required. Thanks