仅当record为null时才呈现JSF

Din*_*ter 1 jsf rendered-attribute

下表中显示的数据也会显示在我的网络应用程序中.除了BOOKINGNO列,而不是列h:commandButton.只有BOOKINGNO在相应行上的记录为null时,才应呈现commandButton .

目前,使用下面的代码,按钮不会呈现.

表样本

PLOTNO SITENO ACCOMNO STARTDATE ENDDATE BOOKINGNO 16 1 10 2014-10-01 2014-10-03 <null> 21 2 2 2014-09-26 2014-09-29 923291 22 2 3 2014-10-01 2014-10-03 <null> 23 2 7 2014-09-26 2014-09-29 457235

JSF

<h:dataTable> 

    ...

    <h:column>
        <h:commandButton 
            onclick="if (!confirm('Do you want to book this holiday?')) return false"
            value="Book"
            action="#{dealsBean.book(item.plotNo)}"
            rendered="#{dealsBean.bookingNo = null}">
        </h:commandButton>
    </h:column>
/<h:dataTable>
Run Code Online (Sandbox Code Playgroud)

我尝试了各种不同的rendered论点,但似乎都没有做我想要的.

我的语法是否正确?

Pre*_*ric 6

您需要使用==as运算符

rendered="#{dealsBean.bookingNo == null}"
Run Code Online (Sandbox Code Playgroud)