Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Two more questions about dynamic dialogs  (Read 6241 times)
Candy M.
Posts: 139


« on: March 30, 2018, 08:44:26 pm »

First of all, I want to say how nicely the dynamic dialog works.  From a form specification table we have in our database, I have been able to build a simple form, set defaults, hide fields, make fields no entry, build comboboxes, validate data, and then add my transaction calling an SPL function in the database.

I have 2 questions.   My dialog is a simple entry form,
1) What is the best way to clear the fields in the dynamic dialog?   I tried a CLEAR FORM and that did not work, so I wrote a method to go through
all the fields to set them to null.
2) So we have a while loop that checks for the next dialog event.  My question is, will the "BEFORE INPUT" trigger only be executed one time, so when
you first enter the while loop, after the dialog is created?   I was thinking what was the best way to "start over".   Maybe the user wants to start over in their input,
or you have a successful add of your data and you want to make another entry, clear the form, set defaults and start at the first entry field.   Is it best to close dialog, set to null and then create it again and enter the loop, or is it fine to just clear fields, reset defaults and go to first field.   I chose the latter method.

Good job with the dynamic dialog.   We have wanted this feature for so long now, to build forms (simple) dynamically and capturing the input.  Now, I'll try building a table, display array.  :-)

Candy
Rene S.
Four Js
Posts: 111


« Reply #1 on: April 03, 2018, 12:18:27 pm »

Hello Candy,
Quote
1) What is the best way to clear the fields in the dynamic dialog?   I tried a CLEAR FORM and that did not work, so I wrote a method to go through
all the fields to set them to null.
CLEAR FORM works the same way when using dynamic and hard-coded dialogs. A dynamic dialog behaves like an UNBUFFERED dialog. The form fields will always show the values of the dialog. CLEAR FORM works: try a tiny MENY or PROMPT right after the CLAER statement. You'll see: the form fields are cleared. When returning back into the dialogs event loop then the runtime redisplays all values - the effect of CLEAR is gone.

Quote
My question is, will the "BEFORE INPUT" trigger only be executed one time
This depends how the input has been created. If it's a single-dialog created by createInputByName() then BEFORE INPUT is executed exactly once. If it's an input in a multiple dialog created by addInputByName() then BEFORE INPUT is executed whenever the focus enters into this sub dialog. That's exactly the same behavior as known from hard-coded dialogs.

Rene
Candy M.
Posts: 139


« Reply #2 on: April 03, 2018, 04:05:58 pm »

Hello Rene,
Quote
CLEAR FORM works the same way when using dynamic and hard-coded dialogs. A dynamic dialog behaves like an UNBUFFERED dialog. The form fields will always show the values of the dialog. CLEAR FORM works: try a tiny MENY or PROMPT right after the CLAER statement. You'll see: the form fields are cleared. When returning back into the dialogs event loop then the runtime redisplays all values - the effect of CLEAR is gone.
Understood.   So I think my method of needing to clear the values by setting to NULL is what I want because I want to "start over", erase the values.
Quote
This depends how the input has been created. If it's a single-dialog created by createInputByName() then BEFORE INPUT is executed exactly once. If it's an input in a multiple dialog created by addInputByName() then BEFORE INPUT is executed whenever the focus enters into this sub dialog. That's exactly the same behavior as known from hard-coded dialogs.
Very good.   I understand this.

Thanks Rene!
Candy
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines