Commit 9da32beb by Riku Silvola

Merge branch 'master' of codecrew.fi:bortal

2 parents 2dd46485 eb860c94
...@@ -27,7 +27,7 @@ import org.eclipse.persistence.annotations.OptimisticLockingType; ...@@ -27,7 +27,7 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
@Table(name = "food_wave_templates") @Table(name = "food_wave_templates")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS) @OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class FoodWaveTemplate extends GenericEntity { public class FoodWaveTemplate extends GenericEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final String EVENT_ID = "event_id"; private static final String EVENT_ID = "event_id";
......
...@@ -62,9 +62,7 @@ ...@@ -62,9 +62,7 @@
update="productTable" /> update="productTable" />
</h:panelGrid> </h:panelGrid>
<p:dataTable name="productTable" id="productTable" <p:dataTable name="productTable" id="productTable" value="#{foodWaveView.template.products}" var="product" editable="true">
value="#{foodWaveView.template.products}" var="product"
editable="true">
<p:column headerText="#{i18n['foodwavetemplate.productname']}"> <p:column headerText="#{i18n['foodwavetemplate.productname']}">
<p:cellEditor> <p:cellEditor>
<f:facet name="output"> <f:facet name="output">
...@@ -99,8 +97,13 @@ ...@@ -99,8 +97,13 @@
<p:column headerText="Options" style="width:50px"> <p:column headerText="Options" style="width:50px">
<p:rowEditor /> <p:rowEditor />
</p:column> </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:dataTable>
</p:tab> </p:tab>
</p:wizard> </p:wizard>
</h:form> </h:form>
......
...@@ -176,4 +176,8 @@ public class FoodWaveView extends GenericCDIView { ...@@ -176,4 +176,8 @@ public class FoodWaveView extends GenericCDIView {
this.templateId = templateId; 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!