Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
getItemProperty and null
IndexedContainer ct = new IndexedContainer();
ct.addContainerProperty("p1", String.class, "");
Item item = ct.addItem("item1");
Property property = item.getItemProperty("p2");
if (property != null) System.out.println("ok");
Why is this code returns "ok" ? Property with the id "p2" does not exist.
Last updated on Apr, 28th 2012
Hi Andrey,
After reading javadoc, I think your code should never print ok.
But when I looked at the source for the
getItemProperty()
in the implementation of Item in the class IndexedContainerItem, I found that the method always return a new object
/*
* (non-Javadoc)
*
* @see com.vaadin.data.Item#getItemProperty(java.lang.Object)
*/
public Property<?> getItemProperty(Object id) {
return new IndexedContainerProperty(itemId, id);
}
So what's is wrong : this method above or javadoc ?.....
Hope Vaadin guys see that post and give us an explanation.
Regards.
Last updated on Apr, 28th 2012
You cannot reply to this thread.