Select.setItemCaption not working

Im not sure if this is a bug or if Im doing something wrong… According to the book I can set my caption in a select

My code [code]

for(TitleRequestType t  : TitleRequestType.values())
    {
    	Object item = reqType.addItem(t.name());
    	reqType.setItemCaption(item,t.getRequestLongText());
    }

[/code]

the select is showing the t.name() value in the caption and not the t.geTrequestLongText() string value as it should…

Am I missing something??

Thanks
Dan

Hi,

You are using the
Item
instead of the
itemId
-
addItem()
returns the generated
itemId
while
addItem(Object itemId)
returns the
Item
itself.

Do this instead (for instance):

reqType.setItemCaption(t.name(),t.getRequestLongText());

Best Regards,
Marc

ah… i noticed that after my post… it’s all set… thanks

I had the same error and now it works! Thank you!