triggering a Servoy Method

<a href='javascript:load_selected_contact(447099)' class='name'><b>Test
Customer</b></a>

Here, we can call a servoy method load_selected_contact().

But, can we trigger th same servoy method from an event?

That mean,

Can i do like this,

<form><input type=button onClick='javascript:load_selected_contact(447099)' value='Execute'>
</form>

Any one have any Idea on this :?:

It is not working.

First of all it seems the SUN html engine doesn’t support of the type button. It doesn’t draw a button.
Also I don’t believe any JavaScript works inside the HTML when used in the SUN html render engine i.e. inside Servoy Developer/Rich Client.
And onClick events are JavaScript events.

So in short, you can only use it as an URL.

Hope this helps.

ROCLASI:
So in short, you can only use it as an URL.

Thanks Robert,

Yes, It is displaying the Button but not firing any event.

ars:
Yes, It is displaying the Button but not firing any event.

Sorry but I don’t see a button when using , not even with Servoy 3.5rc4.
We are talking about an HTML_AREA in Developer/Rich Client right ?

ROCLASI:
Sorry but I don’t see a button when using , not even with Servoy 3.5rc4.
We are talking about an HTML_AREA in Developer/Rich Client right ?

Hi Robert,

Yes, we are talking about HTML_AREA in Developer/Rich Client.

Here is the code Snippet.

gHTML = "<html><form><input type="submit" value="Click me"></form></html>"

And this gHTML is a global Field.

Hope this is clear to you.

gHTML = “<input type=“submit” value=“Click me”>”

(emphases is mine)

That will indeed work but your original code was this (and doesn’t show a button)

(emphases is mine)

So that’s the reason for the confusion on my part :)

Hmm,… :)

I got it. :)