parent
1290c66055
commit
75a8487cfb
6 changed files with 305 additions and 187 deletions
@ -1,121 +1,96 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||||
<html xmlns="http://www.w3.org/1999/xhtml" |
<html xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|
||||||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
xmlns:f="http://xmlns.jcp.org/jsf/core" |
||||||
xmlns:ui="http://java.sun.com/jsf/facelets" |
xmlns:ui="http://java.sun.com/jsf/facelets" |
||||||
xmlns:p="http://primefaces.org/ui" |
xmlns:p="http://primefaces.org/ui" |
||||||
|
xmlns:c="http://xmlns.jcp.org/jstl" |
||||||
> |
> |
||||||
<!-- === Edit ingkey/shopcat === --> |
<!-- === Edit ingkey/shopcat === --> |
||||||
<h:form id="frmIsk1"> |
<h:form id="frmIsk"> |
||||||
<p:dataTable id="tblShopcats" |
<p:panelGrid> |
||||||
style="width: 300px" |
<p:row> |
||||||
value="#{shoppingListBean.shopcatList}" |
|
||||||
sortBy="#{item.shopcategory}" var="item" |
|
||||||
> |
|
||||||
<f:facet name="header"> |
|
||||||
<h:outputText |
|
||||||
value="Ingredient Keys/Shopping Categories" /> |
|
||||||
</f:facet> |
|
||||||
<p:headerRow> |
|
||||||
<p:column> |
|
||||||
<h:outputText id="ctlCatname" |
|
||||||
value="#{item.shopcategory}" /> |
|
||||||
</p:column> |
|
||||||
<p:column style="width: 5em"> |
|
||||||
<p:commandButton |
|
||||||
id="ctlEditCat" value="Rename" |
|
||||||
action="#{shoppingListBean.doEditShopcat(item.id)}" |
|
||||||
onclick="PF('dlgEditShopcat').show()" |
|
||||||
update="frmEscat:pnlData" /> |
|
||||||
</p:column> |
|
||||||
</p:headerRow> |
|
||||||
<p:column> |
<p:column> |
||||||
<h:outputText value="#{item.ingkey}" |
<p:outputLabel for="ctlScSel" |
||||||
onclick="clickIngkeyName()" /> |
value="Shopping Category" |
||||||
|
/> |
||||||
</p:column> |
</p:column> |
||||||
<p:column style="width: 5em"> |
<p:column> |
||||||
<p:commandButton |
<p:outputLabel for="ctlIngkeySel" |
||||||
id="ctlEditIngkey" value="Move" |
value="Ingredient Key" |
||||||
action="#{shoppingListBean.doEditShopcat(item.id)}" |
/> |
||||||
onclick="PF('dlgEditIngkey').show()" |
</p:column> |
||||||
update="frmIngkey:pnlData" /> |
</p:row> |
||||||
|
<p:row style="vertical-align: top"> |
||||||
|
<p:column> |
||||||
|
<p:selectOneListbox id="ctlScSel" |
||||||
|
style="width: 240px" |
||||||
|
value="#{shoppingListBean.selectedShopcat}" |
||||||
|
> |
||||||
|
<f:selectItems |
||||||
|
value="#{shoppingListBean.shopcatList}" |
||||||
|
/> |
||||||
|
<p:ajax update="ctlIngkeySel" event="change" /> |
||||||
|
</p:selectOneListbox> |
||||||
|
</p:column> |
||||||
|
<p:column> |
||||||
|
<h:selectManyListbox id="ctlIngkeySel" |
||||||
|
style="width: 240px" |
||||||
|
value="#{shoppingListBean.selectedIngkey}" |
||||||
|
label="Ingcat" |
||||||
|
> |
||||||
|
<f:selectItems |
||||||
|
value="#{shoppingListBean.ingkeyList}" |
||||||
|
/> |
||||||
|
<p:ajax event="change" update="ctlChangeCat"/> |
||||||
|
</h:selectManyListbox> |
||||||
|
</p:column> |
||||||
|
</p:row> |
||||||
|
<p:row> |
||||||
|
<p:column> |
||||||
|
<p:outputLabel |
||||||
|
value="Change shopping category to:" |
||||||
|
/> |
||||||
|
</p:column> |
||||||
|
<p:column> |
||||||
|
<p:autoComplete |
||||||
|
value="#{shoppingListBean.newShopcat}" |
||||||
|
autoSelection="false" forceSelection="false" |
||||||
|
maxResults="12" |
||||||
|
completeMethod="#{shoppingListBean.suggestShopcat}" |
||||||
|
/> |
||||||
|
</p:column> |
||||||
|
</p:row> |
||||||
|
<p:row> |
||||||
|
<p:column> |
||||||
|
<p:commandButton id="ctlChangeCat" value="Change..." |
||||||
|
disabled="#{empty shoppingListBean.selectedIngkey}" |
||||||
|
onclick="PF('dlgOkRecat').show()" |
||||||
|
/> |
||||||
|
</p:column> |
||||||
|
<p:column> |
||||||
|
<h:outputText value="" /> |
||||||
</p:column> |
</p:column> |
||||||
</p:dataTable> |
</p:row> |
||||||
</h:form> |
</p:panelGrid> |
||||||
<!-- --> |
</h:form> |
||||||
<h:form id="frmEscat"> |
<!-- --> |
||||||
<p:dialog id="dlgEditShopcat" |
<h:form id="frmDelete"> |
||||||
widgetVar="dlgEditShopcat" |
<p:confirmDialog closable="false" id="dlgOkRecat" |
||||||
header="Edit/Rename Shopping Category" |
header="Confirm Change - CANNOT UNDO" |
||||||
closeOnEscape="true" |
message="OK to CHANGE Shopping Category for these Ingredient Keys?" |
||||||
> |
severity="alert" widgetVar="dlgOkRecat" |
||||||
<p:panelGrid id="pnlData" columns="2" |
style="z-index: 25000" |
||||||
styleClass="ui-panelgrid-blank" |
> |
||||||
> |
<p:commandButton id="dlgOK" value="OK" |
||||||
<p:outputLabel for="@next" |
oncomplete="PF('dlgOkRecat').hide()" |
||||||
value="Shopping Category" /> |
action="#{shoppingListBean.doChangeShopcat}" |
||||||
<p:inputText id="ctlDlgShopcatName" |
update="@form:@parent:frmIsk:ctlScSel @form:@parent:frmIsk:ctlIngkeySel" |
||||||
label="Position" required="true" |
immediate="true" |
||||||
value="#{shoppingListBean.editShopcat.shopcategory}" /> |
/> |
||||||
<p:outputLabel for="@next" |
<p:commandButton id="dlgCancel" value="Cancel" |
||||||
value="Position" /> |
onclick="PF('dlgOkRecat').hide()" |
||||||
<p:inputText |
/> |
||||||
id="ctlDlgShopcatPosition" type="number" |
</p:confirmDialog> |
||||||
required="true" size="3" |
</h:form> |
||||||
value="#{shoppingListBean.editShopcat.position}" /> |
|
||||||
</p:panelGrid> |
|
||||||
<p:panelGrid columns="2" |
|
||||||
style="width: 100%" |
|
||||||
styleClass="ui-panelgrid-blank" |
|
||||||
> |
|
||||||
<p:commandButton id="scDlgOK" |
|
||||||
value="OK" style="width: 6em" |
|
||||||
action="#{shoppingListBean.ajaxOnClickShopcat}" |
|
||||||
update="frmIsk1:tblShopcats" |
|
||||||
process="@this pnlData" |
|
||||||
oncomplete="PF('dlgEditShopcat').hide()" /> |
|
||||||
<p:commandButton id="scDlgCan" |
|
||||||
value="Cancel" style="width: 6em" |
|
||||||
onclick="PF('dlgEditShopcat').hide()" /> |
|
||||||
</p:panelGrid> |
|
||||||
</p:dialog> |
|
||||||
</h:form> |
|
||||||
<!-- --> |
|
||||||
<h:form id="frmIngkey"> |
|
||||||
<p:dialog id="dlgEditIngkey" |
|
||||||
widgetVar="dlgEditIngkey" |
|
||||||
header="Edit/Rename Shopping Category for Ingredient Key" |
|
||||||
closeOnEscape="true" |
|
||||||
> |
|
||||||
<p:panelGrid id="pnlData" columns="2" |
|
||||||
styleClass="ui-panelgrid-blank" |
|
||||||
> |
|
||||||
<p:outputLabel for="@next" |
|
||||||
value="Ingredient Key" /> |
|
||||||
<h:outputText |
|
||||||
id="ctlDlgIngKeyIngkey" |
|
||||||
value="#{shoppingListBean.editShopcat.ingkey}" /> |
|
||||||
<p:outputLabel for="@next" |
|
||||||
value="Shopping Category" /> |
|
||||||
<p:inputText |
|
||||||
id="ctlDlgIngkeyShopcatName" label="Position" |
|
||||||
required="true" |
|
||||||
value="#{shoppingListBean.editShopcat.shopcategory}" /> |
|
||||||
</p:panelGrid> |
|
||||||
<p:panelGrid columns="2" |
|
||||||
style="width: 100%" |
|
||||||
styleClass="ui-panelgrid-blank" |
|
||||||
> |
|
||||||
<p:commandButton id="ingkDlgOK" |
|
||||||
value="OK" style="width: 6em" |
|
||||||
action="#{shoppingListBean.ajaxOnClickShopcatIngkey}" |
|
||||||
update="frmIsk1:tblShopcats" |
|
||||||
process="@this pnlData" |
|
||||||
oncomplete="PF('dlgEditIngkey').hide()" /> |
|
||||||
<p:commandButton id="ingkDlgCan" |
|
||||||
value="Cancel" style="width: 6em" |
|
||||||
onclick="PF('dlgEditIngkey').hide()" /> |
|
||||||
</p:panelGrid> |
|
||||||
</p:dialog> |
|
||||||
</h:form> |
|
||||||
</html> |
</html> |
Loading…
Reference in new issue