Commit 35d1d257 by Antti Tonkyra

Implement endConversation for GenericCDIBean, tournament stuff

1 parent e772f104
......@@ -21,7 +21,7 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class TournamentRule extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name="name")
private String name;
......@@ -70,6 +70,4 @@ public class TournamentRule extends GenericEntity implements Serializable {
public void setTournamentGame(TournamentGame tournamentGame) {
this.tournamentGame = tournamentGame;
}
}
......@@ -52,7 +52,7 @@
</p:column>
</p:dataTable>
<h:form>
<p:commandButton value="#{i18n['tournament.admin.create']}" action="#{tournamentAdminView.create}"/>
<p:commandButton value="#{i18n['tournament.admin.create']}" action="#{tournamentAdminView.create}" />
</h:form>
</ui:define>
</ui:composition>
......
......@@ -41,6 +41,10 @@ public abstract class GenericCDIView implements Serializable {
}
}
public void endConversation() {
if(!conversation.isTransient()) conversation.end();
}
public boolean hasPermission(IAppPermission perm) {
// boolean ret =
// FacesContext.getCurrentInstance().getExternalContext().isUserInRole(perm.getFullName());
......
......@@ -14,6 +14,7 @@ import fi.codecrew.moya.model.TournamentRule;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.enterprise.context.ConversationScoped;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
......@@ -63,6 +64,7 @@ public class TournamentCreateView extends GenericCDIView {
tournamentBean.createTournament(tournament);
this.endConversation();
return "success";
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!