在我的facelet我有一個PF數據表,當我點擊一個頭排序,我得到 javax.el.ELException: Failed to parse the expression [#{item.null}]
Primefaces的DataTable sortBy EL無法解析表達式
ShippingRoom.xhtml
<f:metadata>
<o:viewParam name="id"
value="#{shippingRoomBean.room}"
converter="#{shippingRoomConverter}"
converterMessage="Unknown Shipping Room."
required="true"
requiredMessage="Bad request, please use a link from within the system." />
<f:event type="preRenderView" listener="#{shippingRoomBean.init}" />
</f:metadata>
Shipping Room Name: #{shippingRoomBean.name}<br/>
Shipping Room Location: #{shippingRoomBean.location}<br/>
<p:dataTable id="itemDataTable" var="item" value="#{shippingRoomBean.items}" emptyMessage="No Items Found In This Shipping Room">
<p:column sortBy="item.name" headerText="Item Name"> //attempt1
#{item.name}
</p:column>
<p:column sortBy="name" headerText="Item Name"> //attempt2
#{item.name}
</p:column>
ShippingRoomBean
@ManagedBean
@ViewScoped
public class ShippingRoomBean {
public void init() {
System.out.println("Initializing ==");
items = itemRepository.findItemsByShippingRoom(room.getId());
}
//嘗試是不是真的在我的實際facelets頁面。我在這裏添加它來解釋我嘗試過(嘗試)「name」和「item.name」兩種方式都不起作用。 – jeff
我不明白對不起。你可以嘗試使用'