Cleaned up ShoppingList/Shopping Category edit

This commit is contained in:
tim holloway 2024-02-02 08:25:19 -05:00
parent 2600500344
commit 205835bb5f
3 changed files with 16 additions and 40 deletions

View File

@ -128,6 +128,7 @@ public class SpringSecurityConfig {
"/main.jsf", "/main.jsf",
"/img/**", "/img/**",
"/recipeDetails.jsf", "/recipeDetails.jsf",
"/shoppingList.jsf",
"/recipePrint.jsf"); "/recipePrint.jsf");
} }
} }

View File

@ -8,23 +8,13 @@
> >
<!-- === Edit ingkey/shopcat === --> <!-- === Edit ingkey/shopcat === -->
<h:form id="frmIsk"> <h:form id="frmIsk">
<p:panelGrid> <p:panelGrid columns="2" style="width: 30em;">
<p:row> <f:facet name="header">
<p:column> <h:outputText value="Shopping Categories"/>
<p:outputLabel for="ctlScSel" </f:facet>
value="Shopping Category" <h:outputText value="Shopping Category"/>
/> <h:outputText value="Ingredient key"/>
</p:column>
<p:column>
<p:outputLabel for="ctlIngkeySel"
value="Ingredient Key"
/>
</p:column>
</p:row>
<p:row style="vertical-align: top">
<p:column>
<p:selectOneListbox id="ctlScSel" <p:selectOneListbox id="ctlScSel"
style="width: 240px"
value="#{shoppingListBean.selectedShopcat}" value="#{shoppingListBean.selectedShopcat}"
> >
<f:selectItems <f:selectItems
@ -32,10 +22,8 @@
/> />
<p:ajax update="ctlIngkeySel" event="change" /> <p:ajax update="ctlIngkeySel" event="change" />
</p:selectOneListbox> </p:selectOneListbox>
</p:column>
<p:column>
<h:selectManyListbox id="ctlIngkeySel" <h:selectManyListbox id="ctlIngkeySel"
style="width: 240px" style="width: 12em;"
value="#{shoppingListBean.selectedIngkey}" value="#{shoppingListBean.selectedIngkey}"
label="Ingcat" label="Ingcat"
> >
@ -44,34 +32,21 @@
/> />
<p:ajax event="change" update="ctlChangeCat"/> <p:ajax event="change" update="ctlChangeCat"/>
</h:selectManyListbox> </h:selectManyListbox>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel <p:outputLabel
value="Change shopping category to:" value="Change selected ingredient key category to:"
style="width: 10em;"
/> />
</p:column>
<p:column>
<p:autoComplete <p:autoComplete
value="#{shoppingListBean.newShopcat}" value="#{shoppingListBean.newShopcat}"
autoSelection="false" forceSelection="false" autoSelection="false" forceSelection="false"
maxResults="12" maxResults="12"
completeMethod="#{shoppingListBean.suggestShopcat}" completeMethod="#{shoppingListBean.suggestShopcat}"
/> />
</p:column>
</p:row>
<p:row>
<p:column>
<p:commandButton id="ctlChangeCat" value="Change..." <p:commandButton id="ctlChangeCat" value="Change..."
disabled="#{empty shoppingListBean.selectedIngkey}" disabled="#{empty shoppingListBean.selectedIngkey}"
onclick="PF('dlgOkRecat').show()" onclick="PF('dlgOkRecat').show()"
/> />
</p:column>
<p:column>
<h:outputText value="" /> <h:outputText value="" />
</p:column>
</p:row>
</p:panelGrid> </p:panelGrid>
</h:form> </h:form>
<!-- --> <!-- -->

View File

@ -42,12 +42,12 @@
<p:tab id="overviewTab" title="Shopping List"> <p:tab id="overviewTab" title="Shopping List">
<h:form id="form1"> <h:form id="form1">
<p:dataTable id="tblRecipes" <p:dataTable id="tblRecipes"
style="width: 600px" style="width: 40em"
value="#{shoppingListBean.recipeList}" value="#{shoppingListBean.recipeList}"
var="item" var="item"
> >
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Recipes" /> <h:outputText value="Recipes " />
<p:commandButton <p:commandButton
update="@parent:tblRecipes" update="@parent:tblRecipes"
value="Clear Recipes" value="Clear Recipes"
@ -83,11 +83,11 @@
</p:commandButton> </p:commandButton>
</p:column> </p:column>
<p:column id="ingredientsc" <p:column id="ingredientsc"
style="width: 25%; vertical-align: top;" style="vertical-align: top; margin-left: 1em; margin-right: 1em;"
> >
<p:dataTable id="tblShopIngredients" <p:dataTable id="tblShopIngredients"
style="width: 600px; margin-top: 10px"
value="#{shoppingListBean.ingredientList}" value="#{shoppingListBean.ingredientList}"
style="width: 40em;"
sortBy="#{item.shopCat}" var="item" sortBy="#{item.shopCat}" var="item"
> >
<f:facet name="header"> <f:facet name="header">
@ -123,7 +123,7 @@
styleClass="#{(item.inPantry) ? 'noRecipe' :'plusRecipe' }" styleClass="#{(item.inPantry) ? 'noRecipe' :'plusRecipe' }"
/> />
</p:column> </p:column>
<p:column style="width: 2em"> <p:column style="width: 3em">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Pantry" /> <h:outputText value="Pantry" />
</f:facet> </f:facet>
@ -160,7 +160,7 @@
<h:form id="frmHome"> <h:form id="frmHome">
<p:commandButton id="doHome" value="Home" <p:commandButton id="doHome" value="Home"
icon="ui-icon-home" ajax="false" immediate="true" icon="ui-icon-home" ajax="false" immediate="true"
action="main.jsf" action="/main.jsf?redirect=true"
/> />
</h:form> </h:form>
</ui:define> </ui:define>