documentation hunt

Where is fwGetInstance() defined?

Walter


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

Hi Walter,
The only example of this I could find was in the Navigation Action (line 814);
Freeway 5.5/Freeway 5.5 Pro.app/Contents/SharedSupport/Actions/ FAST/Navigation.fwactionb/Contents/Resources/Actions/Drop Down Menu.fwaction

I hope this helps in leu of some documentation.
Regards,
Tim.

On 11 Jun 2012, at 17:41, Walter Lee Davis wrote:

Where is fwGetInstance() defined?


FreewayActions.com - Freeware and commercial Actions for Freeway Express & Pro - http://www.freewayactions.com
FreewayStyle.com - Free Freeway templates and parts to download, use and explore - http://www.freewaystyle.com


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

That was what I found as well. Judging by how it’s used in the Action, I tried using it to get an object reference to a fwItem that was found using an action-itemref filtered picker, and failed miserably.

<action-itemref name="data" title="Data Source" filter="filterItems"/>
function filterItems(item){
	if(item == "")
		return false;
	if(item && (!item.fwIsLayer && !item.fwIsInlined || item.fwIsTableCell))
		return false;
	if(item && item.fwExportType != 1 && !item.fwIsLayer)
		return false;
	if(item && (item.fwFindAllActions(2,['com.wdstudio.html5_element']).length > 0))
	  return item;		
}

//inside fwBeforeEndBody
if(fwParameters.datalist.fwBoolValue){
  var sourcelist = fwParameters['data'].fwValue;
  element.list = fwQuote(sourcelist);
  var source = sourcelist.fwGetInstance();
}

At this point, source is undefined, but element.list is properly filled with the text value of the element found by the filterItems method.

Walter

On Jun 11, 2012, at 3:01 PM, Tim Plumb wrote:

Hi Walter,
The only example of this I could find was in the Navigation Action (line 814);
Freeway 5.5/Freeway 5.5 Pro.app/Contents/SharedSupport/Actions/ FAST/Navigation.fwactionb/Contents/Resources/Actions/Drop Down Menu.fwaction

I hope this helps in leu of some documentation.
Regards,
Tim.

On 11 Jun 2012, at 17:41, Walter Lee Davis wrote:

Where is fwGetInstance() defined?


FreewayActions.com - Freeware and commercial Actions for Freeway Express & Pro - http://www.freewayactions.com
FreewayStyle.com - Free Freeway templates and parts to download, use and explore - http://www.freewaystyle.com


actionsdev mailing list
email@hidden
Update your subscriptions at:
List Options | FreewayTalk


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

Just realized this is not true entirely. source is defined, but it does not have a reference to any of the properties of the real “source” element. So if I call source.id, I get undefined.

Walter

On Jun 11, 2012, at 3:47 PM, Walter Lee Davis wrote:

At this point, source is undefined,


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

Hi Walter/Tim,

fwGetInstance() is a FWLayoutElement method that will return the instance of a master item on a specified instance page.

FWLayoutElement fwGetInstance(ancestorPage);

If the FWLayoutElement it’s called on is not a master element, or no ancestor is specified, the element it’s called on is returned.

I’m pretty sure that’s the case anyway after a brief review of the code.

Hope this helps,

Stewart


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

That seems consistent with the result I found. Can you please spelunk a little more, and tell me how I could take a reference to a DIV on the current page and further manipulate it?

Given that I have an action-itemref that has acquired a target, let’s call it fwParameters.data, and I want to get a tag reference to that page element so that I can then look inside it for a child, using fwFind(‘select’), how would I get from that itemref reference to where I need to be?

Thanks,

Walter

On Jun 12, 2012, at 5:00 AM, stewart wrote:

Hi Walter/Tim,

fwGetInstance() is a FWLayoutElement method that will return the instance of a master item on a specified instance page.

FWLayoutElement fwGetInstance(ancestorPage);

If the FWLayoutElement it’s called on is not a master element, or no ancestor is specified, the element it’s called on is returned.

I’m pretty sure that’s the case anyway after a brief review of the code.

Hope this helps,

Stewart


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

Can you not use:

fwDocument.fwTags.fwFindAll(“select”, fwParameters.data.fwValue);

It’s a loooooooong time since I last wrote any Actions code in anger so this could be complete nonsense! Or I could have got the wrong end of the stick entirely…

Stewart


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

That doesn’t seem to do anything. I’ve tried a number of variations on it and can’t find the key.

Thanks,

Walter

On Jun 12, 2012, at 10:25 AM, stewart wrote:

Can you not use:

fwDocument.fwTags.fwFindAll(“select”, fwParameters.data.fwValue);

It’s a loooooooong time since I last wrote any Actions code in anger so this could be complete nonsense! Or I could have got the wrong end of the stick entirely…

Stewart


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

Ah, it’s not finding it because the owner of the select is not the parent item, it’s the menu/list item itself.

So you could do a fwFindAll(“select”) and then scoot up the tag tree from each found select comparing fwOwner against fwParameters.data.fwValue. Perhaps.

Stewart


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

Is there a method I can call on a parameter to see what kind of beast it is internally? I’m thinking of typeof in JavaScript here, but I need something that’s aware of the internal Freeway DOM. The parameter is being temporarily cast toString() when I use it inside the fwQuote() and use it to set the ID of the list, but I wonder what it is before I do that.

Thanks again,

Walter


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

I don’t believe so.

Stewart


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