Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed link to v4 Samplel userInputSpec

When you need to capture user input that will be available to your installer then you need to use the UserInputPanel.

This panel allows you to prompt the user for data that you can use later in the installation process.

...

There is a more complex example of a userInputSpec.xml from izPack v4 at http://izpack.org/documentation/sample-at Sample userInputSpec.htmlxml showing 3 panels. There are some advanced features in this example, but the general flow should be looked at first.

...

The tag name for this is <panel>The <panel> tag uses the following attributes:

Name

Required

Description

Values

id

yes

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.

String Value

layout

no

Sets the alignment of fields used in the panelThere are three general layout rules this panel uses, they are left, center and right. While left is most commonly used, you might want to experiment with this attribute and see which you like best. The default is left.

left, center, right default: left

border

no

Normally the user input is shown with a small border. To prevent this border set this attribute to false.

true, false default: true

column_width

no

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, which is the default, the width will be set automatically. It it is set to 50 the gap between the left and right column is in the middle of the panel. This makes it possible to make a centered layout.

0-100 percent default: 0

summaryKeynoId 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 information about the user input in this panel in the SummaryPanel.. 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
readonlyno

The readonly attribute reverses the displayHidden logic described below - readonly="true" means to display a complete panel read-only in general in case it is not disabled by a general panel condition.

Code Block
languagexml
titleExample of the readonly attribute
collapsetrue
<panel id="panel.dbsettings" readonly="true">
  <field ... >
  </field>
...
</panel>


 true, false default: false
readonlyConditionno

The readonlyCondition attribute enhances and replaces the readonly condition and makes the related behavior dependent on another condition. Thus, all fields on the panel get displayed read-only only if it is not disabled by a general panel condition and the condition specified by readonlyCondition gets true.

Code Block
languagexml
titleExample of the readonlyCondition attribute
collapsetrue
<panel id="panel.dbsettings" readonlyCondition="isReadOnlyPanel">
  <field ...>
  </field>
...
</panel>


true, false default: false
displayHiddenno

Setting displayHidden attribute in the <panel> element causes all fields within the panel to be shown regardless of what each field's condition evaluates to.

Displayed hidden fields are disabled (ie. "greyed out") .

But if the condition of the panel evaluates to false, display all fields on the panel just as disabled instead of hiding it.

Code Block
languagexml
titleExample of the displayHidden attribute
collapsetrue
<panel id="a.panel" displayHidden="true">
	<field type="check" variable="b" conditionid="b.cond">
    	<spec id="b.id" true="true" false="false"/>
	</field>
	<field type="check" variable="c" conditionid="c.cond">
	    <spec id="c.id" true="true" false="false"/>
	</field>
<panel>


true, false default: false
displayHiddenConditionno

The displayHiddenCondition attribute enhances and is an alternative to the displayHidden condition and makes the related behavior dependent on another condition. Thus, all fields on the panel get displayed read-only only if a general condition on that panel disables it for displaying and the condition defined by displayHiddenCondition gets true.

Code Block
languagexml
titleExample of the displayHiddenCondition attribute
collapsetrue
<panel id="b.panel" displayHiddenCondition="isDisplayHiddenPanel">
	<field type="check" variable="b" conditionid="b.cond">
    	<spec id="b.id" true="true" false="false"/>
	</field>
	<field type="check" variable="c" conditionid="c.cond">
	    <spec id="c.id" true="true" false="false"/>
	</field>
<panel>


true, false default: false
rigidno

When set to "true", the topBuffer will represent a number of pixels rather than a percentage.

true, false
default: false 
topBufferno

Represents the percentage of leftover vertical space to place on top of the components. Setting topBuffer=0" prevents the panel from being moved up or down during dynamic layout creation.
If the rigid attribute is set to true, the topBuffer value represents the number of pixels to place on top of the components rather than the percentage of left over space.

Integer
default: 25 

 

Nested Elements

NameRequiredDescriptionValues
createForPacknoIf 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.
createForUnselectedPacknoIf this tag is present the appropriate user input panel gets activated only if the mentioned pack is not selected by the user in the PacksPanel .Valid pack names, see PacksPanel.
osnoOperating system-specific constraints.Valid OS constraints, see OS Restrictions.
fieldnoOne or more user input field definitions, described on the page Fields.Valid user input field definitions, see Fields for more information.

 

Internationalization

To provide internationalization, you create a file named userInputLang.xml_xyz where 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 id and src attributes set at the name of the file.

...