Confused! :(

Feb 11, 2008 at 4:00 PM
What is wrong with this code?

function Button1_OnClick()
function Button2_OnClick()
function Button3_OnClick()

The first function works but the second and third do not!
And yes, the buttons are the correct names, etc.
Feb 12, 2008 at 2:56 PM
I dont see any "error" in code, but there is still possibility that you dont register OnClick event in xml
Feb 12, 2008 at 10:55 PM
Edited Feb 12, 2008 at 11:20 PM
I thought the UI did all that.
It does it for the first button. Why not the others?
I will check the xml,
Thanks :)

{Edit: typo}
Feb 12, 2008 at 10:58 PM
You are right! The OnClick declarations are not in the xml!!!
Why not? I added these methods the same way.
Is this a bug?
Feb 12, 2008 at 11:13 PM
For curiosity's sake I started from scratch and the result was identical.

First I added a FontString field and named it "lblMessage".
Next I added a button and did not rename it.
Then I added a second button.
And a third button.
I double-clicked the first button and added the function text.
Then I did the same for buttons 2 and 3.
When I right-click Frame.xml in the solution explorer and select "View code" the xml shows that the scripts contain the function calls, i.e. Button1OnClick(), Button2OnClick(); and Button3_OnClick.
However, when I build the project and view the output Frame.xml, only the first button has a <scripts> tag.
Of course, if I manually add the scripts all works ok.
So I guess it IS a bug!
Feb 27, 2008 at 4:37 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.