THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
My problem was that I created a label with constant model, that is set to the value of currentItem.getName
. So even if you change current item later, the item container is not recreated, thus the label still shows old current item name.
The solution would be to create the label like this (assuming currentItem
is a member variable of enclosing class):
Code Block |
---|
public class MyPage extends WebPage { private MyObject object; public MyObject getObject() { return object; } public void setObject(MyObject object) { this.object = object; } public class MyObjectDetailsContainer extends WebMarkupContainer { public MyObjectDetailsContainer(String id) { add(new Label("objectName", new PropertyReferencePropertyModel(MyPage.this, "object.name")); } } } |