Recipe combobox not refreshing after create

Recipe combobox not refreshing after create

Hi, I'm trying to modify an existing recipe name from code-behind and also create a new recipe. The changes seems to update after i switch back to the standard recipe page. But the recipe page does not update its content (like the combobox) while the user is inside the recipe page. He needs to switch off from the page and gets back into it to see the changes. I'm using the functions from the recipe object model and running with Zenon 6.51. So the question is, how can the recipe standard page be updated from code behind while staying on the recipe page? I would like to avoid using the RGM and stay using the standard recipe if possible. Am i doing something wrong?
C# Code:
public void OnRecipeNameEdited(object obj, EventArgs arg) { try { var recipeName = createEditRecipe.RecipeName; recipe.Name = recipeName; recipe.Save(); } catch (Exception ex) { Console.WriteLine(ex.Message); } } public void OnRecipeCreatedClicked(object obj, EventArgs arg) { try { recipes = getRecipes(); var recipeName = createEditRecipe.RecipeName; recipes.Create(recipeName); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
Thank you in advance, Best regards, Mosa

This is a migrated post! Originally posted on 17.08.2018 by user MOSA_SENMATIC. Please be aware that information can be outdated.