Hello,
I am new to wicket. I am using WizardStep. I need to define a panel where I
select a hostname, the second part of the page is form allowing to display and
set a list of properties for the selected hostname.

my hostname 1 gets a varList of A,B.
my hostname 2 gets a varList of C,D,E.

When I select hostname 1, I get the A,B parameters displayed.
Then I select hostname 2, and I get A,B,E displayed instead of C,D,E !

I checked that setHostSelector(hostname2) set the varsList properly when called
the second time. But apparently wicket override the values with A,B values.

When I trace with wireshark what is going back and forth between client and
server I see that there is a POST done with hostname 2 PLUS the parameters A,B,
which I didn't modified by the way. So it sounds like after
setHostSelector(hostname 2) get called, the modification done in this setter are
overriden by
wicket.

How should I design this to get the correct job done ?


Here is a snippet of my code

Thanks for your help,
Herve

private final class CSIParamStep extends WizardStep
  {
    public CSIParamStep()
    {
      super();
      setTitleModel(new Model("my service config wizard"));
      setModel(new CompoundPropertyModel(ServiceDeployWizard.this));
      CompoundPropertyModel sel = new
CompoundPropertyModel(toBeDeployedContainerList);
      DropDownChoice hostSelector = new DropDownChoice("hostSelector", sel);
      add(hostSelector);
      add(new Button("select")
      {
        @Override
        public void onSubmit()
        {
        }
      });

      Form varsForm = new Form("paramsForm", new
CompoundPropertyModel(varsList));
      ListView varsView = new ListView("varList", varsList);
      varsView.setReuseItems(true);
      varsForm.add(varsView);
      add(varsForm);
    }
}

public void setHostSelector(String name)
  {
...
      varsList.clear();
      varsList.addAll((PropertyList) getMyvarList());

}


Then the corresponding html code is
<wicket:panel>
<br>

        <table class="params">
                <tr>
<td class="paramValue"><input wicket:id="select" type="submit"
value="select"/></td>
                </tr>
        </table>

    <form wicket:id="paramsForm">
        <table class="params">
        <span wicket:id="varList">
                <tr class="optionalAttribute">
                <td class="paramValue"><input wicket:id="key" type="text"/></td>
                <td class="paramValue"><input wicket:id="value" 
type="text"/></td>
                </tr>
            </span>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to