javascript help

  
LS

New to the Agile Platform, I'm a little confused about the way javascript works. I have read the helpfiles and some articles on this forum, but I can't figure it out. What I want to do is quite simple: I added to the javascript property of the webscreen this: function alarm() {alert( "alarm!");} and to an etended property of a button I typed (could not choose it from the list) onclick and in the value I typed "alarm". When I -runtime- click the button I see a short 'screenflickering' but no alert (but no js error too). Am I missing something?

Regards, Harry
Hi,

it helps us much faster if you provide a simple oml of how you have done it.
(and see the mistake you have made, or if it's a bug perhaps ;))
Hi Harry,

Let me try and help you. As I don't have your code I'll try to guess here.

You added an handler for the click event to a button. The Platform already adds an handler for the click event. The action performed by the onclick depends on the selection about the method, either: Submit, Ajax or Navigate.
A part from this I see no problem with your javascript, you can try to add the handler to a container instead of the button and I think you'll see the alarm popup.

I hope this helps or guides you in the right direction.

Cheers,
André
André,

>> you can try to add the handler to a container instead of the button and I think you'll see the alarm popup
Yes! And I culd type the alert in the expression right away too. Nice.

I understand the concept now: Thanks for guiding.

Regards, Harry