Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 15, 2015 at 08:41 PM

    Hi,

    Can i get clear with your question? You need to create XML ? Can you give some example

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2015 at 09:31 PM

    I have the same problem. Everyone says to use XML and most tutorials are with XML.

    So I figured out this solution (havent tried it yet but should solve the Problem):

    Define everything than can be static in XML view. And then everything that has to be dynamic in the onInit method oft the corresponding controller.

    Because if you read the documentation you will notice that the onInit method is called after the view is completely loaded. So after this happened you can append the rest oft the view via JavaScript dynamically.

    Hope this will help ...

    I will test it soon too!

    Kind regards,

    Dominik

    Add comment
    10|10000 characters needed characters exceeded