Commit 5730f5af by Juho Juopperi

fix jsf warnings

1 parent fb55fae7
......@@ -50,7 +50,7 @@
</h:column>
<h:column>
<h:commandButton rendered="#{placeGroupView.canModify(member) and !empty member.user}"
<h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}"
action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}"
/>
</h:column>
......
......@@ -49,7 +49,7 @@
</h:column>
<h:column>
<h:commandButton rendered="#{placeGroupView.canModify(member) and !empty member.user}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" />
<h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" />
</h:column>
</h:dataTable>
......
......@@ -54,7 +54,7 @@
</h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:convertNumber maxIntegerDigits="2" minFractionDigits="0"/>
<f:ajax render="@form" event="valueChange" listener="#{productShopView.updateCartLimits}"/>
<f:ajax render="@form" event="valueChange" listener="#{productShopView.updateAllCartLimits()}"/>
</h:inputText>
<h:commandButton action="#{productShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" />
......
......@@ -9,6 +9,8 @@ import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
import org.eclipse.persistence.internal.sessions.DirectCollectionChangeRecord.NULL;
import fi.insomnia.bortal.beans.PlaceGroupBeanLocal;
import fi.insomnia.bortal.enums.apps.MapPermission;
import fi.insomnia.bortal.model.EventUser;
......@@ -57,6 +59,17 @@ public class PlacegroupView extends GenericCDIView {
}
return ret;
}
public boolean isCanModifyCurrent() {
return canModify(memberlist.getRowData());
}
public boolean isCurrentMemberUserNotNull() {
GroupMembership row = memberlist.getRowData();
if (row != null && row.getUser() != null)
return true;
return false;
}
public ListDataModel<GroupMembership> getGroupMemberships() {
memberlist = new ListDataModel<GroupMembership>(placegroupBean.getMembershipsAndCreations(user));
......
......@@ -145,6 +145,11 @@ public class ProductShopView extends GenericCDIView {
}
n.updateLimit(l);
}
}
public void updateAllCartLimits() {
updateCartLimits(null);
}
public BigDecimal getAccountBalance() {
......@@ -288,7 +293,7 @@ public class ProductShopView extends GenericCDIView {
this.barcode = barcode;
}
public void readBarcode() {
public String readBarcode() {
Product product = productBean.findByBarcode(this.barcode);
this.blip = false;
for (ProductShopItem a : shoppingcart) {
......@@ -300,6 +305,7 @@ public class ProductShopView extends GenericCDIView {
}
this.barcode = null;
logger.debug("barcode read");
return null;
}
public boolean isBlip() {
......
......@@ -77,7 +77,7 @@ public class VotingCompoAddEntryView {
this.compoName = compoName;
}
public void send() {
public String send() {
CompoEntry compoEntry = new CompoEntry();
compoEntry.setTitle(name);
compoEntry.setNotes(notes);
......@@ -87,6 +87,7 @@ public class VotingCompoAddEntryView {
cef.setFileData(this.uploadedFile.getContents());
cef.setFileName(uploadedFile.getFileName());
votingBean.addEntry(compoEntry, cef);
return null;
}
public void initView() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!