Problems in 7.0 with new screen added on an imported 6.10.8 project

Hi,
I’ve just defined a new screen with Studio 2018.3 Build #CS 183.10.1 on an imported 6.10.8 Project and, running the aplication, I’ve got the error "No such screen. Screen ‘logis_cobrament.browse is not defined’.

As it was mentioned in the forum’s topic Error on opening screen from main menu - CUBA.Platform in v. 7.0 new screens should not be registered in screens.xml.
Here it is the screens.xml file content:
``

<?xml version="1.0" encoding="UTF-8" standalone="no"?> `` I've just attached the class file and the screen descriptor file for this affected screen. ![No%20such%20screen|430x163](upload://oCRdhNSN5DnGjq3UWNOQz4SJJLT.png) cobrament-browse.xml (2.3 KB) CobramentBrowse.java (351 Bytes)

Any advice for solving the problem of not showing this new screen in the appllication?

Thanks in advance.

Hi,

@UiController(“logis_Cobrament.browse”)

"No such screen. Screen ‘logis_cobrament.browse is not defined’

Looks like a typo in screen ID

Hi, Alex.

The typo is in the error message text mentioned, the real one is:
No%20such%20screen

The @UiController defined and the file name of the screen definition are the same.

I’m using Cuba Studio v 10.1 and this source code is generated by Studio.

Any other idea to solve the problema?

Thanks in advance

Hi, Alex.
Old screens developed with older Studio version are opened without problem.

Is it possible that the problem could be the difference between the symbols $ in the older screens definition and the symbol _ in the newer screens on the web-menú.xml file.

<?xml version="1.0" encoding="UTF-8"?>

-<menu-config xmlns="http://schemas.haulmont.com/cuba/menu.xsd">


-<menu insertBefore="administration" id="application-logis">

<item screen="logis$Contracte.browse"/>

<item screen="logis$ContracteLin.browse"/>

<item screen="logis$FacturaProv.browse"/>

<item screen="logis$FacturaComi.browse"/>

<item screen="logis_Cobrament.browse"/>

</menu>

</menu-config>

Best regards

Hi, forum’s Friends.

I’ve been trying to solve without fortune the problem that provokes the “no such screen” error, on screens created by Studio v 10.1 when those are opened from menu item created by Studio.

This Project has another screens, those are been opened without any problem from application menu, which are been created with Studio and Platfom v 6.10.x. This Project correctly imported with Studio v. 10 to Platform v. 7.

I know there has been an important change in Platform 7.0 which now uses Vaadin 8 in Generic UI, but I don’t understand why Studio v 10 doesn’t generate correctly the definition for new screens added to a Project created in older Cuba platform versión.

Here it is the web-menu.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<menu-config xmlns="http://schemas.haulmont.com/cuba/menu.xsd">
    <menu id="application-logis"
          insertBefore="administration">
        <item screen="logis$Contracte.browse"/>
        <item screen="logis$ContracteLin.browse"/>
        <item screen="logis$FacturaProv.browse"/>
        <item screen="logis$FacturaComi.browse"/>
        <item screen="logis_Cobrament.browse"/>
    </menu>
</menu-config>

Here they are controller and descriptor files for an older screen that’s opened without problems from menu:

package com.company.logistica.web.facturaprov;

import com.company.logistica.entity.FacProvEstatEnum;
import com.company.logistica.entity.FacturaComi;
import com.company.logistica.entity.FacturaProv;
import com.company.mestrelegacy.entity.Proveidor;
import com.haulmont.cuba.core.app.UniqueNumbersService;
import com.haulmont.cuba.core.global.DataManager;
import com.haulmont.cuba.core.global.Metadata;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.GroupTable;
import com.haulmont.cuba.gui.data.DsContext;
import com.haulmont.cuba.gui.data.GroupDatasource;
import org.eclipse.persistence.internal.sessions.DirectCollectionChangeRecord;

import javax.inject.Inject;
import java.util.*;

public class FacturaProvBrowse extends AbstractLookup {
    @Inject
    private GroupTable<FacturaProv> facturaProvsTable;
    @Inject
    private Metadata metadata;
    @Inject
    private DataManager dataManager;
    @Inject
    private DsContext dsContext;
    @Inject
    private GroupDatasource<FacturaProv, UUID> facturaProvsDs;
    @Inject
    private UniqueNumbersService uniqueNumbersService;

    public void onBtnNewDebitNoteClick() {
        if (facturaProvsTable.getSelected() != null) {
            boolean facCreada = false;
            //Creació de la llista de factures de proveïdor
            List<FacturaProv> llstFacProv = new ArrayList<FacturaProv>();
            //Creació variable per obtenir el proveïdor de la primera factura:
            Proveidor proveidor=null;
            //Crear una nova Factura de comisions (Debit Note):
            FacturaComi facturaComi = metadata.create(FacturaComi.class);
            //Recórrer les factures seleccionades en la taula:
            for (FacturaProv facturaProv : facturaProvsTable.getSelected()){
                if (facturaProv.getFacComiId() == null) {
                    //Crea la Debit Note, si no ha estat creada abans:
                    if (facCreada == false){
                        //Es crea la factura amb la data del dia. Si cal canviar-la, l'usuari ho farà pel manteniment
                        facturaComi.setDataFac(new Date());
                        //Obtenir el número de factura correlatiu a através de UniqueNumbersAPI
                        facturaComi.setNumFac(uniqueNumbersService.getNextNumber("debitnote"));
                        //Activem el switch per indicar que ja s'ha creat la Debit Note
                        facCreada = true;
                    }
                    //Assigna com a proveïdor de la factura de comisions el proveïdor de la primera factura de Proveïdor
                    if (proveidor == null) {
                        proveidor = new Proveidor();
                        proveidor = facturaProv.getProveidor();
                        showNotification("Debit Note assignada a: " + proveidor.getProNom());
                    }
                    if (facturaProv.getProveidor() == proveidor) {
                        llstFacProv.add(facturaProv);
                        //Assignar a l'atribut @JoinColumn(name = "FAC_COMI_ID_ID") de la instància de FacturaProv, la instància de la facturaComi corresponent
                        facturaProv.setFacComiId(facturaComi);
                        //Canviar l'estat de la factura de proveïdor a "Debit Note"
                        facturaProv.setEstat(FacProvEstatEnum.Debit_Note);
                        facturaProvsDs.modifyItem(facturaProv);
                    }else{
                        showNotification("La factura " + facturaProv.getNumFactura() + " no s'inclou a la Debit Note per tenir un altre proveïdor");
                    }
                } else{
                    String text = "La factura " + facturaProv.getNumFactura() + " ja té Debit Note";
                    showNotification(text,NotificationType.WARNING);
                }
            }
            if (facCreada == true) {
                facturaComi.setFacturesProveidor(llstFacProv);
                facturaComi.setProveidor(proveidor);
                dataManager.commit(facturaComi);
                dsContext.commit();
            }
        }

    }
}

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://browseCaption"
        class="com.company.logistica.web.facturaprov.FacturaProvBrowse"
        focusComponent="facturaProvsTable"
        lookupComponent="facturaProvsTable"
        messagesPack="com.company.logistica.web.facturaprov">
    <dsContext>
        <groupDatasource id="facturaProvsDs"
                         class="com.company.logistica.entity.FacturaProv"
                         view="facturaProv-view">
            <query>
                <![CDATA[select e from logis$FacturaProv e]]>
            </query>
        </groupDatasource>
    </dsContext>
    <dialogMode height="600"
                width="800"/>
    <layout expand="facturaProvsTable"
            spacing="true">
        <filter id="filter"
                applyTo="facturaProvsTable"
                datasource="facturaProvsDs">
            <properties include=".*"/>
        </filter>
        <groupTable id="facturaProvsTable"
                    multiselect="true"
                    width="100%">
            <actions>
                <action id="create"/>
                <action id="edit"/>
                <action id="remove"/>
            </actions>
            <columns>
                <column id="numFactura"/>
                <column id="proveidor"
                        align="LEFT"/>
                <column id="dataFactura"/>
                <column id="venciment"/>
                <column id="estat"/>
                <column id="importTotal"/>
                <column id="percComissio"/>
                <column id="importComissio"/>
                <column id="importFob"/>
                <column id="dataCobrament"/>
                <column id="client"/>
                <column id="facComiId"
                        caption="Debit Note"/>
            </columns>
            <rows datasource="facturaProvsDs"/>
            <rowsCount/>
            <buttonsPanel id="buttonsPanel"
                          alwaysVisible="true">
                <button id="createBtn"
                        action="facturaProvsTable.create"/>
                <button id="editBtn"
                        action="facturaProvsTable.edit"/>
                <button id="removeBtn"
                        action="facturaProvsTable.remove"/>
                <button id="btnNewDebitNote"
                        caption="Debit Note"
                        icon="ADD_ACTION"
                        invoke="onBtnNewDebitNoteClick"/>
            </buttonsPanel>
        </groupTable>
    </layout>
</window>

And now, the controller and descriptor files of the new screen with problems:

package com.company.logistica.web.screens;

import com.haulmont.cuba.gui.screen.*;
import com.company.logistica.entity.Cobrament;

@UiController("logis_Cobrament.browse")
@UiDescriptor("cobrament-browse.xml")
@LookupComponent("cobramentsTable")
@LoadDataBeforeShow
public class CobramentBrowse extends StandardLookup<Cobrament> {
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
        caption="msg://browseCaption"
        focusComponent="cobramentsTable"
        messagesPack="com.company.logistica.web.screens">
    <data readOnly="true">
        <collection id="cobramentsDc"
                    class="com.company.logistica.entity.Cobrament"
                    view="cobrament-view">
            <loader id="cobramentsDl">
                <query>
                    <![CDATA[select e from logis_Cobrament e]]>
                </query>
            </loader>
        </collection>
    </data>
    <dialogMode height="600"
                width="800"/>
    <layout expand="cobramentsTable"
            spacing="true">
        <filter id="filter"
                applyTo="cobramentsTable"
                dataLoader="cobramentsDl">
            <properties include=".*"/>
        </filter>
        <groupTable id="cobramentsTable"
                    width="100%"
                    dataContainer="cobramentsDc">
            <actions>
                <action id="create" type="create"/>
                <action id="edit" type="edit"/>
                <action id="remove" type="remove"/>
            </actions>
            <columns>
                <column id="data"/>
                <column id="proveidor"/>
                <column id="importCobrat"/>
                <column id="remarks"/>
                <column id="debitNote"/>
                <column id="importTotFac"/>
                <column id="importDifer"/>
                <column id="fcobrament"/>
            </columns>
            <rowsCount/>
            <buttonsPanel id="buttonsPanel"
                          alwaysVisible="true">
                <button id="createBtn" action="cobramentsTable.create"/>
                <button id="editBtn" action="cobramentsTable.edit"/>
                <button id="removeBtn" action="cobramentsTable.remove"/>
            </buttonsPanel>
        </groupTable>
        <hbox id="lookupActions" spacing="true" visible="false">
            <button action="lookupSelectAction"/>
            <button action="lookupCancelAction"/>
        </hbox>
    </layout>
</window>

Any idea to solve the problem would be very apreciated
.
Thanks in advance

Hi Xavier,

Please make sure your web-spring.xml file has the following lines:

<beans ...
       xmlns:gui="http://schemas.haulmont.com/cuba/spring/cuba-gui.xsd">

    <gui:screens base-packages="com.company.logistica.web"/>

This is normally added by the migration procedure, but it could fail for some reason.

Hi Konstantin, this was the cause of the problem.

Thanks a lot.