Commit 49255165 by Juho Juopperi

vip-listan poista-nappi

1 parent ae3b0ab6
......@@ -20,6 +20,8 @@ public interface VipBeanLocal {
void create(Vip vip);
void delete(Vip vip);
Vip find(Integer id);
Vip createProduct(VipProduct l);
......
......@@ -69,6 +69,12 @@ public class VipBean implements VipBeanLocal {
}
@Override
public void delete(Vip vip) {
vip = vipFacade.merge(vip);
vipFacade.remove(vip);
}
@Override
public Vip find(Integer id) {
return vipFacade.find(id);
}
......
......@@ -16,7 +16,7 @@
<br />
<h:form id="vipform">
<p:dataTable id="vip" value="#{vipListView.viplist}" widgetVar="viplist" styleClass="moya_datatable4" var="vip" filteredValue="#{vipListView.filteredVips}">
<p:dataTable id="vipList" value="#{vipListView.viplist}" widgetVar="viplist" styleClass="moya_datatable4" var="vip" filteredValue="#{vipListView.filteredVips}">
<!-- f:facet name="header">
<p:outputPanel>
<h:outputText value="Search all fields:" />
......@@ -61,14 +61,19 @@
<p:column style="width: 90px; text-align: center;">
<p:commandButton id="delivebtn" rendered="#{not empty vip.id}" value="#{i18n['vip.deliver']}" actionListener="#{vipListView.deliverDialog}" >
<p:ajax event="dialogReturn" listener="#{vipListView.updateViplist()}" update="vip" />
<p:ajax event="dialogReturn" listener="#{vipListView.updateViplist()}" update="vipList" />
</p:commandButton>
</p:column>
<p:column style="width: 90px;">
<p:column style="width: 70px;">
<h:link outcome="/vip/edit" value="#{i18n['vip.edit']}" >
<f:param name="id" value="#{vip.id}" />
</h:link>
</p:column>
<p:column style="width: 70px;">
<p:commandLink actionListener="#{vipListView.deleteEntry(vip)}" update="vipList">
<h:outputText value="#{i18n['vip.delete']}"/>
</p:commandLink>
</p:column>
</p:dataTable>
</h:form>
</ui:define>
......
......@@ -71,6 +71,12 @@ public class VipListView extends PaginationView<Vip> {
RequestContext.getCurrentInstance().openDialog("/vip/deliver", options, params);
}
public void deleteEntry(Vip item) {
vipBean.delete(item);
viplist = null;
initView();
}
public ListDataModel<Vip> getViplist() {
return viplist;
}
......
......@@ -536,3 +536,4 @@ vipProduct.name = Tuote
vipProduct.quantity = Lukum\u00E4\u00E4r\u00E4
yes = Kyll\u00E4
vip.delete=Poista
......@@ -1777,3 +1777,4 @@ voting.create.voteEnd = Voting close
voting.create.voteStart = Voting start
yes = Yes
vip.delete=Delete
......@@ -1761,3 +1761,4 @@ voting.create.voteEnd = \u00C4\u00E4nestys kiinni
voting.create.voteStart = \u00C4\u00E4nestys auki
yes = Kyll\u00E4
vip.delete=Poista
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!