Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>https://github.com/SAP/openui5/issues/3565</title>
    <script id="sap-ui-bootstrap"
      src="https://sdk.openui5.org/resources/sap-ui-core.js"
      data-sap-ui-oninit="onUI5Init"
      data-sap-ui-libs="sap.ui.core,sap.m"
      data-sap-ui-theme="sap_horizon"
      data-sap-ui-async="true"
      data-sap-ui-compatversion="edge"
      data-sap-ui-excludejquerycompat="true"
      data-sap-ui-xx-waitfortheme="init"
    ></script>
    <!-- Note to myself: do NOT remove "onUI5Init" as it's part of the question https://stackoverflow.com/q/73293510/5846045 -->
    <script id="myxmlview" type="text/xml">
      <mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" displayBlock="true" height="100%">
        <App>
          <Page showHeader="false" class="sapUiResponsiveContentPadding">
            <VBox renderType="Bare">
              <!-- Working: -->
              <Text text="{/myProperty1} {= ${/myProperty2}.length}" />
              <Text text="SomeStringLiteral {= ${/myProperty1}.length}" />
              <!-- Not working: -->
         <!-- <Text text="SomeStringLiteral {= ${parts:['/myProperty1']}.length}" /> -->
            </VBox>
          </Page>
        </App>
      </mvc:View>
    </script>
  </head>
  <body id="content" class="sapUiBody"></body>
</html>
 
html, body { height: 100%; }
body { margin: 0; }
 
globalThis.onUI5Init = () => sap.ui.require([
  "sap/ui/core/mvc/XMLView",
  "sap/ui/model/json/JSONModel",
], async (XMLView, JSONModel) => {
  "use strict";
  const control = await XMLView.create({
    definition: document.getElementById("myxmlview").textContent,
    models: new JSONModel({
      myProperty1: "ABC",
      myProperty2: "XYZ",
    }),
  });
  control.placeAt("content");
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
boghyonpro
0viewers