openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Expression binding in fragmentName not recognised

Open mzimnn opened this issue 9 years ago • 1 comments

OpenUI5 version: 1.42.9 Browser/version (+device/version): Chrome 56.0.2924.87 (Windows 7) Any other tested browsers/devices(OK/FAIL): Firefox 51.0.1, same issue

What is the expected result? I wanted to dynamically load a fragment, like descriped here.

What happens instead? UI5 tries to load the literal fragmentName.

I used this fragment:

<core:Fragment fragmentName="{= ${TypeId} === 'WORK' ? 'path.to.fragment.DetailWork' : 'path.to.fragment.DetailSchool'}" type="XML"/>

Request: request

mzimnn avatar Feb 09 '17 11:02 mzimnn

The documentation that you refer to is part of the "XML Templating" documentation. Resolving the expression binding before loading the fragment is a feature of that templating step. Please refer to the containing documentation on how to use templating.

Without templating you can load the fragment dynamically (in controller code) or - if the fragments are not too many and not too big - declaratively include all of them and toggle the visibility of their root controls with expression bindings. If you have many or bigger fragments, this might however slow down the loading of your view. For smaller fragments it usually works.

codeworrior avatar Feb 09 '17 12:02 codeworrior