Skip to Content

Model binding with custom cards in an Overview Page and using XSOData that requires input parameters

6 days ago


avatar image

Hello, I have been struggling with the Overview Page and the usage of the cards. Everything seems to work fine if you don't require any input and just need cards to show lists or statistics. However, I want to use parameters to filter my data on the HANA back-end.

Some background information: I have a service which calls a Calculated View and requires three input parameters. The XSOData call looks like this:<params>)/Result

The service is active and fully functional. I tried using standard Card templates, but I cannot seem to get parameters to work. I tried to create parameter annotation files with the limited documentation, but that didn't work either.

I am now using a custom card, based on this blogpost . I managed to create the fields I required and I started building the usual MVC frame, similar to a regular view. However, the Card uses a FrameDefinition. I found documentation on linking a Controller to a FrameDefinition, but this only works when there is a Viewcontroller.

My card folder structure looks like this:

        - Component.js
        - SimpleCard.controller.js
        - SimpleCard.fragment.xml

When I load the card in the Overview, only the static XML layout and i18n resources are loaded. Models which were created inside the SimpleCard controller are ignored.

Code snippet of the controller:

], function (Controller, MessageToast, JSONModel) {
    "use strict";
    return Controller.extend("", {

        init: function (){
            var debugModel = new JSONModel({
                msg : "loaded"
            this.setModel(debugModel, "debug");

         onPressButton: function(oEvent){

Code snippet of the fragment:

<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m">
<Button text="{debug>msg}" width="100px" id="dummy" press="onPressButton"/>

The result of this: The text inside the button is empty and there is no press action. The Controller is linked to the XML inside the Component (cfr the blogpost):

customizing: {
                "sap.ui.controllerExtensions": {
                    "": {
                        controllerName: ""

What is happening? Is there another way of linking the controller to the Fragment? This is just a sample to figure out the linking. The final goal is using the XSOData and loading it in the card using this controller.

Hopefully you could help me out with this matter, even if it would be an alternative solution. I am using the custom cards as a last resort.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers