by pauwel.demeyer » Tue Apr 12, 2016 5:08 pm
Hey Paolo,
I understand that in case of e.g. a menuitem, you can do this with a single handler function, and passing some argument in this method to identify the exact button that is clicked.
We although are creating a generic list of buttons, where we would like to pass in the model containing the icon or button label, and a function that will be executed when this button is clicked. As the behavior is completely different for each of them, we would like to pass in different methods when designing the form containing this NG component. As the number of buttons is dynamic (hence the name of the thread), we cannot define a set of handlers beforehand.
For us, it seems to be the finest achitectural solution to pass these functions in the model (as is done in many contemporary architectures by adding lambda functions to a model), which will then be called by the controller of the component. That way, our handler method does not have to know what is put in the model as items. (passing in a parameter mentioning the 'type' of button requires us having a switch/case in the handler, thereby splitting out the definition of our buttons and the handling of them in 2 different places)
The solution you mentioned (calling executeInlineScript()) seems to be the one we need, but as Geerts mentions, this does not work as described, and it makes me think that it is a bug.
If it's a bug (like we filed one today), why is it then already in a resolved state? (without further comments on it)