PDA

View Full Version : OnClick actions for CreateObjects



nyr
02-15-2010, 10:44 PM
Good evening, I am an AMS newbie and I have a question.

I am using CreateObject in my project to dynamically buttons from data loaded from an XML file. How can I add an on-click event to these dynamically created buttons?

Is it possible? I have scoured the documentation and the forums, but maybe I'm not using the correct terms. Hopefully someone can guide me in the right direction.

Thank you!

reteset
02-16-2010, 12:01 AM
Good morning ;)
here is a small example :



Page.CreateObject(OBJECT_BUTTON, "Button1", tblButtonProps);
szButtonAction = "Dialog.Message(\"Title\", \"Message\");
Page.SetObjectScript("Button1", "On Click", szButtonAction);

nyr
02-21-2010, 01:06 AM
Thank you, that is exactly what I was looking for!