Page 1 of 1

Custom Parameters for Inventory Items

Posted: 18 Jul 2011, 12:00
by _jrn
Hello,

I have a problem with setting custom parameters for inventory items.

When overriding OpenSpaceExtension getInventoryItemsList method i'm browsing the items list in the debugger but none of items has these fields defined in properties hashmap. All i have is:

Code: Select all

[null, null, null, null, null, null, null, null, null, null, null, null, null, null, key=sofa, null]
This is an example of inventory:

Code: Select all

{"cpk":"yName;yId","items":[{"t":"t","p":"furniture_fabric_sofa;88","a":"t6;;t6;;t6;;t6","i":"sofa"},{"t":"t","p":"furniture_design_coffee_table;89","a":"t48;;t48;;t48;;t48","i":"table"},{"t":"t","p":"furniture_design_guitar;90","a":"t19;;t19;;t19;;t19","i":"guitar"}]}
What's wrong with it?

BTW custom parameters are visible on client side after loading the inventory. Is there any possibility to have it on server side?

Posted: 19 Jul 2011, 12:24
by Bax
How do you "browse the items list" exactly?

Posted: 19 Jul 2011, 12:58
by _jrn
At first i tried to get the parameter using ItemProperties method

Code: Select all

getProperties().get( "yName" )
but it didn't work so i set the breakpoint to browse the list using debugger and search for my custom parameters with no success.

Posted: 20 Jul 2011, 06:51
by Bax
But the list of ItemProperties objects is what you have to return when you override the getInventoryItemsList method. In other words you have to create those objects.

Posted: 20 Jul 2011, 07:05
by _jrn
In overridden method getInventoryItemsList I call super.getInventoryItemsList() to get the full list of items and then filter it. The list is fine except not having custom parameters defined in OpenSpace Editor.

Posted: 25 Jul 2011, 13:12
by Bax
Ouch... we might have left some test code behind...
Can you please contact us by email? We will send a test extension to check if it works. If you own a retail license, please send your invoice too.
Thank you.