We need you!


The IzPack documentation needs work, and you are invited to edit it!

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This field allows the user to select a file from the file system. Text can be added before the selection or a static text element can be added to display above the selection box (a little more visually appealing).


Code Block
<field type="file" align="left" variable="the.file">
  <spec txt="" size="25" set=""/>
<field type="staticText" align="left" txt="Existing SSL keystore to import:"/>
<field type="file" align="left" variable="existing.ssl.keystore">
  <spec txt="" size="25" set="$myconfig"/>



Pressing 'Next' without a file selected show the following message:


Messages for the file field can be customized by creating a custom lang pack and overriding the following values (attribute values wrapped for readability):

Code Block
<str id="UserInputPanel.file.nofile.message" txt="You must select a valid file."/>
<str id="UserInputPanel.file.nofile.caption" txt="No File Selected"/>
<str id="UserInputPanel.file.notfile.message" txt="The file you have chosen either does not exist or is not valid."/>
<str id="UserInputPanel.file.notfile.caption" txt="Invalid File"/>


If you wish to have a file field that can be used optionally, use the attribute allowEmptyValue="true" inside of the nested spec element:

Code Block
<field type="file" variable="the.file">
  <spec txt="" size="25" allowEmptyValue="true" set=""/>



Note: Mixing file fields with other fields that have text in front of them can lead to formatting (layout) issues. Placing these types of elements on different panels can provide a much better user experience.