Copy link to clipboard
Copied
Hi,
Does anybody could try try to explain to me the "inheritDialog" parameter for a dialog box, and how to use it?
The API reference says :"A Dialog object that should be reused when displaying this dialog box. It is useful when displaying a series of dialog boxes (such as a wizard) to prevent one from disappearing before the new one is displayed. The default is not to reuse a dialog box."
I am doing a series of nested dialog boxes that seems to work fine (without this parameter) and I'm wondering if I need to use it. If so, how use this setting ?
Thanks in advance.
@+
Copy link to clipboard
Copied
I don't think I ever implied that you have access to the previous dialog's properties. This is not inheritance in the OO sense.
Let's take a step back: You want to use two or more dialogs that all appear in the same spot on the screen. You can create one dialog and then when the user clicks on the "OK" button destroy this dialog and create the second. This will create some flicker on the screen: One window goes away and a second one gets created.
When you look at the installation wizard you get when you install software, there is one frame that stays on the screen throughout the process, but the contents are different. This is what you get with the inheritDialog parameter. You still have to fill in the details by providing a new dialog object with text fields, radio buttons, and so on. The only thing you get is that the window never disappears.
There is a good chance that you do not need this parameter. I've been programming with Acrobat's JavaScript for a long time, and I've never used it in an actual project.
Copy link to clipboard
Copied
This is for using the same dialog box, but with different contents (like in a wizard where every step uses the same frame), if you have nested dialogs, they are all in their own boxes, so you should not use this parameter.
Copy link to clipboard
Copied
OK, thank you.
So what does mean "It is useful when displaying a series of dialog boxes..."? A series of consecutive dialog boxes (one after an other one) or elements refreshed (or new elements) in a single dialog box? And "... to prevent one from disappearing before the new one is displayed."? I never noticed that!
@+
Copy link to clipboard
Copied
Again, this is for impementing something like a wizard (https://en.wikipedia.org/wiki/Wizard_(software)) where you have one dialog with different contents for the different e.g. installation steps a user needs to perform. You don't want that dialog window to go away when you create the contents for the next step. That is when you "inherit" the previous dialog, but fill it with new content.
The easiest way to understand what it does by just trying it: Create one dialog where the "OK" button closes the first dialog and creates a second dialog, but do not use the inheritDialog parameter, then do the same excercise again, but use the inheritDialog parameter and provide the dialog object of the first dialog.
Copy link to clipboard
Copied
I think I pretty much understand, thanks. I will try you test!
@+
Copy link to clipboard
Copied
If I understand well, you have a script for a first dialog box...
...and an other one for a second one
The inheritDialog parameter should be able to directly recover the value of the edit text window from the first dialog box into the second one. Correct?
Where and how to place this parameter in the script of the second dialog box??? In the script below, for example (the script of the first one being the same):
var dialog={
description: {
name: "Second Dialog box",
elements: [
{
type: "view",
elements: [
{
type: "view",
alignment: "align_top",
elements: [
{
type: "edit_text",
item_id: "edtx",
width: 150,
height: 20
},
]
},
{
type: "ok_cancel",
},
]
},
]
}
};
Thanks.
@+
Copy link to clipboard
Copied
I don't think I ever implied that you have access to the previous dialog's properties. This is not inheritance in the OO sense.
Let's take a step back: You want to use two or more dialogs that all appear in the same spot on the screen. You can create one dialog and then when the user clicks on the "OK" button destroy this dialog and create the second. This will create some flicker on the screen: One window goes away and a second one gets created.
When you look at the installation wizard you get when you install software, there is one frame that stays on the screen throughout the process, but the contents are different. This is what you get with the inheritDialog parameter. You still have to fill in the details by providing a new dialog object with text fields, radio buttons, and so on. The only thing you get is that the window never disappears.
There is a good chance that you do not need this parameter. I've been programming with Acrobat's JavaScript for a long time, and I've never used it in an actual project.
Copy link to clipboard
Copied
There is a good chance that you do not need this parameter. I've been programming with Acrobat's JavaScript for a long time, and I've never used it in an actual project.
By Karl Heinz Kremer
So I'm giving up!
Thanks

