wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vishal Popat <vishal.po...@cipriati.co.uk>
Subject Model data lost when calling target.add before onSubmit
Date Wed, 25 Jun 2014 20:32:44 GMT
Hi,

I have two panels added to a form. The idea is to create a step 1, step 2 type functionality
where after clicking next on panel 1, it hides and shows Panel 2.

I have a checkbox on Panel 1
		add(new CheckBox("single", new PropertyModel(SelectionPanel.this, "single")));

and I have the following link
		add(new AjaxLink("next") {
			@Override
			public void onClick(AjaxRequestTarget target) {
				panel1.add(new AttributeModifier("style", new Model<String>("display:none")));
				target.add(panel1);
					
				JQueryEffectBehavior effectBehavior = new JQueryEffectBehavior("#panel2", "slide", slideOptions,
400);
				target.appendJavaScript(effectBehavior.toString());
				target.add(panel2);
			}
		});

I submit the form using AjaxButton on panel2 where I log out the PropertyModel data. The data
shows the defaults for single in panel1 but is fine for any data in Panel2

I have narrowed it down to when I call target.add(panel1) in the onClick.

Does this call clear any Model data that has not been submitted?

Regards
Vishal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message