how open same form after some calculation

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

how open same form after some calculation

Postby hardina09 » Thu Jul 19, 2012 10:20 pm

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...
hardina09
 
Posts: 62
Joined: Tue Apr 24, 2012 9:46 pm

Re: how open same form after some calculation

Postby omar » Thu Jul 19, 2012 11:17 pm

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?
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: how open same form after some calculation

Postby hardina09 » Fri Jul 20, 2012 4:04 pm

Great Omar. Worked as required. Thanks
hardina09
 
Posts: 62
Joined: Tue Apr 24, 2012 9:46 pm


Return to How To

Who is online

Users browsing this forum: No registered users and 7 guests