SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
201 stars 28 forks source link

Expression Binding is not working #354

Closed RajkumarAmbhu closed 2 years ago

RajkumarAmbhu commented 2 years ago

Hello Together,

Expression binding is not working and it's considered as string. Example:

const oText = new Text({
   width: "40%",
   textAlign: "Center",
   busyIndicatorDelay: 0,
   text: "{i18n>app.suite.noData}",
   visible: "{= !${employeeModel>/employee}.length}",
   busy: "{= !${employeeModel>/employee}.length && !${chartsModel>/showEmployeeNodata}}"
});

Here visible and busy properties expecting the types boolean | PropertyBindingInfo | undefined. But the expression binding is considered a string and it shows the error as below. image

I tried with formatter option and it is working fine.

Kindly check it and help me, please.

Best Regards, Rajkumar Ambhu

codeworrior commented 2 years ago

The generator recently has been enhanced to support binding strings. The types for the next UI5 version (1.102) will allow binding strings in the settings.

Until then, you can only workaround the type constraints by adding a cast like "as any" behind the binding string.

RajkumarAmbhu commented 2 years ago

Hello Frank,

Thank you for the update and will use the typecasting (as any) up to the next UI5 version (1.102) as per your suggestion.

Best Regards, Rajkumar Ambhu