Skip to content

Instantly share code, notes, and snippets.

@fwextensions
Forked from poor666/gist:1930325
Created February 28, 2012 07:32
Show Gist options
  • Save fwextensions/1930404 to your computer and use it in GitHub Desktop.
Save fwextensions/1930404 to your computer and use it in GitHub Desktop.
onMouseDown
onButtonDown = function(event)
{
event.result = [
["save", "enabled", false],
["Pass", "enabled", false],
["save", "label", waitingFrase()]
];
}
onButtonClick = function(event){
setup.password = event.currentValues.Pass;
var appDir = fw.userJsCommandsDir + "/my_commands";
var file = appDir+"/buildUp.jsf";
fw.runScript(file);
}
panelJSON = {
events: {
onFwObjectSettingChange: function(event) {
console.log(":::: onFwObjectSettingChange");
},
onFwActiveToolChange: function(event) {
console.log(":::: onFwActiveToolChange");
}
},
children: [
{ TextInput: {
name: "Pass",
toolTip: "Choose a password",
text: "clientpass",
style: {
fontWeight: "bold",
fontSize: 15,
}
} },
{ Button: {
label: "Build Presentationx",
name:"save",
events: {
buttonDown: onButtonDown,
click: onButtonClick
}
} }
]
};
fwlib.panel.register(panelJSON);
@fwextensions
Copy link
Author

You could also try calling validateNow() on the changed controls to force an update:

event.result = [
      ["save", "enabled", false],
      ["Pass", "enabled", false],
      ["save", "label", waitingFrase()],
      ["save", "validateNow"],
      ["Pass", "validateNow"]
];

@poor666
Copy link

poor666 commented Feb 28, 2012

events: {

            buttonDown: function(event){
                event.result = [
                ["save", "label", "Exporting..."],
                ["Pass", "enabled", false]
                // ["save", "enabled", false]
                ];

            },

            click: function(event)
            {



                event.result = [
                ["save", "label", "Export Case"],
                ["save", "enabled", true],
                ["Pass", "enabled", true]
                ];

                setup.password = event.currentValues.Pass;
                fw.runScript(fw.userJsCommandsDir+"/case2/buildUp.jsf");

            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment