(by Elmar GROM)
This panel allows you to prompt the user for data. What the user is prompted for is specified using an XML file which is included as a resource to the installer. Most of the panels that come with IzPack take user input in some form. In some panels this is through a simple user acknowledgment in others the user can enter text or select a directory through a file open dialog. In all of those cases the user input is used for the specific purpose needed by the panel that takes the input. However, if you need user input during installation that will later on be available to your application then you need to use the user input panel.
To use this panel, list it in the install file with the class name
UserInputPanel. In addition, you must write a XML specification and add it to the install resources. The name of this resource must be
<resources> <res id="userInputSpec.xml" src="user_input_spec.xml" parse="yes" type="xml"/> </resources> ... <panels> ... <panel classname="UserInputPanel" id="userinputpanel.orderpanel1"/> ... </panels>
A UserInputPanel can be highly dynamic from IzPack 4.3 on, as it will be refreshed every time the user input changes and will be rendered based on conditions. For instance, it would be possible to enable or disable some more options by clicking a checkbox.
- Combo Box
- Radio Buttons
- Check Box
- Multiple files
- Rule Input Field
- Search Field
Additionally visual elements can be added using the following types:
The top level XML section is called
<userInput>. For most panels it does not make sense to present them more than once, however you might want to present multiple user input panels -with different content of course. Therefore the
<userInput> section can contain multiple tags that each specify the details for one panel instance.
The <panel> Element
The tag name for this is
<panel> tag uses the following attributes:
This is the id of the user input panel for which this specification should be used. This id links to the panel specification in the install.xml file.
Sets the alignment of fields used in the panelThere are three general layout rules this panel uses, they are
left, center, right default: left
Normally the user input is shown with a small border. To prevent this border set this attribute to
true, false default: true
This can be used to set the column width of the two column layout. This value is in percent of the whole size. If it is set to
0-100 percent default: 0
|no||Id of a string that represents what header name to display in the SummaryPanel of the UserInputPanel. This attribute must be defined if you would like to summarize the UserInputPanel. Note that you will have to add the summaryKey attribute to the fields you would like those to show up in the SummaryPanel as well.||String Value|
Each panel can have a number of visible elements, fields.
|no||If this tag is present the appropriate user input panel gets activated just if the mentioned pack is selected by the user in the PacksPanel.||Valid pack names, see PacksPanel.|
|no||If this tag is present the appropriate user input panel gets activated just if the mentioned pack is selected by the user in the PacksPanel .||Valid pack names, see PacksPanel.|
|no||Operating system-specific constraints.||Valid OS constraints, see OS Restrictions.|
To provide internationalization you can create a file named
xyz is the ISO3 code of the language in lowercase. Please be aware that case is significant. This file has to be inserted in the resources section of
install.xml with the
src attributes set at the name of the file.