Skip to Content
0
Oct 05, 2020 at 05:04 AM

Problem seting model to SelectDialog

113 Views Last edit Oct 05, 2020 at 05:05 AM 2 rev

I'm triying to figure out whay my data is not displayed in my selectDialog

this is my view:

<core:FragmentDefinition
    xmlns="sap.m"
    xmlns:core="sap.ui.core">
    <SelectDialog
        id="patronDialogo"
        noDataText="Sin patrones"
        title="Seleccione un patr/u00F4"
        search=".onSearch"
        confirm=".onDialogClose"
        cancel=".onDialogClose"
        items="{patrones>/}">
        <StandardListItem
            title="{patrones>DescripcionCont}"
            description="{patrones>TipoContenedor}"
            icon="sap-icon://shipping-status"
            iconDensityAware="false"
            iconInset="false"
            type="Active" />
    </SelectDialog>
</core:FragmentDefinition>

and this is my controller:

var url = "/sap/opu/odata/sap/ZCLMMVSR_ODATA_CARGA_CONTENT_SRV";
            var oDataModel = new sap.ui.model.odata.ODataModel(url, true);
            var mensaje = "";
            var oView = this.getView();
            var jsonData = new JSONModel();
            sap.ui.core.BusyIndicator.show(0);

            if ( !this._oDialogPatron ) {
                this._oDialogPatron = sap.ui.xmlfragment("z_vsr_ihu_cargarContenedor.view.DialogPatron", this);
            }

            try {
                oDataModel.read("/patronFotosSet", {
                    success: function(oData, response) {
                        sap.ui.core.BusyIndicator.hide();
                        jsonData.setData(oData.results);
                        oView.setModel(jsonData, "patrones");                   
                    },
                    error: function(oError) {
                        sap.ui.core.BusyIndicator.hide();
                    }
                });
            } catch (e){
                sap.ui.core.BusyIndicator.hide();
                return reject(mensaje = "ERROR en llamado OData")
            }

            jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._oDialogPatron);
            this.getView().addDependent(this._oDialogPatron);
            this._oDialogPatron.open();

So my select dialog it's displayed but whithout data:

Attachments

dialog.png (11.3 kB)
results.png (9.4 kB)