Commit 1883023b by Tuukka Kivilahti

one bug, and also autoclose and open for layoutpanels

1 parent a1745bab
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
......@@ -15,6 +14,9 @@
<h1>#{i18n['page.bill.show.header']}</h1>
</ui:define>
<ui:define name="content">
<p:outputPanel id="billPanel">
<ui:fragment rendered="#{billEditView.bill.paid}">
<h:outputText value="#{i18n['bill.billIsPaid']}" />
<br />
......@@ -59,19 +61,17 @@
</table>
</ui:fragment>
<ui:fragment rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}">
<h:form>
<p:commandButton id="cancelbtn" onclick="PF('confirmation').show()" onerror="location.reload(true);" value="#{i18n['bill.cancel']}" />
<p:outputPanel rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}">
<h:form>
<p:commandButton id="cancelbtn" actionListener="#{billEditView.expireBill()}" onerror="location.reload(true);" value="#{i18n['bill.cancel']}" update=":billPanel">
<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
</p:commandButton>
<p:confirmDialog id="confirmDialog" message="#{i18n['generic.sure.message']}" header="#{i18n['generic.sure.header']}" severity="alert" widgetVar="confirmation">
</h:form>
</p:outputPanel>
</p:outputPanel>
<p:commandButton value="#{i18n['generic.sure.yes']}" onerror="location.reload(true);" onclick="PF('confirmation').hide()" actionListener="#{billEditView.expireBill()}" ajax="false" />
<p:commandButton value="#{i18n['generic.sure.no']}" onerror="location.reload(true);" onclick="PF('confirmation').hide()" type="button" />
</p:confirmDialog>
</h:form>
</ui:fragment>
</ui:define>
</ui:composition>
......
......@@ -55,6 +55,7 @@
</ui:repeat>
$(".languageSelector .ui-button-text").text("");
});
var apina = null;
</script>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
......@@ -68,10 +69,12 @@
<p:layout fullPage="true" id="mainlayoutpanel">
<p:layout widgetVar="mainlayout" fullPage="true" id="mainlayoutpanel" >
<p:layoutUnit id="toppanel" position="north" styleClass="bgColor1" size="60">
<div id="header_box">
<div id="header_left">
......@@ -111,10 +114,12 @@
</div>
</p:layoutUnit>
<p:layoutUnit header="#{i18n['menu']}" collapsible="true" id="leftpanel" position="west" resizable="true" size="200" minSize="100">
<p:layoutUnit header="#{i18n['menu']}" collapsible="true" id="leftpanel" position="west" resizable="true" size="200" minSize="100" >
<nav>
<p:panelMenu model="#{primeMenuView.menuModel}" />
<h:form id="mainMenu">
<p:panelMenu id="panelmenu" model="#{primeMenuView.menuModel}" />
</h:form>
<h:link style="font-size: 10px;" rendered="#{readerView.shopToOthers}" outcome="/shop/showReaderEvents" value="Readers" />
</nav>
</p:layoutUnit>
......@@ -141,7 +146,7 @@
<p:menubar rendered="#{primeMenuView.hasSecondaryMenu}" model="#{primeMenuView.secondaryMenuModel}" />
<h:form id="messages">
<p:growl id="growl" showDetail="true" />
<p:growl id="growl" showDetail="true" />
</h:form>
......@@ -164,7 +169,7 @@
</p:layoutUnit>
<p:layoutUnit header="#{i18n['user.info']}" resizable="true" collapsible="true" id="rightpanel" position="east">
<p:layoutUnit header="#{i18n['user.info']}" resizable="true" collapsible="true" id="rightpanel" position="east">
......@@ -207,11 +212,36 @@
</p:layoutUnit>
</p:layout>
<h:form>
<p:confirmDialog global="true" showEffect="fade" hideEffect="explode">
<p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog>
</h:form>
<footer class="bgColor1"> </footer>
<script type="text/javascript">
$(function() {
// autoresize for main panels, this is magic :)
PrimeFaces.widgets.mainlayout.layout.loadCookie();
PrimeFaces.widgets.mainlayout.onclose = function() {
PrimeFaces.widgets.mainlayout.layout.saveCookie()
}
PrimeFaces.widgets.mainlayout.onopen = function() {
PrimeFaces.widgets.mainlayout.layout.saveCookie()
}
});
PrimeFaces.locales['fi'] = {
closeText : 'Sulje',
prevText : 'Edellinen',
......
......@@ -191,6 +191,13 @@
</section>
<h:form>
<p:confirmDialog global="true" showEffect="fade" hideEffect="explode">
<p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog>
</h:form>
<footer class="bgColor1"> </footer>
<script type="text/javascript">
......
......@@ -157,6 +157,7 @@ public class PrimeMenuView extends GenericCDIView {
DefaultMenuItem subItem = new DefaultMenuItem();
subItem.setValue(I18n.get(child.getKey()));
subItem.setOutcome(subm.get(0).getOutcome());
ret.addElement(subItem);
......@@ -262,12 +263,12 @@ public class PrimeMenuView extends GenericCDIView {
if (m.getSitepage() != null)
{
outcome = new StringBuilder("/pages/index?id=").append(m.getSitepage().getId()).toString();
} else {
outcome = m.getItem().getUrl();
}
String key = I18n.get(m.getKey());
item.setValue(key);
item.setOutcome(outcome);
}
......
......@@ -19,11 +19,11 @@ public class ProductListView extends PaginationView<Product> {
private static final long serialVersionUID = -5621674984772482156L;
@EJB
private transient ProductBeanLocal pizzabean;
private transient ProductBeanLocal productBean;
public void initView() {
if (super.requirePermissions(ShopPermission.LIST_ALL_PRODUCTS)) {
super.setResults(pizzabean.getProducts());
super.setResults(productBean.getProducts());
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!