From time to time you may need to create a right-click operation for the Novell Operations Center Console that has a dialog with some buttons. There are a few approaches that you can take, but technical abilities will quickly jump into this. The option you choose might end up being limited by your background. Some of the options are
Write a compiled java class using components like swing to generate a dialog
Use Netbeans IDE and design the dialog, then use the outputted java code as your java script (99% of it works as-is)
Sling java script and build the dialog from scratch
There are some pretty advanced concepts for building dialogs such as gridbags, but there are times I would just like a dialog to come up, have the user press a button or two and then be done with it. I did some testing around with simple ways to do this within java script and in turn I wanted to make something that was re-usable, here is an example of the test script output.
Below in the zip file link, there are two files, pushbutton.fs is the one that you will reference and use within your scripts and pushbuttontest.fs is an example of how to do that.
It should be pretty straight forward, the idea is, make a call to create the dialog, then make another call to add a button to the dialog. Keep in mind that when you add a button to the dialog, you have to tell it the name of the function to call when it is pressed.
NOTE: The zip file appears to be a problem for some people, I attached the script files individually as .txt files, change the extension to .fs. You may also need to update the "load" statement depending on where you place the script fles.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.