Invalid item's metaclass

Hi all,

I have an entity (Suggestion) that has 3 fields which are all associations coming from the same other entity (User).

The fields for Suggestion are as follows:
recipient (association - user id)
suggestion (association - user id)
suggester (association - user id)

I am running into trouble in my view. There are a few behaviors that are wrong.

First, based on the number of rows fetched, it looks like it is fetching all existing Users instead of all existing Suggestions. The columns are “User.recipient”, “User.suggestion”, and “User.suggester”, which leads me to believe for some reason the loader thinks that it is loading User instances instead of Suggestion instances.

Second, when I click the “Create” button, I get the following error (I’ve masked the company name).

DevelopmentException: Invalid item's metaClass 'xxxxx_User'

container: InstanceContainerImpl{entity=xxxxx_Suggestion, view=com.xxxxx.xxxxx.entity.Suggestion/suggestion-view}
metaClass: xxxxx_User

This is my browse screen file:

<window xmlns=""
        <collection id="suggestionsDc"
            <loader id="suggestionsDl">
                    <![CDATA[select e from xxxxx_Suggestion e]]>
        <instance id="suggestionDc"
        <collection id="recipientsDc" class="com.xxxxxx.xxxxxx.entity.User" view="_minimal">
            <loader id="recipientsDl">
                    <![CDATA[select e from xxxxx_User e]]>
        <collection id="suggestionsDc" class="com.xxxxx.xxxxxx.entity.User" view="_minimal">
            <loader id="suggestionsDl">
                    <![CDATA[select e from xxxx_User e]]>
        <collection id="suggestersDc" class="com.xxxxx.xxxxx.entity.User" view="_minimal">
            <loader id="suggestersDl">
                    <![CDATA[select e from xxxxx_User e]]>
        <action id="save" icon="icons/ok.png" caption="mainMsg://actions.Ok" shortcut="CTRL-ENTER"/>
        <action id="cancel" icon="icons/cancel.png" caption="mainMsg://actions.Cancel" description="Esc"/>
    <dialogMode height="600" width="800"/>
        <split id="split" height="100%" orientation="horizontal" reversePosition="true" width="100%">
            <vbox id="lookupBox" expand="table" height="100%" margin="false,true,false,false" spacing="true">
                <filter id="filter" applyTo="table" dataLoader="suggestionsDl">
                    <properties include=".*"/>
                <groupTable id="table"
                        <action id="create" type="create"/>
                        <action id="edit" type="edit"/>
                        <action id="remove" type="remove"/>
                        <column id="recipient"/>
                        <column id="suggestion"/>
                        <column id="suggester"/>
                    <buttonsPanel id="buttonsPanel"
                        <button id="createBtn" action="table.create"/>
                        <button id="editBtn" action="table.edit"/>
                        <button id="removeBtn" action="table.remove"/>
                <hbox id="lookupActions" spacing="true" visible="false">
                    <button action="lookupSelectAction"/>
                    <button action="lookupCancelAction"/>
            <vbox id="editBox" height="100%" margin="false,false,false,true" expand="fieldGroupBox" spacing="true">
                <scrollBox id="fieldGroupBox">
                    <form id="form" dataContainer="suggestionDc">
                        <column width="250px">
                            <lookupPickerField id="recipientField" optionsContainer="recipientsDc"
                            <lookupPickerField id="suggestionField" optionsContainer="suggestionsDc"
                            <lookupPickerField id="suggesterField" optionsContainer="suggestersDc"
                            <checkBox id="dismissedField" property="dismissed"/>
                <hbox id="actionsPane" spacing="true" visible="false">
                    <button id="saveBtn" action="save"/>
                    <button id="cancelBtn" action="cancel"/>

You have two collection containers named with the same name - suggestionsDc.
One of them holds Suggestion, another one holds User. It is clear from the code snippet you’ve provided.

I would kindly suggest you to start creating meaningful IDs for your components, otherwise you will be constantly spending hours of time to debug stupid problems in your code. It’s error-prone to have suggestionsDc, suggestionDc, suggestionsDc, suggestersDc in one screen.

Thanks, I didn’t notice that the IDE had generated overlapping id’s based on my field names. Fixed the problem.