Can I execute methods from within Servoy fields?
Posted: Wed Aug 04, 2004 10:30 am
Yes you can. Use an html_area, set it to non-editable and then it can trigger Servoy methods by using html links.
Example:
Put this in the html area:
You can pass arguments to your methods, in the example above we are passing "hi" to the method we are calling. In the method you are calling you can parse out the parameters. Create a method name dialog_test with the following contents:
It will show a dialog with the arguments you passed it.
Example:
Put this in the html area:
- Code: Select all
<html>
<a href="javascript:dialog_test("hi")">click here to run script</a>
</html>
You can pass arguments to your methods, in the example above we are passing "hi" to the method we are calling. In the method you are calling you can parse out the parameters. Create a method name dialog_test with the following contents:
- Code: Select all
var receivedArgument = arguments[0]
plugins.dialogs.showInfoDialog( "Info","The argument you passed is: " + receivedArgument )
It will show a dialog with the arguments you passed it.