|
|
@ -204,7 +204,6 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
ingredients |
|
|
|
ingredients |
|
|
|
.setWrappedData(new ArrayList<IngredientUI>(1)); |
|
|
|
.setWrappedData(new ArrayList<IngredientUI>(1)); |
|
|
|
} |
|
|
|
} |
|
|
|
log.info("Ingredient size="+ingredients.getRowCount()); |
|
|
|
|
|
|
|
return ingredients; |
|
|
|
return ingredients; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -390,6 +389,9 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
updateSelectionStatus(); |
|
|
|
updateSelectionStatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Manage the ability buttons based on selections. |
|
|
|
|
|
|
|
*/ |
|
|
|
private void updateSelectionStatus() { |
|
|
|
private void updateSelectionStatus() { |
|
|
|
List<IngredientUI> ingList = getWrappedIngredients(); |
|
|
|
List<IngredientUI> ingList = getWrappedIngredients(); |
|
|
|
final int ingCount = ingList.size(); |
|
|
|
final int ingCount = ingList.size(); |
|
|
@ -411,6 +413,8 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
this.setMoveUpAble(moveUpable && selectable); |
|
|
|
this.setMoveUpAble(moveUpable && selectable); |
|
|
|
this.setMoveDownAble(moveDownable && selectable); |
|
|
|
this.setMoveDownAble(moveDownable && selectable); |
|
|
|
this.setSelectable(selectable); |
|
|
|
this.setSelectable(selectable); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auditRows(ingList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ---
|
|
|
|
// ---
|
|
|
@ -456,7 +460,7 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.setDirty(); |
|
|
|
this.setDirty(); |
|
|
|
auditRows(rows); |
|
|
|
updateSelectionStatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void auditRows(List<IngredientUI> rows) { |
|
|
|
private void auditRows(List<IngredientUI> rows) { |
|
|
@ -488,7 +492,7 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
rows.add(i, r); |
|
|
|
rows.add(i, r); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
auditRows(rows); |
|
|
|
updateSelectionStatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void ajaxDeleteItems() { |
|
|
|
public void ajaxDeleteItems() { |
|
|
@ -506,7 +510,7 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
for (IngredientUI row : selectedRows) { |
|
|
|
for (IngredientUI row : selectedRows) { |
|
|
|
rows.remove(row); |
|
|
|
rows.remove(row); |
|
|
|
} |
|
|
|
} |
|
|
|
auditRows(rows); |
|
|
|
updateSelectionStatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// =====
|
|
|
|
// =====
|
|
|
@ -707,9 +711,14 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
List<Ingredient> iList = recipe.getIngredientHash(); |
|
|
|
List<Ingredient> iList = recipe.getIngredientHash(); |
|
|
|
iList.clear(); |
|
|
|
iList.clear(); |
|
|
|
for (IngredientUI iui : saveIng) { |
|
|
|
for (IngredientUI iui : saveIng) { |
|
|
|
|
|
|
|
if ( iui.isIngGroup() ) { |
|
|
|
|
|
|
|
// Ing group is an attribute of ingredients.
|
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
Ingredient ing = iui.getIngredient(); |
|
|
|
Ingredient ing = iui.getIngredient(); |
|
|
|
ing.setRecipe(recipe); |
|
|
|
ing.setRecipe(recipe); |
|
|
|
if (!updateShopcat(iui)) { |
|
|
|
if (!updateShopcat(iui)) { // Obsolete???
|
|
|
|
|
|
|
|
log.info("Shopcat has not been updated" +iui); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
iList.add(ing); |
|
|
|
iList.add(ing); |
|
|
|