passing params to a method when calling it through a button

Hi there,

It would be very useful if we can pass multiple parameters to a method when calling it from a button. Currently we can only pass the name of the button object to the method using the following method application.getMethodTriggerElementName()
Any idea about this??

We can pass multiple parameters using html click

But we can only write this html in a global field formatted as html area.
We cannot do the html in a normal label. Do we have planning about this too??

Thanks a lot.
Hameed

Hameed, can you explain a little more what you want, need? Because I haven’t had any issues so far in passing variables the way I needed them.

For example: I have a global method called addition()

I have a button in a form. I have attached the method addition() to its onAction event.

When I click the button I want to pass 3 integers to the method addition() to calculate the sum. But I could not pass any parameters.

( I could only pass parameters to a method, if I call the method from another method)

How would you normally pass multiple parameters to a method when you call it from the a button on a form??

Thanks for your ideas.

Hameed

In this case you have your global method to keep your code clean and manageable. Right?

What I (would) do is exactly what you say. Create a method on the form that calls that global method to pass the integers. I see no other way. Unless Servoy builds in a possibility to pass variables through the properties panel which is imho not really the place for it.

You are right. I keep global methods to keep the code less & clean.

I was just thinking the same way you just explained. ie to create a local method on the form and then call the global method with any no. of parameters. (lots of little methods to create :( )

I would love to be able to pass parameters to methods through the property panel.

Thanks
Hameed