2

After the recent updates in Moqui I am facing a problem in rendering the FTL code using <render-mode> tag.

Let me try to explain the problem,
Earlier I have rendered the FTL code using <render-mode> in <form-list> tag it was working properly but when I took the update of Moqui, it is displaying the whole FTL code written in the tag on browser.

Also after the update of Moqui when I use the same code outside the <form-list>, it is working as expected.

Is this the desired behavior or we should do some changes at framework level.

Below is the sample code for the same.

               <form-list name="demoName" list="nameList" >
                    <field name="name">
                        <default-field title="Name">
                            <render-mode>
                                <text><![CDATA[
                                <#if name=='Demo Name 1'>
                                    <span class="label label-success">Demo Name 1</span>
                                <#elseif name=='Demo Name 2'>
                                    <span class="label label-info">Demo Name 2</span>
                                </#if>
                                ]]></text>
                            </render-mode>
                        </default-field>
                    </field>
                </form-list>

This is how the code is being rendered on the screen at revision #891b4d5. Rendering FTL in **form-list** tag

This was the output that we used to get in Moqui revision #983a9e1 Desired Output

Can we use render-mode in form-list the way we are using it in the above code snippet?

adityazoso
  • 514
  • 5
  • 15
  • More details would be helpful, such as what "update of Moqui" means... which version were you using and which version are you seeing the issue in? More explicit comments on what you mean by working and not working would be helpful too (I can guess at it by the comment "displaying the whole FTL code", but that isn't entirely clear). – David E. Jones Oct 09 '14 at 15:25
  • @Rohit I have downloaded most recent version and run the above code. It's work fine for me. – Deb Oct 09 '14 at 15:40

1 Answers1

0

For proper usage of the render-mode.text element you should specify a text.@type attribute. It defaults to "all" so the text will be used for all types, but your content contains HTML so it should have text.@type=html.

Still, what you include should work fine. Here is an example from the apps.xml screen in the latest version of Moqui (in the git repo) that runs with every apps screen render and works with interpretation of the inline text as a template:

        <render-mode><text type="html"><![CDATA[
            <#assign footerItemList = sri.getThemeValues("STRT_FOOTER_ITEM")>
            <div id="apps-footer-content">
                <#list footerItemList! as footerItem>
                    ${footerItem}
                </#list>
            </div>
        ]]></text></render-mode>
David E. Jones
  • 1,721
  • 1
  • 9
  • 8
  • Thanks for the help David. The question is now edited and it is reflecting the changes in output after the updates in Moqui. Also I have tried using but it is generating the same output. – Rohit Deorey Oct 10 '14 at 05:29