how to detect which button is pushed...

Hi all, in my series of hard questions, here is another one!

Using solutionModel I generate a form, this form contain an unknown number of field. These fields are placed using a loop in my code in the same form. Besides each field, is a button. These buttons are also place using the same loop.

Now… how can I know which of these button has been clicked on?

They all have a different generated name, but I can’t get the name of the button that called the function “onClick”
I could pass an argument that would be the name of the button… but I can’t pass any argument when the button is pushed. (which is very easy in filemaker)
I could build my own JButton with method that would pass arguments to the “onClick” function… but it is not possible to place a bean on a form using the solutionModel.
There is also a way in standard JavaScript 1.6 or 1.7+ to call a dynamically create subfunction (see binding in javascript) but while the mozilla javascript engine was modified for servoy, this ability (and many others) where lost…
I could also link each button to a different global function… but since there could be 50 different button… I can’t really have 50 different global function waiting just to pass the right arguments… what if there where 100 button ??

I can’t think of any other way to get the name of the button that was pushed… or am I wrong on my findings?

Thank you very much to anyone who spends time on others problems.

Philippe Beaulieu

Look at the samples for “application.getMethodTriggerElementName()”