Odd issue with fwParameterChanged

I have an Action that concatenates together a number of different
fwParameters to create a filename. Here’s a Gist of the Action:

I have a fwInterface() and fwParameterChanged() method in there to
update this concatenated value whenever one or another of the
component parts are updated by the user. The issue I am seeing is
this: when a text field is modified and blurs, the fwParameterChanged
function fires (I put an alert inside it to be sure) but the values of
the variables don’t appear to be updated at that point. So while the
function fires after a blur, it appears to act on stale data,
resulting in the wrong concatenated value being written.

This does not occur if the fwParameterChanged function is fired by a
click on a checkbox or button or a toggle of a picking list. In those
cases, the value is properly computed and updated. Naturally, the
correct values are always created if you click off of the Actions
palette and back again, since that calls the main fwInterface rather
than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I tried
using setTimeout, but that doesn’t seem to be enabled or used inside
of Actions.

Thanks,

Walter


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

There are two values in the fwParameterChanged function, oldValue and newValue. Are they both firing with stale data?

Joe

On 20 Nov 2010, at 21:06, Walter Lee Davis wrote:

I have an Action that concatenates together a number of different fwParameters to create a filename. Here’s a Gist of the Action:

gist:708141 · GitHub

I have a fwInterface() and fwParameterChanged() method in there to update this concatenated value whenever one or another of the component parts are updated by the user. The issue I am seeing is this: when a text field is modified and blurs, the fwParameterChanged function fires (I put an alert inside it to be sure) but the values of the variables don’t appear to be updated at that point. So while the function fires after a blur, it appears to act on stale data, resulting in the wrong concatenated value being written.

This does not occur if the fwParameterChanged function is fired by a click on a checkbox or button or a toggle of a picking list. In those cases, the value is properly computed and updated. Naturally, the correct values are always created if you click off of the Actions palette and back again, since that calls the main fwInterface rather than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I tried using setTimeout, but that doesn’t seem to be enabled or used inside of Actions.

Thanks,

Walter


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

Yes, identical. Here’s the test alert I entered:

alert(fwParameters[newParam.fwName])
alert(fwParameters[oldParam.fwName])

Both alerts are identical. Now the moment I cancel the Alert, I get a
second one with the correct values, again, both identical. But without
the Alert in there, the interface doesn’t update in Freeway until I
blur away from the Actions palette and focus back to it. It seems that
this double-call business only happens because focus is stolen by the
alert box.

Walter

On Nov 20, 2010, at 4:10 PM, Joe Billings wrote:

There are two values in the fwParameterChanged function, oldValue
and newValue. Are they both firing with stale data?

Joe

On 20 Nov 2010, at 21:06, Walter Lee Davis wrote:

I have an Action that concatenates together a number of different
fwParameters to create a filename. Here’s a Gist of the Action:

gist:708141 · GitHub

I have a fwInterface() and fwParameterChanged() method in there to
update this concatenated value whenever one or another of the
component parts are updated by the user. The issue I am seeing is
this: when a text field is modified and blurs, the
fwParameterChanged function fires (I put an alert inside it to be
sure) but the values of the variables don’t appear to be updated at
that point. So while the function fires after a blur, it appears to
act on stale data, resulting in the wrong concatenated value being
written.

This does not occur if the fwParameterChanged function is fired by
a click on a checkbox or button or a toggle of a picking list. In
those cases, the value is properly computed and updated. Naturally,
the correct values are always created if you click off of the
Actions palette and back again, since that calls the main
fwInterface rather than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I
tried using setTimeout, but that doesn’t seem to be enabled or used
inside of Actions.

Thanks,

Walter


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


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

function fwParameterChanged(newParam,oldParam){
	alert(fwParameters[newParam.fwName].fwValue.toString() + ':' +  

fwParameters[oldParam.fwName].fwValue.toString())
return fwInterface();
}

On Nov 20, 2010, at 4:10 PM, Joe Billings wrote:

There are two values in the fwParameterChanged function, oldValue
and newValue. Are they both firing with stale data?

Joe

On 20 Nov 2010, at 21:06, Walter Lee Davis wrote:

I have an Action that concatenates together a number of different
fwParameters to create a filename. Here’s a Gist of the Action:

gist:708141 · GitHub

I have a fwInterface() and fwParameterChanged() method in there to
update this concatenated value whenever one or another of the
component parts are updated by the user. The issue I am seeing is
this: when a text field is modified and blurs, the
fwParameterChanged function fires (I put an alert inside it to be
sure) but the values of the variables don’t appear to be updated at
that point. So while the function fires after a blur, it appears to
act on stale data, resulting in the wrong concatenated value being
written.

This does not occur if the fwParameterChanged function is fired by
a click on a checkbox or button or a toggle of a picking list. In
those cases, the value is properly computed and updated. Naturally,
the correct values are always created if you click off of the
Actions palette and back again, since that calls the main
fwInterface rather than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I
tried using setTimeout, but that doesn’t seem to be enabled or used
inside of Actions.

Thanks,

Walter


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


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

Ahh I see. You need to duplicate what you want from fwInterface in fwParameterChanged but replace fwParameters.whatever with newParam. Don’t call the fwInterface callback yourself.

To get the proper values use:

alert(newParam.fwValue.toString() + ':' + oldParam.fwValue.toString())

Joe

On 20 Nov 2010, at 21:18, Walter Lee Davis wrote:

function fwParameterChanged(newParam,oldParam){
alert(fwParameters[newParam.fwName].fwValue.toString() + ‘:’ + fwParameters[oldParam.fwName].fwValue.toString())
return fwInterface();
}

On Nov 20, 2010, at 4:10 PM, Joe Billings wrote:

There are two values in the fwParameterChanged function, oldValue and newValue. Are they both firing with stale data?

Joe

On 20 Nov 2010, at 21:06, Walter Lee Davis wrote:

I have an Action that concatenates together a number of different fwParameters to create a filename. Here’s a Gist of the Action:

gist:708141 · GitHub

I have a fwInterface() and fwParameterChanged() method in there to update this concatenated value whenever one or another of the component parts are updated by the user. The issue I am seeing is this: when a text field is modified and blurs, the fwParameterChanged function fires (I put an alert inside it to be sure) but the values of the variables don’t appear to be updated at that point. So while the function fires after a blur, it appears to act on stale data, resulting in the wrong concatenated value being written.

This does not occur if the fwParameterChanged function is fired by a click on a checkbox or button or a toggle of a picking list. In those cases, the value is properly computed and updated. Naturally, the correct values are always created if you click off of the Actions palette and back again, since that calls the main fwInterface rather than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I tried using setTimeout, but that doesn’t seem to be enabled or used inside of Actions.

Thanks,

Walter


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


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

Okay, got that, but it still doesn’t work unless I move focus out of
the Actions palette. It doesn’t seem to be possible to update a text
element in the Action by changing another text input while remaining
focused in the Actions palette. It works if I click on a button or a
checkbox or a picker, but blurring out of one text input and focusing
into another doesn’t do the job.

Here’s my entire fwParameterChanged, FWIW:

function fwParameterChanged(newParam,oldParam){
	//alert(newParam.fwValue.toString() + ':' +  
oldParam.fwValue.toString())
	var partialName = fwParameters['viewFilename'];
	var v = fwParameters['myName'].fwValue.toString();
	var m = fwParameters['modelName'].fwValue.toString();
	var e = fwParameters['extension'].fwValue.toString();
	switch(newParam.fwName){
		case 'myName':
			v = newParam.fwValue.toString();
			break;
		case 'modelName':
			m = newParam.fwValue.toString();
			break;
		case 'extension':
			e = newParam.fwValue.toString();
			break;
		default:
			break;
	}
	partialName.fwValue = ('_' + m + '_' + v + '.' + e);
}

Can anyone spot the loony?

Walter

On Nov 20, 2010, at 4:25 PM, Joe Billings wrote:

Ahh I see. You need to duplicate what you want from fwInterface in
fwParameterChanged but replace fwParameters.whatever with newParam.
Don’t call the fwInterface callback yourself.

To get the proper values use:

alert(newParam.fwValue.toString() + ‘:’ +
oldParam.fwValue.toString())

Joe

On 20 Nov 2010, at 21:18, Walter Lee Davis wrote:

function fwParameterChanged(newParam,oldParam){
alert(fwParameters[newParam.fwName].fwValue.toString() + ‘:’ +
fwParameters[oldParam.fwName].fwValue.toString())
return fwInterface();
}

On Nov 20, 2010, at 4:10 PM, Joe Billings wrote:

There are two values in the fwParameterChanged function, oldValue
and newValue. Are they both firing with stale data?

Joe

On 20 Nov 2010, at 21:06, Walter Lee Davis wrote:

I have an Action that concatenates together a number of different
fwParameters to create a filename. Here’s a Gist of the Action:

gist:708141 · GitHub

I have a fwInterface() and fwParameterChanged() method in there
to update this concatenated value whenever one or another of the
component parts are updated by the user. The issue I am seeing is
this: when a text field is modified and blurs, the
fwParameterChanged function fires (I put an alert inside it to be
sure) but the values of the variables don’t appear to be updated
at that point. So while the function fires after a blur, it
appears to act on stale data, resulting in the wrong concatenated
value being written.

This does not occur if the fwParameterChanged function is fired
by a click on a checkbox or button or a toggle of a picking list.
In those cases, the value is properly computed and updated.
Naturally, the correct values are always created if you click off
of the Actions palette and back again, since that calls the main
fwInterface rather than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I
tried using setTimeout, but that doesn’t seem to be enabled or
used inside of Actions.

Thanks,

Walter


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


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


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

It’s working, you need to hit Return for it to update though. Not updating on tab looks like a bug.

Joe

On 21 Nov 2010, at 01:02, Walter Lee Davis wrote:

Okay, got that, but it still doesn’t work unless I move focus out of the Actions palette. It doesn’t seem to be possible to update a text element in the Action by changing another text input while remaining focused in the Actions palette. It works if I click on a button or a checkbox or a picker, but blurring out of one text input and focusing into another doesn’t do the job.

Here’s my entire fwParameterChanged, FWIW:

function fwParameterChanged(newParam,oldParam){
	//alert(newParam.fwValue.toString() + ':' + oldParam.fwValue.toString())
	var partialName = fwParameters['viewFilename'];
	var v = fwParameters['myName'].fwValue.toString();
	var m = fwParameters['modelName'].fwValue.toString();
	var e = fwParameters['extension'].fwValue.toString();
	switch(newParam.fwName){
		case 'myName':
			v = newParam.fwValue.toString();
			break;
		case 'modelName':
			m = newParam.fwValue.toString();
			break;
		case 'extension':
			e = newParam.fwValue.toString();
			break;
		default:
			break;
	}
	partialName.fwValue = ('_' + m + '_' + v + '.' + e);
}

Can anyone spot the loony?

Walter

On Nov 20, 2010, at 4:25 PM, Joe Billings wrote:

Ahh I see. You need to duplicate what you want from fwInterface in fwParameterChanged but replace fwParameters.whatever with newParam. Don’t call the fwInterface callback yourself.

To get the proper values use:

alert(newParam.fwValue.toString() + ‘:’ + oldParam.fwValue.toString())

Joe

On 20 Nov 2010, at 21:18, Walter Lee Davis wrote:

function fwParameterChanged(newParam,oldParam){
alert(fwParameters[newParam.fwName].fwValue.toString() + ‘:’ + fwParameters[oldParam.fwName].fwValue.toString())
return fwInterface();
}

On Nov 20, 2010, at 4:10 PM, Joe Billings wrote:

There are two values in the fwParameterChanged function, oldValue and newValue. Are they both firing with stale data?

Joe

On 20 Nov 2010, at 21:06, Walter Lee Davis wrote:

I have an Action that concatenates together a number of different fwParameters to create a filename. Here’s a Gist of the Action:

gist:708141 · GitHub

I have a fwInterface() and fwParameterChanged() method in there to update this concatenated value whenever one or another of the component parts are updated by the user. The issue I am seeing is this: when a text field is modified and blurs, the fwParameterChanged function fires (I put an alert inside it to be sure) but the values of the variables don’t appear to be updated at that point. So while the function fires after a blur, it appears to act on stale data, resulting in the wrong concatenated value being written.

This does not occur if the fwParameterChanged function is fired by a click on a checkbox or button or a toggle of a picking list. In those cases, the value is properly computed and updated. Naturally, the correct values are always created if you click off of the Actions palette and back again, since that calls the main fwInterface rather than fwParameterChanged.

Has anyone seen anything similar? Any work-arounds to note?

Is there any way to delay execution of a portion of a script? I tried using setTimeout, but that doesn’t seem to be enabled or used inside of Actions.

Thanks,

Walter


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


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


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