Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to bypass previous form on release ?
#1
Hi all,

From a search form I call an edit form, but do not release the search form after creating and showing the edit form.

After the edit, I release the edit form, and sometimes I need / want to go back to the previous form (to search again) and at other times I want bypass the search form (release that as well) to go further back in the chain of forms.

So depending on what I want, releasing the edit form is not enough. I've tried with calling Release twice, but no result;

What is the right way of moving back through the line of active forms ?

Back to previous form: Release (any other commands?)

Back to the form before previous: ?
Back to main form ?

If is it possible to access the list of active forms, would it be possible to release all until a specific form, maybe identified by name ?

I mean the list of active forms is like the heap. Latest created form on top. Would it be possible to iterate through the list, releasing all forms not needed anymore, thereby going back until the main, or a certain form, is on top ?

Something like

Repeat
  release;
until activeform = 'xxx';

Sorry for getting too exited. My main need is to be able to release the previous form as well as the one I releasing, but not always.

Regards
Soren
Reply
#2
(03-06-2020, 06:48 AM)SorenJensen Wrote: Hi all,

From a search form I call an edit form, but do not release the search form after creating and showing the edit form.

After the edit, I release the edit form, and sometimes I need / want to go back to the previous form (to search again) and at other times I want bypass the search form (release that as well) to go further back in the chain of forms.

So depending on what I want, releasing the edit form is not enough. I've tried with calling Release twice, but no result;

What is the right way of moving back through the line of active forms ?

Back to previous form: Release (any other commands?)

Back to the form before previous: ?
Back to main form ?

If is it possible to access the list of active forms, would it be possible to release all until a specific form, maybe identified by name ?

I mean the list of active forms is like the heap. Latest created form on top. Would it be possible to iterate through the list, releasing all forms not needed anymore, thereby going back until the main, or a certain form, is on top ?

Something like

Repeat
  release;
until activeform = 'xxx';

Sorry for getting too exited. My main need is to be able to release the previous form as well as the one I releasing, but not always.

Regards
Soren

Hi i think do you not worry about access at strack of forms. Intraweb free their for you.
The suggest that i can give you you should have always one active istance form for session it is stable and is optimal for memory managament.

You can do a custom method ShowForm() that verify if the form exists.

if the form does not exist you create and release else you only show and release the current active form.

Cheers

Andrea
Reply
#3
Hi Andera,

Thanks for your input.

I have a main form calling a search form. When rows are found, use can decide to edit some or all rows, and I call an edit form without releasing the search form. After editing the rows, use can choose to go back to main form, or return to search form to do more searching.

So when the user click a button called ReturnToSearch in the Edit form, I call release, and the Search form reappears. All well and as I want.
I have another button called BackToMain, and when user click that, I call release and the Search form reappears. Not good. Not the form I want.

How can I setup button BackToMain so that it releases Search Form as well as the edit form ?

Regards
Soren
Reply
#4
if you Release the current form just before you show another\new form - you will always have only 1 form.
like :
Release;
TfrmMyEditForm.Create(WebApplication).Show;

if you want to Release the top\current form, and you don't know which one it is (like in a menu, or a global "ShowForm" procedure etc'), then you can use :
// Release the current form
TIWAppForm(WebApplication.ActiveForm).Release;

don't forget to add IWAppForm to the Uses.
Reply
#5
Thanks, I'll do a bit of testing to find the right solution for me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)