Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Common behavior

...

Code Block
languagexml
titleExample
<dynamicvariables>
  <variable name="thechoice" value="fallback value">
  <variable name="thechoice" value="choice1" condition="cond1">
  <variable name="thechoice" value="choice2" condition="cond2">
</dynamicvariables>

Checkonce

A dynamic For comparison with the <variables> section - a dynamic variable behaves exactly like a "normal" IzPack variable with a static key-value pair if it has set the attribute checkonce="true".

...

In addition, if the user goes back through the panel sequence by pressing Previous, they must reach the first panel containing the variable before it will be unfrozen.

In this way, the variables can be reset to the proper values based on new conditions when the user navigates backward and forward multiple times and inputs new choices.

Global precedence for dynamic variable assignments

...

As a result of what was described above, variable assignments happen with the following precedence:

  1. UserInputPanel fieldUser input field (for instance on UserInputPanel, InstallPanel): A valid user input is assigned as a variable value and freezes the variable from further changes during refreshing.
    Note: Each panel can access an API for registering variable names it affects or override when being active. Freezing is not just limited to the UserInputPanel.
  2. Refresh: try to get the last valid value in order of the definitions taking the conditions into account
  3. Refresh: try to find a default value from the <variables> section
  4. Refresh: unset if the variable value cannot be assigned due to no variable condition evaluating to true.

...