0

我想有条件地渲染一个组件,如下所示:

rendered="#{att.attName != 'att1' or 'att2'}"

然而,这并没有奏效。我都尝试过orand ||,但它只评估 OR 条件的左手,所以在上面的情况下,它只比较"att1"not with"att2"

如果我更改顺序,那么它会与"att2"not with进行比较"att1"

4

1 回答 1

2

这应该是你需要的

rendered="#{(att.attName != 'att1') and (att.attName != 'att2')}"

(不需要括号,但为了便于阅读,我添加了它们)

于 2015-02-13T13:41:20.513 回答