How to reinitialize label after directory chooser was used? - install4j

Today I created a customized directory chooser scrren with a directory chosser component and a label displaying the free disk space. The label has an initialization script which calculate the free disk space and set the value to the label. also the "Reset initialization..." checkbox is selected. That works fine if I go step back and return to my custom screen. But if I select a directory with the directory chooser the label is not reinitialized. For the chosser component I implemented a validation script and the first action at this script ist to call formEnvironment.reinitializeFormComponents();. I thought the validation will also be triggered after I have chosen the directory without clicking the next button like the description implicated to me. Is there another way to reinitialize the label?

Indeed, the initialization script is just run once when the screen is shown. In your case, you would have to update the label text from your validation script of the directory chooser. You can access the label in this way:
((JLabel)formEnvironment.getFormComponentById("123").
getConfigurationObject()).setText("new text");

Related

How do I display data/information with Matlab App Designer?

I would like to display some information to the user via Matlab App Designer's GUI. I am new to this program and can't seem to find a widget that provides what I feel should be a simple function. Am I missing something? Examples would include showing the user:
The path of the file that he/she selected
Errors such as "No files detected" that are printed in a Matlab script called on by the GUI code.
Other print statements in code such as "Done!", etc that will inform the user when a process is complete.
Is there a way to capture the output in the Matlab command line and report these in a window of some sort in the GUI? Thanks in advance!
You can use a TextArea to display information for the user. Here's how I made a simple example:
Drag a button to the app in design view.
Drag in a text area also. I changed the label to Feedback.
Select the button and use the Callbacks tab in the bottom right of app designer to add a callback with the default name it gives you.
Edit the callback to contain
answer = 'what your want to display';
app.FeedbackTextArea.Value = answer;
When you push the button the text area gets filled. In your code, instead of just setting 'answer' to some string, set a variable using whatever code is dealing with your user's information. The key is to store what you want the user to see in a variable and then assign that to the "Value" parameter of the text area or other widget where you want them to see the results.

How to prevent installation variables to be placed in the response file in 6.x?

How can I prevent some installation variables from being placed into the response file? The reason is: during an update I want some particular variables to always have their default values and not be overwritten. In particular for some custom form components like a checkbox or radio button.
You can call
context.unregisterResponseFileVariable("variableName")
before the response file is written.

How to implement a button into Simulink Subsystem Mask?

As I need to specify a local variable to a Subsystem, I created a mask. Doing that I lose the easy access to the subsystem. Right-click and navigating to "Look under mask" is supposed to be too complicated.
So I thought about a workaround and built the following:
The dialog callback code behind the "Get deeper!" checkbox is:
myParameter = %Parameter set by checking Get deeper!
path = gcb(gcs);
if strcmp(get_param(gcb,'myParameter'),'on')
open_system(path,'tab');
end
Everytime when I check the box, the subsystem gets opened and also by every double click on the subsystem, in case the box was checked before. Hence the code does what it should, but thats actualy not the common way how one would realize/visualize something like this.
What I want is a button "Look under mask" in my mask - so the subsystem just gets opened by clicking on that button. Basically the button should call the function: open_system(gcb(gcs),'tab'). Looks so easy, but Simulink doesn't offer me any option to implement this. Can anybody help?
The main issue whith the current solution is also that with every execution of the model all subsystems open up, where the box is checked. That's not the idea.
Matlab 2012b adds exactly what you want: masked blocks have a button on the botton left that is a shortcut to "Look under mask".
Unfortunately, I don't think it is possible to add a button in a mask.
You may want to change your function to automatically set the "Get deeper!" checkbox off after the user clicks on it. That would avoid the automatic opening of the subsystems when the model is loaded. You could do that adding set_param(path,'myParameter','off') just after the open_system(path,'tab');
Finally, as another workaround, you may want to set the OpenFcn callback to call open_system(gcb,'tab'). This will make the system work as if it isn't masked at all. You can put two open_system calls, one to look under mask and the other to open the mask dialog box, if you prefer.

How to skip input control screen in Jasperserver (Using Hyperlink from Drill report)

Ok so I created a Drill down Report (lets call it DrillONE) which uses a hyperlink to drill down to a other report (lets call it DrillTWO)
the drill down report (DrillTWO) doesn't have Input controls because it gets all its info from the report that is calling it (DrillONE)
So the hyperlink to DrillTWO looks something like this
"./flow.html?_flowId=viewReportFlow&reportUnit=
%2FNWU%2FStudentInformation%2FAcademicProgramDevelopment%2FAPQIBI005drill
&startDate=" + new SimpleDateFormat("yyyy/MM/dd").format($P{startDate})"
Now my problem comes when Going back from DrillTWO to DrillONE (Without having to enter the input controles again and clicking RUN)
What happens is When I click the hyperlink back to DrillONE it sends the parameters and everything along fine, but it loads the input control screen and then the user has to run the report
I want it to go directly to DrillONE and run it, (Skip the input controle screen)
Is DrillONE set to always prompt for input controls? Turn this off.

Why won't Perl/Tk wipe my spreadsheet?

[cross posted again to Mahalo answers]
My Perl/Tk script has an initial spreadsheet like grid displayed using the Tk::TableMatrix::Spreadsheet modules. My spreadsheet is programatically called $ss. This initial grid is wiped before the display of the first spreadsheet, with
$ss->pack('forget');
The script as it is now also adds $mw-> pack('forget');, but that's not necessary.
My question is how to open a second file from the File -> Open dialog box and it wipe out the first file displayed, just like the first file wipes out the initial grid? Right now the second file shows up as a complete new frame underneath the still displayed first spreadsheet.
Thanks for the help in advance.
"pack('forget')" merely removes a widget from view. It doesn't delete it, nor does it do anything with the data displayed within it. If you fail to destroy the widget you will have, in effect, a big memory leak as you create more and more spreadsheet widgets.
The quickest solution to your problem is to destroy the old widget (using the destroy method) and recreate it with the new data. Another solution is to keep the widget but use deleteRows() to remove all the existing data before inserting the data for the new file.