Anyway to get itemId(private variable) from a IndexedContainer item?

Hi,

I would like to know if there is anyway to get the itemId value which is a private variable in the IndexedContainer item.

Thanks in advance.

Dinesh, I do not understand your question. In order to get an Item, you need to provide the itemId.
Could you provide more details maybe?


compareProperty
I am actually overridding the method of the DefaultItemSorter.class .
Here I get two items which contain the itemId needed for implementing the sorting.

Hope its clear

An
ItemSorter
is used to compare two
item
s by a given property. You can use somthing like the following to get the values of the properties that the
ItemSorter
has to use for the comparison:

Object value1 = item1.getItemProperty(propertyId).getValue(); Object value2 = item2.getItemProperty(propertyId).getValue(); Keep in mind that an
itemID
is something containers use to identify their contained items. Think of it as a way to
ask
for an item inside a
Container
, so in the context of an
ItemSorter
, there’s no point of having any itemIDs as you already have the two items you need to compare (no need to
ask
for them).