Hi,
I've got an architecture/logic question. This is what I'd like to achieve:
- a) I've got three buttons in my main app.
- b) When you click any of the buttons, a customs component based on a TitleWindow opens.
- c) In the titleWindow is a yes/no selector.
- d) If the answer is "yes", then I want to change the color of the button that was clicked in the main app to red. If the answer is "no" then nothing happens to the button in the main app.
My question is what is the best/easiest way to "remember" which button was clicked and handle the yes/no question.
Solution:
a) Make a variable with the id of the button that was clicked in the main app and set a public variable in the component to that id
b) And then make a custom event in the component that handles the yes/no question. The custom event would use the button id as a parameter and send that back to the main app.
Is there a better/easier way to do this? Am I approaching it correctly? Does it make sense to "send" the button id into the component and then back out again?
Thank you.
-Laxmidi