TokenList - IllegalArgumentException

Hi,
I’m trying to use TokenList control in my application but I’m getting IllegalArgumentException when I try to select the item from the list.
I’ve created a test project following Cuba Sampler example but still get the same exception.
image
Please point me what I’m missing. Here is my test project: testtokenlist.zip (97.2 KB)

Hi.

The problem occured due incorrect defining of optionsContainer value in lookup attribute of tokenList.

You should create new data component collection for entity OrderItem in order-edit.xml:

<collection id="orderItemsDc" class="com.company.testtokenlist.entity.OrderItem">
     <view extends="_local">
         <property name="product" view="_minimal"/>
    </view>
    <loader id="orderItemsDl">
          <query>
               <![CDATA[select e from testtokenlist_OrderItem e]]>
          </query>
     </loader>
<collection>

This container should be used in lookup:

<lookup optionsContainer="orderItemsDc"/>

Pay attention to property product in view component, it should be defined to avoid IllegalStateException: Cannot get unfetched attribute [product].

Regards,
Nadezhda.

Thank You for the explanation