Commit 9da32beb by Riku Silvola

Merge branch 'master' of codecrew.fi:bortal

2 parents 2dd46485 eb860c94
......@@ -62,9 +62,7 @@
update="productTable" />
</h:panelGrid>
<p:dataTable name="productTable" id="productTable"
value="#{foodWaveView.template.products}" var="product"
editable="true">
<p:dataTable name="productTable" id="productTable" value="#{foodWaveView.template.products}" var="product" editable="true">
<p:column headerText="#{i18n['foodwavetemplate.productname']}">
<p:cellEditor>
<f:facet name="output">
......@@ -99,8 +97,13 @@
<p:column headerText="Options" style="width:50px">
<p:rowEditor />
</p:column>
<p:column headerText="#{i18n['foodwavetemplate.actions']}" style="width:20px;">
<p:rowEditor />
<p:commandButton value="#{i18n['foodwavetemplate.removeFromList']}" action="#{foodWaveView.removeProductFromList(product)}" update="productTable" />
</p:column>
</p:dataTable>
</p:tab>
</p:wizard>
</h:form>
......
......@@ -176,4 +176,8 @@ public class FoodWaveView extends GenericCDIView {
this.templateId = templateId;
}
public void removeProductFromList(Product product) {
template.getProducts().remove(product);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!