PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
[WD20] - How to re Init a Entry window without closing it
[WD20] - How to re Init a Entry window without closing it
Started by Yogi Yang, Feb., 19 2018 1:31 PM - 7 replies
Connect yourself…
Yogi Yang
#1
Posted on February, 19 2018 - 1:31 PM
Hello,
I am finding it hard to explain as to what I want but let me try.
I have a well designed Data Entry Window.
When the user clicks on Validate button it validates the data and save the entered data to a file and closes.
Now the users want an option where it I should save the entered to a file and become blanks again to that they can enter new data in it without having to close the window and then reopen it.
How can we keep Window open and reInitialize (make it blank) after saving user entered data?
I hope I have managed to explain my requirement.
TIA
Report
0
0
Gianni Spano
#2
Posted on February, 19 2018 - 1:44 PM
Hello Yogi.
If i understand well your requirement, To reinitialize a form after a save, use "Reset ()"
HTH
Gianni
Report
0
0
Al
#3
Posted on February, 19 2018 - 1:48 PM
Hello Yogi
If you also need to run the init code of the window fields then InitWindow() will be required.
Regards
Al
Report
0
0
Fabrice Harari
#4
Posted on February, 19 2018 - 1:48 PM
Hi
and/or you can do an executeprocess(WindowName, trtInit)
Best regards
Report
0
0
Yogi Yang
#5
Posted on February, 19 2018 - 2:26 PM
Hello and Thanks everyone!
It is working. Only thing that I had to add was HFlush("*") after saving data.
Regards,
Report
0
0
Art Bonds
#6
Posted on February, 19 2018 - 3:50 PM
Quote
Yogi Yang
Hello and Thanks everyone!
It is working. Only thing that I had to add was HFlush("*") after saving data.
Regards,
In my opinion, I don't think hFlush alone will do it. All hFlush does is commit the data to disk. It does not clear out all the data on the screen or prefill any mandatory data, etc.
Report
0
0
DerekT
#7
Posted on February, 19 2018 - 5:00 PM
I would agree with Art
What I do is
In the window global declaration
Declare a Record type variable - MyContact is a Record of Contact
Bind each window control 'by Variable' to MyContact
In the whenever modifying code block of each control use ControlToSource()
Following your Save add the code
HresetVariable(MyContact) //Reset all columns to their default values
SourceToScreen(MyWindow,MyContact) //Refresh the displayed values
Report
0
0
Yogi Yang
#8
Posted on February, 20 2018 - 7:40 AM
Quote
Art Bonds
In my opinion, I don't think hFlush alone will do it. All hFlush does is commit the data to disk. ...
That is exactly what I had to do because after re-initializing the window when a user selected an Invoice I have to show calculations as to what was the last invoiced amount as well as total amount of all invoices for a given financial year, and this was coming wrong until I used hFlush.
TIA
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text