문제

How can I do this? I want to show a value from a entity, not a string, but how can I do this as a valid code?

itemLabel="#{mandatoryFriendship.receiver == loginBean.currentMandatory ? mandatoryFriendship.sender.surname  : mandatoryFriendship.receiver.surname mandatoryFriendship.receiver.name}"

Thank you for you help

올바른 솔루션이 없습니다

다른 팁

Assuming at least EL 2.2 and that the names are non-null Strings you could have an expression of the form:

#{condition ? str0 : str1.concat(str2)}

For an older version (or null Strings) you could use:

#{condition ? str0 : str1}#{condition ? str0 : str2}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top