[Pro] Newbe Old Timer

Coming out of a two year retirement after 23 years of software engineering and I am totally lost trying to make sense of Freeway Actions. The last two years of my “career” was spent writing corporate websites (front end and back end) using GWT and mySQL so I was once familiar with JavaScript. I need to see some simple examples of how one handles object events using Actions. For example, how does one hook a button onClick event? If there is some Freeway documentation that explains this please point me at it.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I haven’t actually downloaded anything from the site recently, but I’m pretty sure you can find all you want at this link. Don’t forget the Tech Notes.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 18 Sep 2009, at 20:07, Michael Nikisher wrote:

I need to see some simple examples of how one handles object events
using Actions. For example, how does one hook a button onClick
event? If there is some Freeway documentation that explains this
please point me at it.

Do you mean to a button in the Actions interface or on the resulting
HTML? If the former, this will add a button parameter to the interface
in Freeway (in the Actions palette for that particular Action):

<action-button name="myButton" title="Do something"  

onclick=“someFunction()” />

Where someFunction() is a function in the Action that does something
(as opposed to the resulting HTML). If the latter, this will add an
onclick attribute to an item in the tag stream (that gets created on
publish, in order of the page). It will also assume that you are using
an item action (one that is applied to items) and it is applied to a
button item:

var inputItem = fwDocument.fwTags.fwFind("input", fwItem); // Find  

the button in the item
inputItem.onclick = fwQuote(someFunction()); // Apply the onclick
attribute to the input item

You will of course need the function to be added to the page too. This
can be done like this:

var js = fwDocument.fwTags.fwFind("head").fwAddJavaScript(); // Find  

an open JS block in the head (or create one if none exist)
js.fwAddRawOpt(“function someFunction() {”);
js.fwAddRawOpt("// Do something");
js.fwAddRawOpt("}");

Don’t forget to look at the wiki:

http://actionsforge.com/wikis/view/12-actions-api

I hope this helps,

Jjoe


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you Joe and Joe! The tech notes and the Wiki have cleared up my befuddlement.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options