Closing a Dialog Box

Hi everyone,

I have a problem concerning about closing Dialog Boxes. I have a script who is opening a module and closing and perfectly performing all actions during its execution for an opened module, however when it continues with the next module, i receive error messages, because i need to close the dialog box when i close the module. Nevertheless as i realize all actions in a void function, any close attempt in a void action is not allowed as i would be trying to access a global variable whereas i am in a local function, i mean in a void function. So my question, how can i close this box in a void function? Is there a way to do it?

Thanks in advance to everyone who pays attention.

Kind regards,

Melih
SystemAdmin - Wed Apr 15 06:10:07 EDT 2009

Re: Closing a Dialog Box
SystemAdmin - Wed Apr 15 06:16:54 EDT 2009

By the way i forgot to say that this function takes DB my_box as parameter where my_box is the name of my global dialog box variable.

Thanks

Re: Closing a Dialog Box
dpechacek - Wed Apr 15 08:20:48 EDT 2009

SystemAdmin - Wed Apr 15 06:16:54 EDT 2009
By the way i forgot to say that this function takes DB my_box as parameter where my_box is the name of my global dialog box variable.

Thanks

Can you post some code as I'm unsure what you're saying.

The only dialog box that has to close when a module is closed is the DXL window if its related to the module (meaning you opened it from the module windows through Tools -> Edit DXL). Are you sure that's not what you're talking about?

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Closing a Dialog Box
SystemAdmin - Wed Apr 15 08:57:31 EDT 2009

dpechacek - Wed Apr 15 08:20:48 EDT 2009
Can you post some code as I'm unsure what you're saying.

The only dialog box that has to close when a module is closed is the DXL window if its related to the module (meaning you opened it from the module windows through Tools -> Edit DXL). Are you sure that's not what you're talking about?

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Hi David,

No i'm not closing my module like that but instead i am looping inside a folder or a project and i ask DXL to read every item with the TypeItem == "Formal" then once i start reading it, i start to realize some actions like exporting to excel, sorting etc. And when the action is accomplished i close it with close function. After closing the module which works perfectly well, i want to destroy my box and continue with a new box when the second module is opened. Actually i can close the first module, then i can open the next module but since DXL is still using the box that i va just opened, it cannot assign a value to the columns. I need to close the box or destroy it, i mean, then continue with my loop.

Thanks again.

Re: Closing a Dialog Box
dpechacek - Wed Apr 15 10:45:13 EDT 2009

SystemAdmin - Wed Apr 15 08:57:31 EDT 2009
Hi David,

No i'm not closing my module like that but instead i am looping inside a folder or a project and i ask DXL to read every item with the TypeItem == "Formal" then once i start reading it, i start to realize some actions like exporting to excel, sorting etc. And when the action is accomplished i close it with close function. After closing the module which works perfectly well, i want to destroy my box and continue with a new box when the second module is opened. Actually i can close the first module, then i can open the next module but since DXL is still using the box that i va just opened, it cannot assign a value to the columns. I need to close the box or destroy it, i mean, then continue with my loop.

Thanks again.

Hopefully what we talked about in emails fixes the issue.

For others, I believe the problem lied with the fact that he has a module close trigger on his dialog box which was supposed to close the dialog box when the module was closed.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Closing a Dialog Box
SystemAdmin - Fri Apr 17 04:26:21 EDT 2009

dpechacek - Wed Apr 15 10:45:13 EDT 2009
Hopefully what we talked about in emails fixes the issue.

For others, I believe the problem lied with the fact that he has a module close trigger on his dialog box which was supposed to close the dialog box when the module was closed.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Hi everyone again,

I had a very useful conversation with David on mail, however i could not fix the problem, because i sussed that the problem does not arise from the fact that i cannot close it but because i was not re-initalizing it, so right now i am trying to fix out this point, and hopefully i will help me. Thanks anyways one more time to those who spared time for my problem.

Kind regards,

MY

Re: Closing a Dialog Box
dpechacek - Fri Apr 17 08:30:31 EDT 2009

SystemAdmin - Fri Apr 17 04:26:21 EDT 2009
Hi everyone again,

I had a very useful conversation with David on mail, however i could not fix the problem, because i sussed that the problem does not arise from the fact that i cannot close it but because i was not re-initalizing it, so right now i am trying to fix out this point, and hopefully i will help me. Thanks anyways one more time to those who spared time for my problem.

Kind regards,

MY

The main problem is that that script you're using wasn't written to be called more than once. You'll have to mess with the code to get it to work as a script that can be called numerous times.

Here is an export script that maybe would be easier for you to modify. Just have to take out the dialog box portions. You will need to download my Excel functions off Kevin Murphy's site and set the path to it for the include.

URLwww.baselinesinc.comURL

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Attachments

attachment_14241961_Object_Exporter.inc

Re: Closing a Dialog Box
llandale - Fri Apr 17 09:11:27 EDT 2009

So if I understand: you have a main dialog that loops through all modules in a folder. For each module you open it, and sometimes offer the user a new dialog box to do some chore. When the user closes the module you want to close the dialog and continue with the main dialog action, proceeding to the next module.

Gads, good luck.

First off: for all but the simplest of dialogs, I found out very early on that your Dialog Box variables (DB and DBEs) must be global variables defined at the top of the script, since callback/apply/button functions routinely need to access them. The DB parameter just about must be defined globally. (OK, lets forget about defining some Skip list as parameter and storing local DB and DBE values in it; as that's practically the same thing). In your case, I cannot imagine a script that doesn't have these defined globally. All my scripts now define them all globally, I don't bother thinking about whether or not this particular script can get away with them locally.

In your case, when its time to close the sub-dialog, that's easy since the DB is a global variable.

Now, as for you starting-stopping-waiting for the user to do something; as I said, good luck. The main loop cannot be a routine recursive "for itm in fld do" loop. The main script will need to find out all the modules it wants to deal with, store these in some global structure (like a Skip), and keep track of which one it has finished working. Store them in a global Skip with data string 'NameItemFull' and key int 'Sequencer' which starts at zero and increments each time you insert a new item name. You'll need some function that gets the 'next' item; it loops through the Skip looking for item #n+1. When it finds it it increments global int n; then passes the string off to the function that opens the module and figures out if the sub-dialogs are appropriate. Some function will need to figure out if its time for the 'next' item, no doubt in the sub-dialog close function. You thus have a circular reference and will need to pre-define the function that finds the next item (near the top of the script). A pre-defined function looks like this:

string GetNextItem()
      // notice there are no braces {} for this pre-defined function
... other functions go here ...
string GetNextItem()
{ body of this function.  Notice the braces {} mean this is the actual function
}

 


Sounds like you'll need a special main-dialog close function that figures out if the sub-dialog is open, and offers to close it along with the module that's currently open.

Yacks, good luck.

>Louie

 

Re: Closing a Dialog Box
SystemAdmin - Wed Apr 22 08:09:45 EDT 2009

thanks everyone who helped me, i remarked that eventough i thought that i was closing the box, i was forgetting all the time deleteing tabs and re-creating columns etc. Fortunately i saw this missing part, now everyting works perfectly. Anyways i thank you one more time for your interest.