Skip to Content
0
Oct 30, 2018 at 10:37 AM

XML Templating controller method

54 Views

Dear All,

I'm trying to work with XML Templating.

Actually It's work correctly but I have some trouble using method of the controller inside.

Here my XML templating:

<mvc:View xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:mvc="sap.ui.core.mvc" 
    xmlns:l="sap.ui.layout" 
    xmlns:core="sap.ui.core" 
    xmlns:m="sap.m" 
    xmlns:custom="custom"
    xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1">

    <template:repeat list="{clZonage>/et_zonage}" >
        <m:Text text="{clZonage>areaid}" />
                <m:List mode="{clApp>/es_list_mode}" select="handleListSelect" delete="removeListItem" includeItemInSelection="true" items="{clDeliveries>/et_clients}">

                <m:StandardListItem title="{clDeliveries>delivery_no}"  type="{clApp>/itemlisttype}" detailPress="onDetailPress" />

        </m:List>
    </template:repeat>
</mvc:View><br>

The problem come from the event "select" of the list that is does not trigger my method of my controller

I have tested the lines out of the XML template and is work correctly.

I have try to put the line below in it:

controllerName="demo.myctrl"<br>

But the rendering does not work any more after.

So my question is: Can we call the method of a controller in XML templating?