xp:text adds an unncessary parapgraph element

49 Views Asked by At

I have a computed text control:

<xp:text escape="false" tagName="span" contentType="html">
                <xp:this.value><![CDATA[#{javascript:var msg = compositeData.msg;
if(compositeData.msgType.equals("text")){
    return msg;
} else if (compositeData.msgType.equals("list")){
    var text = "";
    for (i = 0; i < msg.length; i++) {
      text += "<li>" + msg[i] + "</li>";
    }
    return "<ul>" + text + "</ul>";
}}]]></xp:this.value>
            </xp:text>

And when I apply an array of strings for it it generates the UL element BUT with an additional P element. How can I avoid that last one?

I also placed the xp:text control WITHIN a xp:panel element but the output is placed OUTSIDE this panel.

How can I fix this?

When I state that the output should be "text" the output is as expected.

1

There are 1 best solutions below

0
Patrick Kwinten On

sorry, the element that contains the xp:text can not contain lists.