Problem with loading data from additional datastore in cuba V7

Hello, in my project I’m using two datastores. When I create new empty screen as new screen API with data collections:

  1. one from main datastore
  2. second from additional datastore.

With one lookupField with data collection from main datastore there is no problems. Works as expected.
With lookupField with options from collection from additional datasore show blank names
image

As I can see in debug collection from additional datastore contain no data other then id.
image

XML description

<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
    caption="msg://caption"
    messagesPack="com.company.nl.web.shoppersonalcall">
<data>
    <instance id="campainInfo" class="com.company.nl.entity.ShopPersonalCallCampain" view="_local">
        <loader id="shopPersonalCallCampainDl"/>
    </instance>
    <collection id="shopListTo" class="com.company.nl.entity.Shop" view="shop-view-simple">
        <loader id="shopsToDl">
            <query><![CDATA[select e from nl$Shop e ]]></query>
        </loader>
    </collection>
    <collection id="shopListFrom" class="com.company.nl.entity.Shop" view="shop-view-simple">
        <loader id="shopsFromDl">
            <query><![CDATA[select e from nl$Shop e where e.closed=0]]></query>
        </loader>
    </collection>
    <collection id="shopPersonalCallCampainsDc" class="com.company.nl.entity.ShopPersonalCallCampain" view="_local">
        <loader id="shopPersonalCallCampainsDl">
            <query><![CDATA[select e from nl$ShopPersonalCallCampain e]]></query>
        </loader>
    </collection>
</data>
<dialogMode width="800" height="400" forceDialog="true"/>
<layout>
    <label id="labelCompainInfo" dataContainer="campainInfo" property="name"/>
    <grid spacing="true" align="TOP_CENTER" width="100%">
        <columns count="2"/>
        <rows>
            <row>
                <lookupField id="lookupFrom" rowspan="1" colspan="1"
                             nullOptionVisible="false" optionsContainer="shopListFrom" width="90%" required="true"/>
                <lookupField id="lookupTo" required="true" optionsContainer="shopListTo" width="90%"
                             nullOptionVisible="false"/>
            </row>
        </rows>
    </grid>
    <lookupField id="lookupField" nullOptionVisible="false" optionsContainer="shopPersonalCallCampainsDc"/>
    <button id="buttonMove" captionAsHtml="true" width="90%" align="BOTTOM_CENTER"
            caption="msg://moveCaption" enable="false"/>
</layout>
</window>

Controller

@UiController("nl_ShopPersonalCallChangeShop")
@UiDescriptor("shop-personal-call-change-shop.xml")
@LoadDataBeforeShow
public class ShopPersonalCallChangeShop extends Screen {
    }

Hello, I think problem is with platform.
My current version 7.0.10

Hi,
Could you provide a sample project that reproduces the error?
I couldn’t reproduce the problem.
Sample project: mainaddstore.zip (80.5 KB)
Script for the additional datastore:

CREATE DATABASE addstore
    WITH 
    OWNER = root
    ENCODING = 'UTF8'
    LC_COLLATE = 'Russian_Russia.1251'
    LC_CTYPE = 'Russian_Russia.1251'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;

CREATE SCHEMA public
    AUTHORIZATION postgres;

COMMENT ON SCHEMA public
    IS 'standard public schema';

GRANT ALL ON SCHEMA public TO postgres;

GRANT ALL ON SCHEMA public TO PUBLIC;

 CREATE TABLE public.addstore_customer
(
    id uuid NOT NULL,
    version integer NOT NULL,
    create_ts timestamp without time zone,
    created_by character varying(50) COLLATE pg_catalog."default",
    update_ts timestamp without time zone,
    updated_by character varying(50) COLLATE pg_catalog."default",
    delete_ts timestamp without time zone,
    deleted_by character varying(50) COLLATE pg_catalog."default",
    number_ character varying(255) COLLATE pg_catalog."default",
    name character varying(255) COLLATE pg_catalog."default",
    CONSTRAINT addstore_customer_pkey PRIMARY KEY (id)
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.addstore_customer
    OWNER to root;

-- Index: idx_addstore_customer_uk_number_

-- DROP INDEX public.idx_addstore_customer_uk_number_;

CREATE UNIQUE INDEX idx_addstore_customer_uk_number_
    ON public.addstore_customer USING btree
    (number_ COLLATE pg_catalog."default")
    TABLESPACE pg_default    WHERE delete_ts IS NULL;

Andrey, thanks for example, but problem not with standard lookup or browse screens.
As you can see in my first message with xml and java code class extends Screen, not StanardEditor or StandardLookup.

PS: Later, I try to reproduce problem with your example.

Created screen with your test project. It works OK with blank screen.
But when I added second additional datastore with Microsoft SQL Server 2000 connection and created blank screen error is reproduced.

image

Attached project
mainaddstore.zip (85.7 KB)

@subbotin Andrey, is problem problem confirmed?

Hi Sergey!

Could you please try to add setter method for the “name” field of the Shop entity?
As I can see this field is read only now.

I’ve tried to add the setter and the lookup field is looking fine:
%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

1 Like

Yes, after add setter - looks ok
But this is a workaround. I don’t want to anybody change name.

Unfortunately, this is the only way now.
The GitHub issue was created for this problem and this behavior will be changed in the release 7.2: