Symbols of the ternary operation appear on the screen

Asked

Viewed 25 times

1

As can be seen in the line below, I am using a ternary condition on my screen:

<h:outputText value="#{naturemb.nature.id == null} ? #{msg['cadastrando.nature']} : #{msg['atualizando.nature']}"/>

But on the screen, besides the text show the signs '?' and ':' as seen in the image:

inserir a descrição da imagem aqui

How can I fix this?

1 answer

2


I think the code is in the wrong place. Try this way: #{naturemb.nature.id == null ? msg['cadastrando.nature'] : msg['atualizando.nature']}

  • Show, thank you very much.

  • Taking advantage of your good will, as I conclude 2 EL after the ':'? Ex: msg['updating'] msg['Nature']

Browser other questions tagged

You are not signed in. Login or sign up in order to post.