I tried the code below. Personpanel / model looks similar to orderpanel /
model. OrderFactory2 creates another order with other data (quick and dirty).
But the display of order is not changing. Why is this not working, if i share
the model?
public HomePage(final PageParameters parameters) {
OrderModel m = OrderModelFactory.create();
IModel model = new CompoundPropertyModel(m);
setModel(model);
Panel pnlOrder = new OrderPanel("pnlOrder", m.getOrder());
pnlOrder.setOutputMarkupId(true);
add(pnlOrder);
Panel pnlShipTo = new PersonPanel("pnlShipTo", m.getShipTo());
pnlShipTo.setOutputMarkupId(true);
add(pnlShipTo);
add(new AjaxLink("lnkNext") {
public void onClick(AjaxRequestTarget target) {
OrderModel m2 = OrderModelFactory2.create();
HomePage.this.setModelObject(m2);
target.addComponent(HomePage.this.get("pnlOrder"));
target.addComponent(HomePage.this.get("pnlShipTo"));
}
});
}
public class OrderPanel extends Panel {
/**
* Constructor of OrderPanel.
*/
public OrderPanel(String id, Order m) {
super(id);
add(new Label("orderId", new PropertyModel(m, "orderId")));
add(new Label("orderDate", new PropertyModel(m, "orderDate")));
}
}
public class OrderModel implements Serializable {
private Order order = null;
public Order getOrder() {
return order;
}
public void setOrder(Order pOrder) {
order = pOrder;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]