Commit 5730f5af by Juho Juopperi

fix jsf warnings

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