|
|
|
@ -597,7 +597,7 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
|
for (IngredientUI iui : saveIng) { |
|
|
|
|
Ingredient ing = iui.getIngredient(); |
|
|
|
|
ing.setRecipe(recipe); |
|
|
|
|
if ( ! updateShopcat(ing) ) { |
|
|
|
|
if ( ! updateShopcat(iui) ) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
iList.add(ing); |
|
|
|
@ -630,7 +630,8 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
|
* @param ing Ingredient to update |
|
|
|
|
* @return true if update succeeded. |
|
|
|
|
*/ |
|
|
|
|
private boolean updateShopcat(Ingredient ing) { |
|
|
|
|
private boolean updateShopcat(IngredientUI ingUI) { |
|
|
|
|
final Ingredient ing = ingUI.getIngredient(); |
|
|
|
|
final String ingKey = ing.getIngkey(); |
|
|
|
|
if ( (ingKey == null) || (ingKey.isBlank())) { |
|
|
|
|
ing.setIngkey(null); |
|
|
|
@ -805,10 +806,9 @@ public class RecipeDetailBean implements Serializable { |
|
|
|
|
return shopcatList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ajaxUpdateShopcat(AjaxBehaviorEvent event) { |
|
|
|
|
log.warn("SHOPCAT "); |
|
|
|
|
// Shopcat scat = recipeService.findShopcatForIngredientKey(ssss);
|
|
|
|
|
// ing.setShopcat(scat);
|
|
|
|
|
public void ajaxUpdateShopcat(IngredientUI item) { |
|
|
|
|
log.warn("SHOPCAT2 "); |
|
|
|
|
updateShopcat(item);; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ***
|
|
|
|
|