0
votes

I am trying to fill select items from odata service. I used the odata service in a list just to test it and it works, no problems. But when i set the data to Select i get "invalid XML" error.

Here is my xml view :

<mvc:View controllerName="packdialogue.controller.s1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m"
xmlns:l="sap.ui.layout">
<App id="s1">
    <pages>
        <Page title="{i18n>title}" id="s1page" >
            <content>
                <FlexBox 
                    alignContent="Center" 
                    justifyContent="Center"
                    width="auto"
                    >
                        <Panel
                        class="s1Panel"
                        backgroundDesign="Solid" >
                            <l:VerticalLayout>
                                <Text 
                                textAlign="Center"
                                id="S1LgnumLabel"
                                visible="true"
                                text="{i18n>S1LgnumLabel}"
                                width="18em">
                                </Text>
                                <Input 
                                class="s1Input"
                                id="S1LgnumInput" 
                                enabled="true"
                                width="18em">
                                </Input>
                                <Button 
                                id="S1EnterButton"
                                text="{i18n>S1Button1Text}"
                                width="21.5em"
                                press="onEnterPressed"
                                >
                                </Button>
                                <Text 
                                textAlign="Center"
                                id="S1WSLabel"
                                visible="false"
                                text="{i18n>S1WSLabel}"
                                width="18em">
                                </Text>

                                <Button 
                                id="S1NextButton"
                                press="onS1ButtonPressed"
                                text="{i18n>S1Button2Text}"
                                width="21.5em"
                                enabled="false"
                                visible="false"
                                >
                                </Button>

                                    <Select
                                        items="{test>/WorkcenterSet}">
                                        <items>
                                            <core:Item key="{test>wrkst}" text="{test>wrkst}" />
                                        </items>
                                    </Select>

                                <List
                                    id="S1List"
                                    visible="false"
                                    items="{test>/WorkcenterSet}"
                                    >
                                    <StandardListItem
                                    title="{test>wrkst}"
                                    iconDensityAware="false"
                                    iconInset="false" />
                                </List>
                            </l:VerticalLayout>
                        </Panel>
                </FlexBox>  
            </content>
        </Page>
    </pages>
</App>

When i delete the Select from my View I get no errors so the problem is in the select, but I can't figure out what is wrong with my code.

2

2 Answers

1
votes

You forgot to add core namespace into the view header:

xmlns:core="sap.ui.core"

So, when it comes to it does not know what to do.

0
votes

I believe you should define core namespace in the XML for <core:Item key="{test>wrkst}" text="{test>wrkst}" />

<mvc:View controllerName="packdialogue.controller.s1" 
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" 
displayBlock="true"
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:l="sap.ui.layout">