Commit 59358096 by Tuukka Kivilahti

fixed filters

1 parent 0b8e3237
......@@ -12,34 +12,37 @@
<f:event type="preRenderView" listener="#{vipListView.initView}" />
</f:metadata>
<ui:define name="content">
<br /><br />
<h:form id="vipform">
<p:dataTable id="vip" value="#{vipListView.viplist}" widgetVar="viplist" styleClass="moya_datatable4" var="vip" >
<!-- f:facet name="header">
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Search all fields:" />
<p:inputText id="globalFilter" onkeyup="PF('viplist').filter()" style="width:150px" placeholder="Enter keyword" />
</p:outputPanel>
</f:facet -->
<!-- p:column headerText="#{i18n['vip.hostsName']}" filterBy="#{vip.host.wholeName}" filterMatchMode="contains" style="width: 140px;" -->
</f:facet>
<p:column headerText="#{i18n['vip.hostsName']}" style="width: 140px;">
<p:column headerText="#{i18n['vip.hostsName']}" filterBy="#{vip.host.wholeName}" filterMatchMode="contains" style="width: 140px;">
<!-- <p:column headerText="#{i18n['vip.hostsName']}" style="width: 140px;"> -->
<h:outputText id="viphostsname" value="#{vip.host.wholeName}" />
<p:tooltip id="viphostsnamephone" for="viphostsname" value="#{vip.host.phone}" />
</p:column>
<!-- p:column headerText="#{i18n['vip.description']}" filterBy="#{vip.description}" filterMatchMode="contains" -->
<p:column headerText="#{i18n['vip.shortdescr']}" style="width: 170px;">
<p:column headerText="#{i18n['vip.description']}" filterBy="#{vip.shortDisplayDescr}" filterMatchMode="contains">
<!-- <p:column headerText="#{i18n['vip.shortdescr']}" style="width: 170px;"> -->
<h:outputText id="vipdescr" value="#{vip.shortDisplayDescr}" title="#{vip.description}" />
</p:column>
<p:column headerText="#{i18n['vip.description']}" >
<p:column headerText="#{i18n['vip.description']}" filterBy="#{vip.description}" filterMatchMode="contains">
<h:outputText value="#{vip.description}"/>
</p:column>
<!-- p:column filterBy="#{vip.searchableProductnames}" filterMatchMode="contains" headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}" -->
<p:column headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}">
<h:dataTable border="0" var="prod" value="#{vip.products}">
<p:column filterBy="#{vip.searchableProductnames}" filterMatchMode="contains" headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}">
<!-- p:column headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}" -->
<h:dataTable border="0" var="prod" value="#{vip.products}" id="products">
<p:column>
<h:outputText title="#{prod.notes}" value="#{prod.productName}" />
</p:column>
......@@ -57,8 +60,8 @@
</p:column>
<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:commandButton id="delivebtn" rendered="#{not empty vip.id}" value="#{i18n['vip.deliver']}" actionListener="#{vipListView.deliverDialog(vip)}" >
<p:ajax event="dialogReturn" listener="#{vipListView.updateViplist()}" update="products" />
</p:commandButton>
</p:column>
<p:column style="width: 90px;">
......
......@@ -26,6 +26,7 @@
<br />
<p:commandButton action="#{vipView.save()}" value="#{i18n['vip.save']}" />
<!-- p:commandButton action="#{vipView.delete()}" value="#{i18n['vip.delete']}" rendered="#{empty vipView.vip.products}" /-->
<br />
</h:form>
<br />
......
......@@ -13,32 +13,38 @@
<ui:define name="content">
<h:form id="vipform">
<br /><br />
<p:dataTable id="vipList" value="#{vipListView.viplist}" widgetVar="viplist" styleClass="moya_datatable4" var="vip" >
<!-- f:facet name="header">
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Search all fields:" />
<p:inputText id="globalFilter" onkeyup="PF('viplist').filter()" style="width:150px" placeholder="Enter keyword" />
</p:outputPanel>
</f:facet -->
<!-- p:column headerText="#{i18n['vip.hostsName']}" filterBy="#{vip.host.wholeName}" filterMatchMode="contains" style="width: 140px;" -->
</f:facet>
<p:column headerText="#{i18n['vip.hostsName']}" filterBy="#{vip.host.wholeName}" filterMatchMode="contains" style="width: 140px;">
<p:column headerText="#{i18n['vip.hostsName']}" style="width: 140px;">
<!-- p:column headerText="#{i18n['vip.hostsName']}" style="width: 140px;" -->
<h:outputText id="viphostsname" value="#{vip.host.wholeName}" />
<p:tooltip id="viphostsnamephone" for="viphostsname" value="#{vip.host.phone}" />
</p:column>
<!-- p:column headerText="#{i18n['vip.description']}" filterBy="#{vip.description}" filterMatchMode="contains" -->
<p:column headerText="#{i18n['vip.shortdescr']}" style="width: 170px;">
<p:column headerText="#{i18n['vip.description']}" filterBy="#{vip.shortDisplayDescr}" filterMatchMode="contains">
<!-- p:column headerText="#{i18n['vip.shortdescr']}" style="width: 170px;" -->
<h:outputText id="vipdescr" value="#{vip.shortDisplayDescr}" title="#{vip.description}" />
</p:column>
<p:column headerText="#{i18n['vip.description']}" >
<p:column headerText="#{i18n['vip.description']}" filterBy="#{vip.description}" filterMatchMode="contains">
<h:outputText value="#{vip.description}"/>
</p:column>
<!-- p:column filterBy="#{vip.searchableProductnames}" filterMatchMode="contains" headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}" -->
<p:column headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}">
<h:dataTable border="0" var="prod" value="#{vip.products}">
<p:column filterBy="#{vip.searchableProductnames}" filterMatchMode="contains" headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}">
<!-- p:column headerText="#{i18n['vip.products']} | #{i18n['vip.productQuantity']} | #{i18n['vip.productDelivered']}" -->
<h:dataTable border="0" var="prod" value="#{vip.products}" id="products">
<p:column>
<h:outputText title="#{prod.notes}" value="#{prod.productName}" />
</p:column>
......@@ -56,8 +62,8 @@
</p:column>
<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="vipList" />
<p:commandButton id="delivebtn" rendered="#{not empty vip.id}" value="#{i18n['vip.deliver']}" actionListener="#{vipListView.deliverDialog(vip)}" >
<p:ajax event="dialogReturn" listener="#{vipListView.updateViplist()}" update="products" />
</p:commandButton>
</p:column>
<p:column style="width: 70px;">
......@@ -66,7 +72,7 @@
</h:link>
</p:column>
<p:column style="width: 70px;">
<p:commandLink actionListener="#{vipListView.deleteEntry(vip)}" update="vipList">
<p:commandLink actionListener="#{vipListView.deleteEntry(vip)}" update="vipList" rendered="#{empty vip.products}">
<h:outputText value="#{i18n['vip.delete']}"/>
</p:commandLink>
</p:column>
......
......@@ -57,9 +57,12 @@ public class VipListView extends PaginationView<Vip> {
initView();
}
public void deliverDialog() {
getDeliverView().setVip(viplist.getRowData());
public void deliverDialog(Vip item) {
//getDeliverView().setVip(viplist.getRowData());
getDeliverView().setVip(item);
logger.info("Set vip in deliverView to {}", deliverView.getVip());
Map<String, Object> options = new HashMap<>();
options.put("modal", true);
......
......@@ -114,6 +114,11 @@ public class VipView extends GenericCDIView {
vipProducts = null;
}
public String delete() {
vipBean.delete(vip);
return "/vip/viplist";
}
public List<EventUser> usersearch(String search) {
UserSearchQuery usq = new UserSearchQuery();
usq.setSearch(search);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!