Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamic views in XML. Alternative 'IF' and 'FOREACH'.

Hello!

When I spoke at different forums, many advised me to use to create view XML. I decided to take the advice. But I'm having trouble creating dynamic views.

Tell me, please, what are the alternative operators 'if' and 'forEach' in XML.

Thank you in advance.

Tags:
Former Member
Former Member replied

You can make use of HanldeBars and do the same via XML views.

{{#each panels}}

  <Panel headerText="{{this.number}}">

       {{#each buttons}}

            <Button text="{{this.text}}"/>

       {{/each}}

  </Panel>

{{/each}}

JS Bin - Collaborative JavaScript Debugging

Go through this for how you can use if conditions using XML templates

XML Templating in SAPUI5 - User Interface Add-On for SAP NetWeaver - SAP Library

3 View this answer in context
Not what you were looking for? View more on this topic or Ask a question