Hi,

sorry, but it's me again. I still do not understand this stuff...
No the switch between the panels is working, but everytime the panel is
changed, all the already entered form-values are lost. Here is a snipplet
out of the source:

private final class RegisterForm extends Form {
    private final ValueMap properties = new ValueMap();
    private RequiredTextField username = null;
    private PasswordTextField password = null;
    private RadioChoice registrationType = null;
    private final RegisterUserSinglePersonPanel singlePersonPanel;
    private final RegisterUserCompanyPanel companyPanel;

public RegisterForm(final String id) {
      super(id);
      AttributeModifier highlightAttributeModifier =
          new AttributeModifier("class", true, new AbstractReadOnlyModel() {
              public Object getObject(Component component) {
                  if (component.hasErrorMessage())
                      return "inputNormalMissing";
                  return null;
              }
          });

      username = new RequiredTextField("username", new
PropertyModel(properties, "username"));
      username.add(StringValidator.minimumLength(5));
      username.add(highlightAttributeModifier);

      password = new PasswordTextField("password", new
PropertyModel(properties, "password"));
      password.add(StringValidator.minimumLength(5));
      password.add(highlightAttributeModifier);

      registrationType = new RadioChoice("registrationType", new
PropertyModel(properties, "registrationType"), TYPES).setSuffix("");

      singlePersonPanel = new
RegisterUserSinglePersonPanel("registerSinglePersonPanel");
      singlePersonPanel.setVisible(true);

      companyPanel = new RegisterUserCompanyPanel("registerCompanyPanel");
      companyPanel.setVisible(false);

      registrationType.add(new AjaxFormComponentUpdatingBehavior("onchange")
{
        protected void onUpdate(AjaxRequestTarget target) {
          singlePersonPanel.setVisible(!singlePersonPanel.isVisible());
          companyPanel.setVisible(!companyPanel.isVisible());
          target.addComponent(singlePersonPanel.getParent());
        }
      });

      add(username);
      add(password);
      add(registrationType);
      add(singlePersonPanel);
      add(companyPanel);
    }
}

Does anybody knows what I'm doing wrong? In case I type some value into
username and afterwards select something in my radio-button, the panels
(singleUser and company) are switched (thats OK) but my value in username is
lost... :-(
-- 
View this message in context: 
http://www.nabble.com/Show-and-hide-panel-with-radio-choice-tf4779601.html#a13681821
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to