-1
當我使用下面的代碼時,我得到java.lang.IllegalArgumentException錯誤。我不能在f:屬性中使用jsf 2.0 el表達式嗎?
<h:dataTable value="#{toDoBean.toDoItemList}" var="toDoItem" >
<h:column>
<h:selectBooleanCheckbox value="#{toDoItem.finsh}"
valueChangeListener="#{toDoBean.onStatusChange}"
onchange="submit()"/>
</h:column>
<h:column>
<h:outputText value="#{toDoItem.title}"/>
</h:column>
<h:column>
<h:commandButton value="X" actionListener="#{toDoBean.onDelete}">
<f:attribute name="id" value="#{toDoItem.title}" />
</h:commandButton>
</h:column>
</h:dataTable>
但是如果我換成
<f:attribute name="id" value="#{toDoItem.title}" />
與
<f:attribute name="id" value="testing" />
然後一切工作正常。
所以我的假設是「我不能使用EL與f:屬性」。
- 我說錯了嗎?
- 爲什麼?
- 有沒有辦法在f:屬性中使用el?
「F:屬性」標籤允許您將屬性值傳遞到組件,或通過動作偵聽器的參數的組件。 – Scorpion 2014-11-24 12:49:12
'#{toDoItem.title}'是否解析爲'String'? 「」中的每一行是否填有「標題」? –
2014-11-24 13:03:08
您應該顯示您的managedbean。 – wittakarn 2014-11-24 15:53:22