Brian - Tuesday, September 7, 2010 6:38 AM:
I'm refreshing my javascript and looking at creating some objects to do some work for me.
The code that I have written works in an HTML page. Works in an HTML field of of an Innovator Form. Fails miserably as a Client Side method attached to the OnClick event for a button in an Innovator form.
This is the code that works in the HTML page.
This is the same code except that the document.write statements have been replaced with top.aras.AlertSuccess statements. This code is in the onClick event of a button on an Innovator form.
I would be overjoyed if someone could tell me why the code doesn't work as the onClick button event but works perfectly in an HTML window or HTML field.
Regards,
Brian.
Brian - Tuesday, September 7, 2010 7:23 AM:
Don't worry. I worked it out.
The "this" item in the object/function definitions was changed by Innovator to be the button onClick context. Therefore not being the "current item" as expected by JavaScript.
To test I included the object definition code in the widget_events.js which is included as part of innovator.aspx
It works fine now.
I guess the next question is where is the "approved" place to put JavaScript object/function code.
Cheers,
Brian.
Brian - Tuesday, September 7, 2010 11:51 PM:
Alright. I think I have that worked out too.
Code goes in a .js file in the ..Innovator/Server/JavaScript directory.
Reference to this new file goes in "JSNamespaceConfig.xml"
Then it really works as expected without upsetting the upgradability of the system.
Cheers,
Brian.