Commit 2ae1f001 by Juho Juopperi

fix jsf errors

1 parent 63fbadf0
......@@ -12,14 +12,14 @@
<h:outputText rendered="#{billListView.bills.rowCount le 0}" value="#{i18n['bills.noBills']}" />
<h:form rendered="#{billListView.bills.rowCount gt 0}">
<h:dataTable styleClass="bordertable" id="billList" value="#{billListView.bills}" var="bill">
<h:column rendered="#{billListView.canWriteBill()}">
<h:column rendered="#{billListView.canWriteBill}">
<f:facet name="header">
<h:outputText value="${i18n['bill.payer']}" />
</f:facet>
<h:link rendered="#{billListView.canWriteBill()}" outcome="/useradmin/edit" value="#{bill.addr1}">
<h:link rendered="#{billListView.canWriteBill}" outcome="/useradmin/edit" value="#{bill.addr1}">
<f:param name="userid" value="#{bill.user.user.id}" />
</h:link>
<h:outputText rendered="#{!billListView.canWriteBill()}" value="#{bill.addr1}" />
<h:outputText rendered="#{not billListView.canWriteBill}" value="#{bill.addr1}" />
</h:column>
<h:column>
<f:facet name="header">
......@@ -59,12 +59,12 @@
<f:param name="billid" value="#{bill.id}" />
</h:link>
</h:column>
<h:column rendered="#{billListView.canWriteBill()}">
<h:column rendered="#{billListView.canWriteBill}">
<h:link outcome="/bill/edit" value="#{i18n['bill.edit']}">
<f:param name="billid" value="#{bill.id}" />
</h:link>
</h:column>
<h:column rendered="#{billListView.canWriteBill()}">
<h:column rendered="#{billListView.canWriteBill}">
<h:commandButton rendered="#{bill.paidDate == null}" action="#{billListView.markPaid()}" value="#{i18n['bill.markPaid']}">
<f:ajax render="@form" />
</h:commandButton>
......
......@@ -45,19 +45,19 @@
<f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet>
<h:commandButton action="#{foodShopView.add(-10)}" value="#{i18n['productshop.minusTen']}">
<h:commandButton action="#{foodShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{foodShopView.add(-1)}" value="#{i18n['productshop.minusOne']}">
<h:commandButton action="#{foodShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:ajax render="@form" event="valueChange" />
</h:inputText>
<h:commandButton action="#{foodShopView.add(1)}" value="#{i18n['productshop.plusOne']}">
<h:commandButton action="#{foodShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{foodShopView.add(10)}" value="#{i18n['productshop.plusTen']}">
<h:commandButton action="#{foodShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" />
</h:commandButton>
</h:column>
......
......@@ -45,19 +45,19 @@
<f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet>
<h:commandButton action="#{foodShopView.add(-10)}" value="#{i18n['productshop.minusTen']}">
<h:commandButton action="#{foodShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{foodShopView.add(-1)}" value="#{i18n['productshop.minusOne']}">
<h:commandButton action="#{foodShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:ajax render="@form" event="valueChange" />
</h:inputText>
<h:commandButton action="#{foodShopView.add(1)}" value="#{i18n['productshop.plusOne']}">
<h:commandButton action="#{foodShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{foodShopView.add(10)}" value="#{i18n['productshop.plusTen']}">
<h:commandButton action="#{foodShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" />
</h:commandButton>
</h:column>
......
......@@ -45,19 +45,19 @@
<f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet>
<h:commandButton action="#{productShopView.add(-10)}" value="#{i18n['productshop.minusTen']}">
<h:commandButton action="#{productShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{productShopView.add(-1)}" value="#{i18n['productshop.minusOne']}">
<h:commandButton action="#{productShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:ajax render="@form" event="valueChange" />
</h:inputText>
<h:commandButton action="#{productShopView.add(1)}" value="#{i18n['productshop.plusOne']}">
<h:commandButton action="#{productShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{productShopView.add(10)}" value="#{i18n['productshop.plusTen']}">
<h:commandButton action="#{productShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" />
</h:commandButton>
</h:column>
......
......@@ -147,7 +147,7 @@ public class MapManageView extends GenericCDIView {
return null;
}
public void generatePlaces() {
public String generatePlaces() {
String[] tablenames = getNamebase().split(";");
List<Place> mapplaces = map.getPlaces();
......@@ -186,6 +186,7 @@ public class MapManageView extends GenericCDIView {
map = eventmapBean.saveMap(map);
logger.debug("places in map merge {}", map.getPlaces().size());
return null;
}
public void setMapname(String mapname) {
......
......@@ -84,7 +84,7 @@ public class BillListView extends GenericCDIView {
return bills;
}
public boolean canWriteBill() {
public boolean isCanWriteBill() {
return writeBill;
}
......
......@@ -83,7 +83,27 @@ public class FoodShopView extends GenericCDIView {
item.setCount(item.getCount().add(BigDecimal.valueOf(count)));
return null;
}
public String addOne()
{
return add(1);
}
public String addMinusOne()
{
return add(-1);
}
public String addTen()
{
return add(10);
}
public String addMinusTen()
{
return add(-10);
}
public BigDecimal getAccountBalance()
{
BigDecimal ret = user.getAccountBalance();
......
......@@ -82,6 +82,26 @@ public class ProductShopView extends GenericCDIView {
item.setCount(item.getCount().add(BigDecimal.valueOf(count)));
return null;
}
public String addOne()
{
return add(1);
}
public String addMinusOne()
{
return add(-1);
}
public String addTen()
{
return add(10);
}
public String addMinusTen()
{
return add(-10);
}
public BigDecimal getAccountBalance()
{
......
......@@ -59,12 +59,12 @@ public class AuthView extends GenericCDIView {
}
public void executeLogin() {
public String executeLogin() {
bootStrapBean.saneDefaults();
if (login == null || password == null || login.isEmpty() || password.isEmpty()) {
return;
return null;
}
HttpServletRequest request = getRequest();
......@@ -99,7 +99,8 @@ public class AuthView extends GenericCDIView {
}
}
return null;
}
public String getLogin() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!