SAPUI5 PlanningCalendar-绑定两个实体

时间:2018-09-18 20:47:13

标签: odata sapui5 scp

我有以下问题: 我正在使用Flameworks PlanningCalendar开发一个APP,但是我有两个EntitySet:

Salas(3):
CAPACIDADE: 6
ID: 3
NOME: "SALA 3"
NavReservas: {__deferred: {…}}
__metadata: {type: "room_sfsf.rooms.SalasType", uri: "https://leandrp822648trial.hanatrial.ondemand.com:443/room_sfsf/rooms.xsodata/Salas(3)"}
__proto__: Object
__proto__: Object

和:

Reservas(1):
DATA_FIM: Tue Sep 18 2018 14:00:00 GMT-0300 (Horário Padrão de Brasília) {}
DATA_INICIO: Tue Sep 18 2018 12:00:00 GMT-0300 (Horário Padrão de Brasília) {}
ID: 1
ID_SALA: 3
NOME: "caio"
USUARIO: "caio.amorim"
__metadata:
type: "room_sfsf.rooms.ReservasType"
uri: "https://leandrp822648trial.hanatrial.ondemand.com:443/room_sfsf/rooms.xsodata/Reservas(1)

” 但是我不能让两者都出现在屏幕上,但是我不能让两者都出现在相关的屏幕上,下面是视图文件:

<mvc:View
        controllerName="br.com.successfactors.itz.MeetingRoomSuccessfactors.controller.Main" 
        xmlns:mvc="sap.ui.core.mvc"
        xmlns:unified="sap.ui.unified"
        xmlns="sap.m">
    <VBox class="sapUiSmallMargin">
            <PlanningCalendar
                id="PC1"
                startDate="{path: '/startDate'}"

            rows="{path : '/Salas', parameters:{$expand: 'NavReservas'}}"

                appointmentSelect="handleAppointmentSelect"

                >
            <toolbarContent>
                <Title text="{i18n>title}" titleStyle="H4"/>
                <ToolbarSpacer/>
                <Button id="addButton" icon="sap-icon://add" press="handleAppointmentCreate" tooltip="Add"/>
            </toolbarContent>
            <rows>
                <PlanningCalendarRow
                        id="PCR"

                        title="{NOME}"
                        text="{i18n>QuantRoom} {CAPACIDADE}"


                        appointments="{path: '/Reservas', templateShareable: 'true'}"

                                >
                        <!--intervalHeaders="{path: 'Employees', templateShareable: 'true'}">-->
                    <appointments >
                        <unified:CalendarAppointment
                                startDate="{DATA_INICIO}"
                                endDate="{DATA_FIM}"
                                icon="{}"
                                title="{NOME}"
                                text="{USER}"
                                type="{}"
                                tentative="{}"

                                >
                        </unified:CalendarAppointment>
                    </appointments>
        <!--            <intervalHeaders>
                        <unified:CalendarAppointment
                                startDate="{start}"
                                endDate="{end}"
                                icon="{pic}"
                                title="{title}"
                                type="{type}">
                        </unified:CalendarAppointment>
                    </intervalHeaders>-->
                </PlanningCalendarRow>
            </rows>
        </PlanningCalendar>
    </VBox>
</mvc:View>

元数据文件下方:

<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">
    <edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="2.0">
        <Schema xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
            xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"
            Namespace="room_sfsf.rooms">
            <EntityType Name="SalasType">
                <Key><PropertyRef Name="ID"/></Key><Property Name="ID" Type="Edm.Int32" Nullable="false"/><Property Name="NOME" Type="Edm.String" MaxLength="30"/><Property Name="CAPACIDADE" Type="Edm.Int32"/><NavigationProperty Name="NavReservas" Relationship="room_sfsf.rooms.Nav_ReservasType" FromRole="SalasPrincipal" ToRole="ReservasDependent"/></EntityType>
            <EntityType Name="ReservasType">
                <Key><PropertyRef Name="ID"/></Key><Property Name="ID" Type="Edm.Int32" Nullable="false"/><Property Name="NOME" Type="Edm.String" Nullable="false" MaxLength="30"/><Property Name="USUARIO" Type="Edm.String" MaxLength="20"/><Property Name="DATA_INICIO" Type="Edm.DateTime" Nullable="false"/><Property Name="DATA_FIM" Type="Edm.DateTime" Nullable="false"/><Property Name="ID_SALA" Type="Edm.Int32"/></EntityType>
            <Association Name="Nav_ReservasType"><End Type="room_sfsf.rooms.SalasType" Role="SalasPrincipal" Multiplicity="1"/><End Type="room_sfsf.rooms.ReservasType" Role="ReservasDependent" Multiplicity="*"/>
                <ReferentialConstraint>
                    <Principal Role="SalasPrincipal"><PropertyRef Name="ID"/></Principal>
                    <Dependent Role="ReservasDependent"><PropertyRef Name="ID_SALA"/></Dependent>
                </ReferentialConstraint>
            </Association>
            <EntityContainer Name="rooms" m:IsDefaultEntityContainer="true"><EntitySet Name="Salas" EntityType="room_sfsf.rooms.SalasType"/><EntitySet Name="Reservas" EntityType="room_sfsf.rooms.ReservasType"/>
                <AssociationSet Name="Nav_Reservas" Association="room_sfsf.rooms.Nav_ReservasType"><End Role="SalasPrincipal" EntitySet="Salas"/><End Role="ReservasDependent" EntitySet="Reservas"/></AssociationSet>
            </EntityContainer>
        </Schema>
    </edmx:DataServices>
</edmx:Edmx>

图像显示在屏幕上: enter image description here 映像EntitySet: enter image description here

有人知道我如何解决这个问题吗? 非常感谢。

添加新评论

在评论了Jorg之后,我更改了View,但在以下情况下无效:

<mvc:View
        controllerName="br.com.successfactors.itz.MeetingRoomSuccessfactors.controller.Main" 
        xmlns:mvc="sap.ui.core.mvc"
        xmlns:unified="sap.ui.unified"
        xmlns="sap.m">
    <VBox class="sapUiSmallMargin">
            <PlanningCalendar
                id="PC1"
                startDate="{path: '/startDate'}"

            rows="{path : '/Salas', parameters:{$expand: 'NavReservas'}}"

                appointmentSelect="handleAppointmentSelect"

                >
            <toolbarContent>
                <Title text="{i18n>title}" titleStyle="H4"/>
                <ToolbarSpacer/>
                <Button id="addButton" icon="sap-icon://add" press="handleAppointmentCreate" tooltip="Add"/>
            </toolbarContent>
            <rows>
                <PlanningCalendarRow
                        id="PCR"

                        title="{NOME}"
                        text="{i18n>QuantRoom} {CAPACIDADE}"


                        appointments="{path: 'NavReservas', templateShareable: 'true'}"

                                >
                        <!--intervalHeaders="{path: 'Employees', templateShareable: 'true'}">-->
                    <appointments >
                        <unified:CalendarAppointment
                                startDate="{DATA_INICIO}"
                                endDate="{DATA_FIM}"
                                icon="{}"
                                title="{NOME}"
                                text="{USER}"
                                type="{}"
                                tentative="{}"

                                >
                        </unified:CalendarAppointment>
                    </appointments>
        <!--            <intervalHeaders>
                        <unified:CalendarAppointment
                                startDate="{start}"
                                endDate="{end}"
                                icon="{pic}"
                                title="{title}"
                                type="{type}">
                        </unified:CalendarAppointment>
                    </intervalHeaders>-->
                </PlanningCalendarRow>
            </rows>
        </PlanningCalendar>
    </VBox>
</mvc:View>

详细说明错误:

  

未捕获的错误:“ [对象对象]”是对象类型,预期   元素的属性“ icon”的sap.ui.core.URI   sap.ui.unified.CalendarAppointment #__ appointment0 -__ xmlview0--PCR -__ xmlview0--PC1-0-0       在f.g.validateProperty(sap-ui-core.js:423)       在f.M.validateProperty(/resources/sap/ui/core/library-preload.js?eval:181)       在f.g.setProperty(sap-ui-core.js:421)       在f.setIcon(sap-ui-core.js:509)       在f.g.updateProperty(sap-ui-core.js:464)       在Constructor.v(sap-ui-core.js:462)       在builder.a.fireEvent(sap-ui-core.js:397)       在构造函数中B._fireChange(sap-ui-core.js:1463)       在builder.O.checkUpdate(/resources/sap/ui/core/library-preload.js?eval:2480)       O.initialize(/resources/sap/ui/core/library-preload.js?eval:2475)

图像结果:

enter image description here

它可以运行的浏览器!

{"d":{"results":[{"__metadata": {"type":"room_sfsf.rooms.ReservasType","uri":"https://leandrp822648trial.hanatrial.ondemand.com:443/room_sfsf/rooms.xsodata/Reservas(1)"},"ID":1,"NOME":"caio","USUARIO":"caio.amorim","DATA_INICIO":"\/Date(1537311600000)\/","DATA_FIM":"\/Date(1537318800000)\/","ID_SALA":3}]}}

enter image description here 谢谢。

0 个答案:

没有答案