The value of the "rendered" attribute associated with [...] must not contain the character "<"

I have numeric values ​​in p:dataTable. If the value is less than 0, the β€œ-" symbol should be inserted instead of the value.

I tried to use c:ifthat does not work. I read and people offer a flag rendered.

The code:

<p:column headerText="Valor">
    <h:outputText rendered="${valor.valor > 0}" value="${valor.valor}" />
    <h:outputText rendered="${valor.valor <= 0}" value="${valorMB.noDato}" />
</p:column>

and the server will give me this error:

The value of the "rendered" attribute associated with the element type "h: outputText" must not contain a "<" character

If I use c:if, the table appears without data:

<c:if test="#{valor.valor > 0}">
    <h:outputText value="#{valor.valor}" />
    <c:otherwise>
        <h:outputText value="-" />
    </c:otherwise>
</c:if>  

How can I solve my problem?

+4
source share
2

EL EL :

<h:outputText rendered="#{valor.valor gt 0}" value="#{valor.valor}" /> <!-- valor.valor > 0 -->
<h:outputText rendered="#{valor.valor le 0}" value="-" /> <!-- valor.valor <= 0 -->
  • lt ()
  • gt ()
  • le ( )
  • ge ( )
  • eq ()
  • ne ( )
  • and
  • or
+9

, "<" xml. .

situtation le, .

"${valor.valor <= 0}" "${valor.valor le 0}"

+2

Source: https://habr.com/ru/post/1568405/


All Articles