ActionsDev

waltd

25 Jan 2016, 5:44 pm

Progressive disclosure of Action interface elements

I have a pattern in the Protaculous 2 Action where I only show one field on screen for extra libraries until the user enters something in the first field, and then I show a second field below that. This carries on until there are 10 on the screen in the palette, if you should need to go that far. This used to work pretty nicely, you would type something in the first field, and tab out to enter another value on the same line (there are three inputs per line) and the second line would appear right away. To get this level of interaction, I simply called fwInterface() from within fwParameterChanged(). I could swear this used to be more or less immediate. I just tried it today for the first time, and I found that I had to click on the main window in order to trigger the event. Just clicking or tabbing into another field did not do the job.

Is there a new way to do this, or am I just doing it wrong? Here’s the relevant code:

function fwInterface(){
  //scriptaculous library checkboxen
  var scriptaculousLibs = ["builder", "effects", "dragdrop", "controls", "slider", "sound"];
  for (var i = scriptaculousLibs.length - 1; i >= 0; i--){
    fwParameters[scriptaculousLibs[i]].fwVisible = fwParameters['scriptaculous'].fwBoolValue;
  };
  //external libraries progressive disclosure
  for (var i=1; i < 11; i++) {    var name = 'ext_' + i.toString() + '_name';    var path = 'ext_' + i.toString() + '_path';    var clear = 'ext_' + i.toString() + '_clear';    var prev = 'ext_' + (i - 1).toString() + '_name'    fwParameters[name].fwVisible = fwParameters[path].fwVisible = fwParameters[clear].fwVisible = (i > 1) ? (fwParameters['external'].fwBoolValue && fwParameters[prev].fwValue.toString().length > 1) : fwParameters['external'].fwBoolValue;
  };
}

function fwParameterChanged(){
  //make the interface visibility "live" to parameter changes
  fwInterface();
}

Walter

Freeway user since 1997

http://www.walterdavisstudio.com