Title: Is it possible to display the same field in multiple places on a form? Post by: Ernest D. on August 30, 2024, 12:22:44 am Is it possible to display the same field in multiple places on a form?
For example: LAYOUT GRID { [field1] [field2] } END ATTRIBUTES field1 = formonly.field1, field2 = formonly.field1; This is returning to me the error: The column 'field1' appears more then once.See error number -2892. Title: Re: Is it possible to display the same field in multiple places on a form? Post by: Sebastien F. on August 30, 2024, 12:23:50 pm Hello,
No this is not possible, but would be a nice feature. You need to define distinct fields and program variables, and sync the program variables sharing the same value. Consider using the UNBUFFERED mode to reduce the code by getting rid of DISPLAY BY NAME / DISPLAY TO when changing variable values bound to a dialog. Array/table fields that do not need to be displayed in the TABLE can be defined as PHANTOM fields, and displayed in another field of the form. I do also implement "dialog setup" functions, to sync action and field activation, according to the context / current values / number of rows in tables. This technique centralizes all actions/fields setup, and can be called from different places in the dialog block. If you put DIALOG.setActionActive() / DIALOG.setFieldActive() calls all over the place in a complex dialog block, you end up with unmaintainable code. This setup function can also be used to sync linked fields. You can find nice examples on our github: https://github.com/FourjsGenero/ex_books In this example, we use BEFORE ROW to sync directly a TEXTEDIT field containing data from the current row: Code
For dialog setup functions, see for ex: https://github.com/FourjsGenero/tool_fglsqldebug https://github.com/FourjsGenero/ex_app_menu https://github.com/FourjsGenero/fgl_query_dialog Seb |