Skip to Content
0

Formatter function not work in XML Fragment

Feb 13 at 08:18 PM

76

avatar image
Former Member

Hi all,

I'm not getting to make the following formatter function work:

MyApp/models.Formatter.js

sap.ui.define([], function () {
	"use strict";
	return {
		formatPO: function (sEbeln, sEbelp) {
			console.log("calling...");
			return sEbeln + "/" + sEbelp;
		}
	};
});

MyApp/controller/Master.controller.js

sap.ui.define([
	"sap/ui/core/mvc/Controller",
	"sap/m/MessageBox",
	"sap/m/MessageToast",
	"MyApp/functions/Functions",
	"MyApp/models/Formatter"
], function (Controller, MessageBox, MessageToast, Functions, formatter) {
	"use strict"; 
	return Controller.extend("MyApp.controller.Master", {
		formatter: formatter,	

MyApp/fragments/ListaPO.fragment.xml

<ObjectIdentifier
    title="{ parts:[{path: 'mdlOpenPO>Ebeln'}, 
                    {path: 'mdlOpenPO>Ebelp'}],
             formatter: '.formatter.formatPO' }" 
    text="{mdlOpenPO>Txz01}"/>

MyApp/view/Master.view.xml

	<Page title="{i18n>masterTitle}" level="H1">
		<content>
			<core:Fragment fragmentName="MyApp.fragments.ListaPO" type="XML"/>
		</content>
	</Page>

Does not return any errors, simply does not work.

Does anybody could help me to find the cause of this issue?

Thanks in advance

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

2 Answers

Best Answer
avatar image
Former Member Mar 09 at 06:15 PM
0

Thanks for the answer. I solved the problem by inserting the following line code in bootstrap:

data-sap-ui-xx-bindingSyntax="complex"
Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Feb 13 at 09:15 PM
0
<core:Fragment fragmentName="MyApp.fragments.ListaPO" type="XML" oController="yourcontroller"/>

not sure if it will work.

Share
10 |10000 characters needed characters left characters exceeded