generate Action interface elements programmatically?

How would you go about scanning a page within fwInterface() to
generate a set of action interface elements based on a subset of the
page elements? Is that even possible without publishing the page first?

I’d like to scan a page and gather all of the form elements – inputs,
selects, textareas, etc. – and present a single interface element for
each one within the Actions palette, so I could then designate which
ones need to be mandatory, which ones have other format requirements,
and so forth. I’d like to do this as a page Action rather than forcing
the user to attach an Action to each form element. I’d also not want
to have a defined set of controls in the Action, and force people to
work around the ones they don’t need or to run off the edge of the
world if there are more inputs in their form than the Action
anticipates.

Is there a way to build an Action interface entirely programmatically,
using metaprogramming of this nature?

Thanks in advance,

Walter

  • Happy Easter, all!

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

Hi Walter,

Unfortunately this isn’t possible. the only way to do it is to have an army of parameters available but hidden until the page has been scanned in fwParametersCreated() first and then fwInterface() subsequently.

Joe

On 4 Apr 2010, at 18:32, Walter Lee Davis wrote:

How would you go about scanning a page within fwInterface() to generate a set of action interface elements based on a subset of the page elements? Is that even possible without publishing the page first?

I’d like to scan a page and gather all of the form elements – inputs, selects, textareas, etc. – and present a single interface element for each one within the Actions palette, so I could then designate which ones need to be mandatory, which ones have other format requirements, and so forth. I’d like to do this as a page Action rather than forcing the user to attach an Action to each form element. I’d also not want to have a defined set of controls in the Action, and force people to work around the ones they don’t need or to run off the edge of the world if there are more inputs in their form than the Action anticipates.

Is there a way to build an Action interface entirely programmatically, using metaprogramming of this nature?

Thanks in advance,

Walter

  • Happy Easter, all!

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


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

Hi Walter,
This has been bugging me for the last couple of days mainly because
you should be able to look at fwPage.fwItems and tell which items are
form elements by looking at the output type.

Here’s a quick and quite crude example;
http://www.freewayactions.com/code/?f=find-form-items.fwaction

A couple of things to watch out for;

  1. fwPage.fwItems should return an array. I was unable to return a
    length from it however and ended up creating another two arrays to
    store the item data. I suspect I’m overlooking something REALLY obvious.
  2. Freeway 5 Pro with HTML 4 and up pages returns a single item from
    fwPage.fwItems - the PageDiv. Check for this and check it’s children
    for the real page content.

Regards,
Tim.

FreewayActions.com - Freeware and commercial actions for Freeway
Express & Pro.

Protect your mailto links from being harvested by spambots with Anti
Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


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

Thanks very much!

Walter


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