Removed Flash scope - Mojarra has bugs
This commit is contained in:
parent
e859a51772
commit
a76d5cb1ac
|
@ -120,10 +120,11 @@ public class AdminMainBean implements Serializable {
|
|||
|
||||
/**
|
||||
* Return to last search, if any
|
||||
* No longer broken (required Maven include for annotation).
|
||||
*/
|
||||
@PostConstruct
|
||||
void init() {
|
||||
log.info("Constructing AdminMainBean " + this);
|
||||
log.debug("Initializing AdminMainBean " + this);
|
||||
this.setSearchText(userSession.getLastSearch());
|
||||
// Clean up from any previous operations.
|
||||
this.userSession.setRecipe(null);
|
||||
|
@ -182,8 +183,9 @@ public class AdminMainBean implements Serializable {
|
|||
*/
|
||||
public String showRecipe() {
|
||||
long recipeId = getSearchResults().getRowData().getId();
|
||||
JSFUtils.flashScope().put("recipeID",
|
||||
Long.valueOf(recipeId));
|
||||
// Flash Scope is buggy under Mojarra plus now using session
|
||||
// JSFUtils.flashScope().put("recipeID",
|
||||
// Long.valueOf(recipeId));
|
||||
userSession.setLastEdit(recipeId);
|
||||
userSession.setRecipe(null); // forces loading of line
|
||||
// items.
|
||||
|
|
|
@ -2,11 +2,8 @@ package com.mousetech.gourmetj;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -59,7 +56,7 @@ public class RecipeDetailBean implements Serializable {
|
|||
* Default Constructor.
|
||||
*/
|
||||
public RecipeDetailBean() {
|
||||
log.warn("Constructing RecipeDetail " + this);
|
||||
log.debug("Constructing RecipeDetail " + this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -228,7 +225,8 @@ public class RecipeDetailBean implements Serializable {
|
|||
*/
|
||||
if (this.recipe == null) {
|
||||
Long rid =
|
||||
(Long) JSFUtils.getFlash("recipeID");
|
||||
//(Long) JSFUtils.getFlash("recipeID");
|
||||
userSession.getLastEdit();
|
||||
if (rid != null) {
|
||||
this.recipe = loadRecipe(rid);
|
||||
} else {
|
||||
|
@ -1034,5 +1032,6 @@ public class RecipeDetailBean implements Serializable {
|
|||
iui.setItem(this.getNewGroupName());
|
||||
List<IngredientUI> ingUIList = this.getWrappedIngredients();
|
||||
ingUIList.add(iui);
|
||||
this.setNewGroupName(""); // Clear for next time!
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<h:form id="ftmTimeout">
|
||||
<p:idleMonitor
|
||||
timeout="#{userSession.sessionTimeoutInterval}"
|
||||
onidle="sessionExpiredConfirmation.show()"
|
||||
onidle="PF('sessionExpiredConfirmation').show()"
|
||||
>
|
||||
<p:ajax event="idle"
|
||||
listener="#{userSession.sessionIdleListener}"
|
||||
|
@ -48,7 +48,7 @@
|
|||
>
|
||||
<p:commandButton id="confirmRouteDel"
|
||||
value="Ok"
|
||||
oncomplete="sessionExpiredConfirmation.hide()"
|
||||
oncomplete="PF('sessionExpiredDlg').hide()"
|
||||
actionListener="#{userSession.logoutAction}"
|
||||
/>
|
||||
</p:confirmDialog>
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
width: 20em;
|
||||
text-align: left;
|
||||
}
|
||||
.groupItem {
|
||||
font-weight: bold;
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
<h:messages id="messages" />
|
||||
<p:panel id="editorPanel"
|
||||
|
@ -243,6 +247,7 @@
|
|||
<p:inputText id="ingItem"
|
||||
size="42"
|
||||
value="#{item.item}"
|
||||
styleClass="#{item.ingGroup ? 'groupItem' : ''}"
|
||||
>
|
||||
</p:inputText>
|
||||
</p:column>
|
||||
|
@ -277,7 +282,7 @@
|
|||
/>
|
||||
</p:inputText>
|
||||
</p:column>
|
||||
<p:column style="width: 2em">
|
||||
<p:column style="width: 2.6em">
|
||||
<f:facet name="header">
|
||||
E
|
||||
</f:facet>
|
||||
|
@ -293,7 +298,7 @@
|
|||
</p:column>
|
||||
<p:column>
|
||||
<f:facet name="header">
|
||||
Shopping Cat.
|
||||
Shopping Category
|
||||
</f:facet>
|
||||
<h:outputText
|
||||
id="shopCat"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// scrolltable.js - scroll functions for dataTable
|
||||
// scrolltable.js - scroll functions for dataTable
|
||||
|
||||
function scrollAndFocus(rootId, tableId, txtId) {
|
||||
scrollToBottom(rootId + ":" + tableId);
|
||||
|
@ -46,8 +46,8 @@ function scrollToRow(pTable, selItem) {
|
|||
scrollTopInPx = (selItem - 1.2) * pTable.itemHeight;
|
||||
}
|
||||
|
||||
$(pTable.jqId + " .ui-datatable-scrollable-body").animate({scrollTop:scrollTopInPx, duration: 20}, scrollTopInPx);
|
||||
|
||||
//$(pTable.jqId + " .ui-datatable-scrollable-body").animate({scrollTop:scrollTopInPx, duration: 20}, scrollTopInPx);
|
||||
$(pTable.jqId + " .ui-datatable-scrollable-body").scrollTop(scrollTopInPx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
/>
|
||||
</f:facet>
|
||||
<p:row>
|
||||
<p:column id="leftCol" style="width: 80%">
|
||||
<p:column id="leftCol" style="width: 75%">
|
||||
<p:panelGrid columns="2">
|
||||
<img id="bigpix"
|
||||
src="/img/picture/#{recipeDetailBean.recipe.id}"
|
||||
|
@ -89,12 +89,7 @@
|
|||
</p:panelGrid>
|
||||
<h:commandLink value="Edit Details"
|
||||
action="#{recipeDetailBean.editDescription}"
|
||||
>
|
||||
<c:set target="#{flash}"
|
||||
property="recipeID"
|
||||
value="#{recipeDetailBean.recipe.id}"
|
||||
/>
|
||||
</h:commandLink>
|
||||
/>
|
||||
<!-- -->
|
||||
<p:panelGrid id="pnlInstr"
|
||||
columns="1" style="width: 100%"
|
||||
|
@ -144,7 +139,7 @@
|
|||
</p:column>
|
||||
<!-- ====== Ingredients ============================ -->
|
||||
<p:column id="ingredientsc"
|
||||
style="width: 20%; vertical-align: top;"
|
||||
style="width: 25%; vertical-align: top;"
|
||||
>
|
||||
<p:dataTable id="ingredients"
|
||||
showDirectLinksArrows="true"
|
||||
|
@ -172,7 +167,7 @@
|
|||
/>
|
||||
</p:column>
|
||||
<p:column label="Units"
|
||||
style="width: 4em"
|
||||
style="width: 5em"
|
||||
>
|
||||
<h:outputText
|
||||
value="#{ingredient.unit}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user