views:

10

answers:

0

I am customising my IzPack, I have a custom IzPanel which parses some files (created by a previous installation of the same program), and is attempting to populate the

In MyCustomIzPanel.java (a customised IzPanel)

    //idata is the InstallData object
    String oLicenceFile = ... // Code to obtain where this file is
    idata.setVariable("license_locn", oLicenceFile);
    idata.setAttribute("license_locn", oLicenceFile);
    idata.setVariable("license_locn_str", oLicenceFile);
    idata.setAttribute("license_locn_str", oLicenceFile);

In userInputSpec.xml (which defines the UserInputPanel)

    <field type="search" variable="license_locn">
        <description
            align="left"
            txt="Please select a license file."
            id="description.license_locn"/>
        <spec txt="Path to license file:" id="description.license_path"
              type="file" result="file"
              set="$license_locn_str">
            <choice value="~/license.bin" os="unix" />
            <choice value="C:\My Documents\license.bin" os="windows" />
        </spec>
    </field>

When the UserInputPanel displays the search field remains blank; thus neither the setVariable nor the setAttribute properties appear to get the job done. Even when explicitly specified using the set attribute of the <spec> tag.


[more detail]

InstallData object which can be thought of as a single shared instance accessible by the various panels. InstallData is a (wrapper around a) Properties object

I should mention that when the field type is text, instead of search, the variable gets passed from MyCustomIzPanel to UserInputPanel successfully.

In MyCustomIzPanel.java

    idata.setVariable("user_email_address", oEmail);

In userInputSpec.xml (which defines the UserInputPanel)

    <field type="text" variable="user_email_address">
      <description align="left" txt="Please enter your email address."
                   id="user.email"/>
      <spec txt="email:" id="text.label" size="30" set="user@host"/>        
    </field>

So the problem breaks down to: why it works on "text" but not "search"?