how to store user entered value at run time into virtual Text in installjammer? - jammer

I am using Installjammer .I want user enter username at run time .And that should store in a file.
I have followed below steps:
after Start Copying Files
I have added Custom Black Pane2
then added widget
I have set following properties of widget-
Type entry
X 15
Y 85
Virtual Text UNAME
Text USERNAME
I have not set anything into value because I want this will be set when user enter
value at run time
after that I have added Write Text to File
I have set the following properties-
File open Action: Overwrite Existing File
Files: /home/user/temp.txt
Text To Write: <%UNAME%>
Output -It is not writing anything to file temp.text.
but if I m setting some text in value properties of widget then it is writing to
file.
Can any one tell me where I am wrong in this ? How to set user entered at run time
into virtual text ?
Thanks in Advanced !!

Related

Applescript dictionary missing fields how to iterate over settings set

In my previous question I asked how to change an AppleScript current settings to have the ShowActiveProcessArgumentsInTitle for the terminal profile. Because you can apply that plist field from another settings set yet the keywords in AppleScript are missing. This is proved by setting the terminal to a different profile red sands with that option toggled off using the current setting of that tab.
tell application "Terminal"
set newTab to do script "bash /Users/jredfox/Desktop/hello.sh"
set current settings of newTab to settings set "Red Sands"
end tell
#!/bin/bash
echo hello
read -p "Press ENTER to continue..."
exit
I have current settings of xtab and from there I want to iterate over every field in there. How can I do this? The AppleScript dictionary I just proved is missing a field that can be applied from AppleScript but isn't in the dictionary from the script editor app. So how do I iterate every field from current settings which is a settings set object. There appears to be new fields which are not in the dictionary. It's not iterable so using a repeat list isn't an option.

APEX dynamically define default filename?

In an APEX application, I have an interactive report.
In Report Attributes > Report Export > Filename, you can specify what file name you the download to have as a default.
Question: Is there a way to dynamically define this default filename?
Yes, I know, the user can change it when they do the download. But my boss wants the user to not to have to change the file name.
What can anyone tell me? Thanks!!
APEX 4.2
Windows 7
IE 11
Yes you can do this. Create a hidden page item (e.g. P1_REPORT_NAME) and set its value to be whatever you want the name of the file to be. You can calculate this in many different ways e.g. - pass a value through a link from another page, using a dynamic action or computation, or setting a default value via static content or pl/sql expression. Then navigate to Report Attributes > Report Export > Filename and set it to &P1_REPORT_NAME. - now the report will be called whatever the value of P1_REPORT_NAME is.

QFileDialog prompt to overwrite if selection changed

I would like a QFileDialog to prompt for overwrite confirmation only if the selection changed. Is there any way to achieve this?
Currently, I'm getting a save file name as follows:
data_file_name = QtGui.QFileDialog.getSaveFileName(self, "Data File", selected, self.FILTER_DATA_FILE)
If I'm re-saving an open project, selected is the name of the project file. If I'm creating a new project, selected is the name of the directory where the user most recently saved a project. If I enter a file name that doesn't exist (regardless of the value of selected), I don't get prompted for confirmation, as desired. However, if the selected name is a file that exists, also regardless of the value of selected, I always get promoted for confirmation. I would like the following behaviour:
If the dialog has a default selection and the user does not change this selection, do not prompt for confirmation.
Else if the user enters a file name that does not currently exist, do not prompt for confirmation.
Else prompt for confirmation. (I don't particularly care what happens if the user enters the empty string as a file name.)
I'm currently using Qt 4, though I'm not against upgrading to Qt 5 if that would make my life easier.
It looks like what I want isn't possible: QFileDialog::accept() doesn't provide any mechanism for that sort of customization. I'll have to disable overwrite confirmation in my dialog and implement that logic myself.

Batch file write to txt

I want to make a batch file that will ask user for input, than write that input to a specific position in an already written txt file(called commands.txt which contains query) and call sqlite3 < commands.txt
I need this so inside the commands.txt where the query is, in LIKE 'userinput' i will add the users choice (parameter)
Although your question is not really specific enough and verging on the kind of inappropriate question that for stackoverflow (it does not include code), as hinted at by the comment, I'll take it at face value and assume there is much you need help with.
First let me deal with the question "I need to make a batch file"
A batch file is a simple text file with the extension .bat. You can create it with a text editor like notepad. We do not know what kind of system you have (Windows, linux, Mac etc) but lets assume Windows as you asked for a batch file. We do not know which version of windows (7 or 8 etc), So I'll try and be generic.
All windows machines come with a simpe text file editor called notepad. You can open this by typing notepad into the search box on windows 7 or 8. Lets start with a simple batch file:
:: This is a batch file
#echo off
echo Hello World
exit /b
Type (or paste) those 4 lines into notepad. Now select the file menu and select Save As, now in the Save As Type: selector choose All Files. In the File name: box type the desired name with the bat extension, such as doit.bat. Ensure you choose a suitable directory to place your new batch file. Leave the encoding as ASCII. Click Save. You have now made your first batch file.
Now you need to execute that batch file. Using the Windows File Explorer find the folder where you saved that batch file. While viewing the folder, hold down the shift key on the keyboard and then right click in the background of the folder and select Open Command window here. You will now have a command prompt window. You can now execute your new batch file by typing its name doit. It will display:
Hello World
OK - Now you have created your first working batch file.
Now for the next part; Asking the user for input. This is done with the set /p command. Add this to your batch file (before the exit line):
Set /P Like="Give me your input: "
echo Your input was: %Like%
That has solved the second part. Now the third part, edit the commands.txt file. If you do an internet search for a similar problem (editing files in batch files) you might find this help page: http://www.ousob.com/ng/edlin/ng96d9.php. This shows a generic way of changing any text string to any other in a file using EDLIN from a batch file; unfortunately EDLIN (and EDIT) are no longer included in windows so these batch files are not much help.
A search of stackoverflow finds similar queries which contain an answer for you.
So now you have all the parts of the answer:
How to make a batch file
How to prompt the user for input
How to replace lines of text in the commands.txt
You should be able to put it together and get it to work....

Install4j console handler for directory selection

My app has an installation directory chooser form. It validates whether dir has required available space. Screen looks like:
some text
Dir chooser component
A label which prints the available disk space. This is bound to a context variable availableSpace.
Disk space is calculated in "validation expression".
This works correctly in UI mode. In console mode - the behaviour is:
A. #1 is shown.
B. #2 asks user to select dir
(user selects a dir)
C. #3 shows the label text. Since there is no calculation done yet, availableSpace is not updated yet. User sees an old value.
D. Validation logic triggers and the UI is rerendered.
E. #1 is shown. #2 is shown and user enters the dir again. #3 shows the value which was set in #C.
From UI's perspective the form has already calculated data so #C is correct.
But from console user's perspective, user entered a dir and so #C is confusing to user. Because he just entered a dir and space value is old. He thinks that the dir has space, why is application shows old value ?
How to fix this behaviour ?
One solutionis to not show #C on console mode and instead use a Util.showMessage().
Can ConsoleHandlerFormComponent solve this ?
Is there a handler for DirectoryChooserComponent selection ? That can check for space in real time.
Thanks for your help.
In console mode, the "Validation script" property of the "Installation directory chooser" form component is executed as soon as you confirm the selection.
The problem in your case is that the label is not updated. This is because form components are initialized only once at the time that the screen is created. You can call
formEnvironment.reinitializeFormComponents();
in the "Validation script", then the contents of the label will be evaluated again.

Resources