I want to make a checkbox visible based on the current file value of
an action-file parameter. All works at a basic level – I can tell
pretty well whether the action-file has a current file attached or not
– but I can’t seem to reliably switch based on the string value of
that file. (I’m trying to show or hide a control that only applies to
QuickTime movies.)
This will definitely work the first time the element is modified. And
if you change the file selector to None, then it properly disappears.
But if you switch to a different file-type, you can get it stuck with
the checkbox showing or not showing, and nothing further will budge
it, short of editing the Action to force the page tree to rebuild.
I’ve tried adding a fwParameterChanged() callback with the same
function in it, but that makes things worse.
There were a couple of things in your code that I think were getting this confused;
The value of myFile was getting returned as null (fwParameters.original.toString()) so I swapped it for fwFileName (line 8)
The file extension match was returning either an array of matches or null rather than true or false which I would imagine is required for fwVisible. I’ve added an explicit “!= null” in the check (line 9) which appears to do the job.
Regards,
Tim.
On 10 Jun 2011, at 20:13, Walter Lee Davis wrote:
This will definitely work the first time the element is modified. And if you change the file selector to None, then it properly disappears. But if you switch to a different file-type, you can get it stuck with the checkbox showing or not showing, and nothing further will budge it, short of editing the Action to force the page tree to rebuild.
There were a couple of things in your code that I think were getting
this confused;
The value of myFile was getting returned as null
(fwParameters.original.toString()) so I swapped it for fwFileName
(line 8)
The file extension match was returning either an array of matches
or null rather than true or false which I would imagine is required
for fwVisible. I’ve added an explicit “!= null” in the check (line
which appears to do the job.
Regards,
Tim.
On 10 Jun 2011, at 20:13, Walter Lee Davis wrote:
This will definitely work the first time the element is modified.
And if you change the file selector to None, then it properly
disappears. But if you switch to a different file-type, you can get
it stuck with the checkbox showing or not showing, and nothing
further will budge it, short of editing the Action to force the
page tree to rebuild.