Here is a test sample of how constructor for Form2 class looks like:
Form2 should update both childId and parentName, when child changes in
form1.
However, I only get the childId updated; parentName does not change.


public Form2(String id, IModel<Child> form1model) {
super(id,model);
Label lblChild = new Label("childId", new PropertyModel<String>(form1model,
"Id"));
add(lblChild);
IModel<Patent> modelParent = null;
if (form1model.getObject().getId() != null) {
Parent par =
SpringCtx.getAppDB(ParentDao.class).selectById(form1model.getObject().getId());
modelParent = new Model<Parent>(par);
}
else
modelParent = new Model<Parent>();
Label lblParentName = new Label("parentName", new
PropertyModel<String>(modelParent, "Name"));
add(lblParentName);
}
Thank you for your help.

On Sun, Jul 3, 2016 at 12:06 AM, ganea iulia <superbiss...@gmail.com> wrote:

> Hello,
>
> In the form2 I need to display values from other models than in form1, but
> that are dependent on the values from the form1 model.
>
>
>
>
> On Tue, Jun 28, 2016 at 4:42 PM, Sven Meier [via Apache Wicket] <
> ml-node+s1842946n4674974...@n4.nabble.com> wrote:
>
>> After form submit the whole page will be re-rendered anyway, including
>> your form2. So you should not need to do anything additional here.
>>
>> Make sure your form2 is properly bound to your model objects:
>>
>> https://ci.apache.org/projects/wicket/guide/6.x/guide/modelsforms.html
>>
>> Have fun
>> Sven
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4674974.html
>> To unsubscribe from Change column visibility or text based on combo
>> selected value, click here
>> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4674943&code=c3VwZXJiaXNzaW1hQGdtYWlsLmNvbXw0Njc0OTQzfC01MzM2MjU4NzI=>
>> .
>> NAML
>> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-column-visibility-or-text-based-on-combo-selected-value-tp4674943p4675012.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to