【发布时间】:2014-02-18 23:47:50
【问题描述】:
我是法国人,我会尽力和你说英语。 我有一个包含书籍和信息书籍的数据表。 我希望我的表创建一个按钮,用于将我的书添加到我的订单 (Order myOrder),但我不能,尽管我尝试这样做。
我的小脸:
<div class="divListLivres">
<h1>Liste des livres</h1>
<h:dataTable styleClass="order-table"
headerClass="order-table-header"
rowClasses="order-table-odd-row,order-table-even-row" var="_book"
value="#{catalogueIBean.books}">
<h:column>
<f:facet name="header">Titre</f:facet>
<h:outputLabel value="#{_book.title}" />
</h:column>
<h:column>
<f:facet name="header">Editeur</f:facet>
<h:outputLabel value="#{_book.editor}" />
</h:column>
<h:column>
<f:facet name="header">Auteur</f:facet>
<h:outputLabel value="#{_book.author.firstName}" />
<h:outputLabel value=" #{_book.author.lastName}" />
</h:column>
<h:column>
<f:facet name="header">Prix unitaire</f:facet>
<h:outputLabel value=" #{_book.unitPrice}" />
<h:outputLabel value="€" />
</h:column>
</h:dataTable>
</div>
你能帮帮我吗?通过将操作重定向到我的 bean 的方法(CatalogueIBean 带有方法“addOrder(){}”),确保直接在我的对象“Order myOrder”中添加该行。谢谢!
【问题讨论】:
标签: ajax jsf datatable row facelets