Discussion:
form events in v15
Allen Matlick
2017-02-07 19:47:52 UTC
Permalink
Hi,

We have a database that we’re trying to transition from v13 to v15. It originally began in v3.5 and has been updated as 4D has advanced.

We have some detail forms which have variable fields where information is entered that is used for queries and a subform which displays the query results..

The list form that is attached to the subform area has code which executes each time an ‘on display detail’ event occurs.

In v13 we could type some info into one of the variable fields and then tab out to execute the query and the displayed records would execute the ‘on display detail’ event once for each of the displayed records. With v15 we are finding that the ‘on display detail’ events are being generated many, many more times than they were with v15. In this specific case, each time a letter is typed into the entry variable the displayed info refreshes. Net effect is a very, very sluggish user interface.

In one case, the display detail events are being triggered so frequently that the form is barely usable. We have restricted the activated events for the forms to the minimum we can. We are also seeing some things which are confusing, e.g. each time we type a character into a data entry variable the entire form redraws, but if we turn off the ‘on clicked’ event then the redraws stop.

It seems that form events are propagating very differently in v15 compared to v13. Can anyone provide any insight, pointers to docs, … ?

We’re using a subform for display because we want to display 2 lines of data for each record and in some cases we include graphic elements which behave like buttons so that the user can bring up more info about specific components of the displayed information.

Any insight would be appreciated. Thanks.

Allen


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*********************************
Keith Culotta
2017-02-07 20:26:40 UTC
Permalink
Allen,

It's been my experience that more events fire in v15 forms than fired in older versions. I started turning off as many unneeded events in converted forms as possible, and surrounding code with a test for the desired event. Sometimes the test will include a flag.
It's mostly a clean up of (or working around) loose habits from 4Ds more accommodating days.

Case of
: (Form event=On Display Detail) & (OKToUseODDFlag)
OKToUseODD:=False
....
End case


Keith - CDI
Post by Allen Matlick
Hi,
We have a database that we’re trying to transition from v13 to v15. It originally began in v3.5 and has been updated as 4D has advanced.
We have some detail forms which have variable fields where information is entered that is used for queries and a subform which displays the query results..
The list form that is attached to the subform area has code which executes each time an ‘on display detail’ event occurs.
In v13 we could type some info into one of the variable fields and then tab out to execute the query and the displayed records would execute the ‘on display detail’ event once for each of the displayed records. With v15 we are finding that the ‘on display detail’ events are being generated many, many more times than they were with v15. In this specific case, each time a letter is typed into the entry variable the displayed info refreshes. Net effect is a very, very sluggish user interface.
In one case, the display detail events are being triggered so frequently that the form is barely usable. We have restricted the activated events for the forms to the minimum we can. We are also seeing some things which are confusing, e.g. each time we type a character into a data entry variable the entire form redraws, but if we turn off the ‘on clicked’ event then the redraws stop.
It seems that form events are propagating very differently in v15 compared to v13. Can anyone provide any insight, pointers to docs, … ?
We’re using a subform for display because we want to display 2 lines of data for each record and in some cases we include graphic elements which behave like buttons so that the user can bring up more info about specific components of the displayed information.
Any insight would be appreciated. Thanks.
Allen
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
************************
Kirk Brooks
2017-02-08 00:44:07 UTC
Permalink
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Post by Allen Matlick
Hi,
We have a database that we’re trying to transition from v13 to v15. It
originally began in v3.5 and has been updated as 4D has advanced.
We have some detail forms which have variable fields where information is
entered that is used for queries and a subform which displays the query
results..
The list form that is attached to the subform area has code which executes
each time an ‘on display detail’ event occurs.
In v13 we could type some info into one of the variable fields and then
tab out to execute the query and the displayed records would execute the
‘on display detail’ event once for each of the displayed records. With v15
we are finding that the ‘on display detail’ events are being generated
many, many more times than they were with v15. In this specific case, each
time a letter is typed into the entry variable the displayed info
refreshes. Net effect is a very, very sluggish user interface.
In one case, the display detail events are being triggered so frequently
that the form is barely usable. We have restricted the activated events
for the forms to the minimum we can. We are also seeing some things which
are confusing, e.g. each time we type a character into a data entry
variable the entire form redraws, but if we turn off the ‘on clicked’ event
then the redraws stop.
It seems that form events are propagating very differently in v15 compared
to v13. Can anyone provide any insight, pointers to docs, … ?
We’re using a subform for display because we want to display 2 lines of
data for each record and in some cases we include graphic elements which
behave like buttons so that the user can bring up more info about specific
components of the displayed information.
Any insight would be appreciated. Thanks.
Allen
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
--
Kirk Brooks
San Francisco, CA
=======================
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*******************
Arnaud de Montard
2017-02-08 09:15:21 UTC
Permalink
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Yes, that's what I do too. And to avoid missing some (schematically):
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case

Notes: when a form is created, some events are automatically checked by 4D even if they are not required (at least by me). The "default" tab of the properties palette shows a restricted set of events, while the "detailed event" tab shows them all. The "magic shortcut" (cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
**************************************
Allen Matlick
2017-02-08 18:55:59 UTC
Permalink
Thanks for your responses.

The events associated with the various variables and forms are minimized and the methods associated with the variables and forms are wrapped with the corresponding ‘if (form event = …) conditionals.

What I seem to be seeing is that the subform is being redrawn much more frequently in v15.3 than v13.5. With each redraw I’m seeing another on display detail event, as I would expect.

I’m comparing identical forms, with identical settings in v13.5 and v15.3.

The form displays payroll transactions for employees. There are some display variables that are used to trigger searches the appropriate table and the results are displayed in the subform. The search does not occur until the “on data change” event fires.

The main form has only the events on load, on clicked, on activate and on data change.
The subform has no associated events
The list form associated with the subform has only the on display detail event.
The display variables have only the on data change event.

I added another display variable to the main form which to display the number of times on display detail event occurs. The variable is a process variable.
In the list form method, inside the "on display detail conditional" I added code that increments the count variable by one.

The subform displays 7 records.

Here’s what I see with v13.5

Action Cumulative count
Open form 0 opens within a second
Click into employee name variable 0
keystroke 1 0
keystroke 2 0
keystroke 3 0
keystroke 4 0
keystroke 5 0
tab out of field 7 this initiates a query and updates the display
click into different search variable 7

By comparison with v15.3
Open form 0 opens in about 8 seconds — much slower
Click into employee name variable 14
keystroke 1 21
keystroke 2 28
keystroke 3 35
keystroke 4 42
keystroke 5 49
tab out of field 56 this initiates a query and updates the display
click into different search variable 70

Can you think of any way to reduce the number of redraws? Any other ideas?

Allen
Post by Keith Culotta
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case
Notes: when a form is created, some events are automatically checked by 4D even if they are not required (at least by me). The "default" tab of the properties palette shows a restricted set of events, while the "detailed event" tab shows them all. The "magic shortcut" (cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*******************************************************************
Chip Scheide
2017-02-08 19:16:52 UTC
Permalink
the 'subform' is it a subform (an included listing form from another
table), a listbox, or a widget (also called a subform)?

Are the relations between the parent and child table(s) automatic or
manual?
if any are automatic - try making them manual.
Post by Allen Matlick
Thanks for your responses.
The events associated with the various variables and forms are
minimized and the methods associated with the variables and forms are
wrapped with the corresponding ‘if (form event = …) conditionals.
What I seem to be seeing is that the subform is being redrawn much
more frequently in v15.3 than v13.5. With each redraw I’m seeing
another on display detail event, as I would expect.
I’m comparing identical forms, with identical settings in v13.5 and v15.3.
The form displays payroll transactions for employees. There are some
display variables that are used to trigger searches the appropriate
table and the results are displayed in the subform. The search does
not occur until the “on data change” event fires.
The main form has only the events on load, on clicked, on activate and on data change.
The subform has no associated events
The list form associated with the subform has only the on display detail event.
The display variables have only the on data change event.
I added another display variable to the main form which to display
the number of times on display detail event occurs. The variable is
a process variable.
In the list form method, inside the "on display detail conditional" I
added code that increments the count variable by one.
The subform displays 7 records.
Here’s what I see with v13.5
Action Cumulative count
Open form 0 opens within a second
Click into employee name variable 0
keystroke 1 0
keystroke 2 0
keystroke 3 0
keystroke 4 0
keystroke 5 0
tab out of field 7 this initiates a query and updates the display
click into different search variable 7
By comparison with v15.3
Open form 0 opens in about 8 seconds — much slower
Click into employee name variable 14
keystroke 1 21
keystroke 2 28
keystroke 3 35
keystroke 4 42
keystroke 5 49
tab out of field 56 this initiates a query and updates the display
click into different search variable 70
Can you think of any way to reduce the number of redraws? Any other ideas?
Allen
Post by Keith Culotta
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case
Notes: when a form is created, some events are automatically checked
by 4D even if they are not required (at least by me). The "default"
tab of the properties palette shows a restricted set of events,
while the "detailed event" tab shows them all. The "magic shortcut"
(cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*****************************************************************
Allen Matlick
2017-02-08 21:13:48 UTC
Permalink
It's a subform. All relations to related tables are manual.

Sent from my iPad
Post by Chip Scheide
the 'subform' is it a subform (an included listing form from another
table), a listbox, or a widget (also called a subform)?
Are the relations between the parent and child table(s) automatic or
manual?
if any are automatic - try making them manual.
Post by Allen Matlick
Thanks for your responses.
The events associated with the various variables and forms are
minimized and the methods associated with the variables and forms are
wrapped with the corresponding ‘if (form event = …) conditionals.
What I seem to be seeing is that the subform is being redrawn much
more frequently in v15.3 than v13.5. With each redraw I’m seeing
another on display detail event, as I would expect.
I’m comparing identical forms, with identical settings in v13.5 and v15.3.
The form displays payroll transactions for employees. There are some
display variables that are used to trigger searches the appropriate
table and the results are displayed in the subform. The search does
not occur until the “on data change” event fires.
The main form has only the events on load, on clicked, on activate and on data change.
The subform has no associated events
The list form associated with the subform has only the on display detail event.
The display variables have only the on data change event.
I added another display variable to the main form which to display
the number of times on display detail event occurs. The variable is
a process variable.
In the list form method, inside the "on display detail conditional" I
added code that increments the count variable by one.
The subform displays 7 records.
Here’s what I see with v13.5
Action Cumulative count
Open form 0 opens within a second
Click into employee name variable 0
keystroke 1 0
keystroke 2 0
keystroke 3 0
keystroke 4 0
keystroke 5 0
tab out of field 7 this initiates a query and updates the display
click into different search variable 7
By comparison with v15.3
Open form 0 opens in about 8 seconds — much slower
Click into employee name variable 14
keystroke 1 21
keystroke 2 28
keystroke 3 35
keystroke 4 42
keystroke 5 49
tab out of field 56 this initiates a query and updates the display
click into different search variable 70
Can you think of any way to reduce the number of redraws? Any other ideas?
Allen
Post by Keith Culotta
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case
Notes: when a form is created, some events are automatically checked
by 4D even if they are not required (at least by me). The "default"
tab of the properties palette shows a restricted set of events,
while the "detailed event" tab shows them all. The "magic shortcut"
(cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*****************************************
Chip Scheide
2017-02-08 21:37:45 UTC
Permalink
I would try replacing with a listbox (just as a test) maybe 4D changed
something with subforms and the way they redraw.

BTW - is the subform a subtable?
Post by Allen Matlick
It's a subform. All relations to related tables are manual.
Sent from my iPad
On Feb 8, 2017, at 11:16 AM, Chip Scheide
the 'subform' is it a subform (an included listing form from another
table), a listbox, or a widget (also called a subform)?
Are the relations between the parent and child table(s) automatic or
manual?
if any are automatic - try making them manual.
Post by Allen Matlick
Thanks for your responses.
The events associated with the various variables and forms are
minimized and the methods associated with the variables and forms are
wrapped with the corresponding ‘if (form event = …) conditionals.
What I seem to be seeing is that the subform is being redrawn much
more frequently in v15.3 than v13.5. With each redraw I’m seeing
another on display detail event, as I would expect.
I’m comparing identical forms, with identical settings in v13.5 and v15.3.
The form displays payroll transactions for employees. There are some
display variables that are used to trigger searches the appropriate
table and the results are displayed in the subform. The search does
not occur until the “on data change” event fires.
The main form has only the events on load, on clicked, on activate and on data change.
The subform has no associated events
The list form associated with the subform has only the on display detail event.
The display variables have only the on data change event.
I added another display variable to the main form which to display
the number of times on display detail event occurs. The variable is
a process variable.
In the list form method, inside the "on display detail conditional" I
added code that increments the count variable by one.
The subform displays 7 records.
Here’s what I see with v13.5
Action Cumulative count
Open form 0 opens within a second
Click into employee name variable 0
keystroke 1 0
keystroke 2 0
keystroke 3 0
keystroke 4 0
keystroke 5 0
tab out of field 7 this initiates a query and updates the display
click into different search variable 7
By comparison with v15.3
Open form 0 opens in about 8 seconds — much slower
Click into employee name variable 14
keystroke 1 21
keystroke 2 28
keystroke 3 35
keystroke 4 42
keystroke 5 49
tab out of field 56 this initiates a query and updates the display
click into different search variable 70
Can you think of any way to reduce the number of redraws? Any other ideas?
Allen
Post by Keith Culotta
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case
Notes: when a form is created, some events are automatically checked
by 4D even if they are not required (at least by me). The "default"
tab of the properties palette shows a restricted set of events,
while the "detailed event" tab shows them all. The "magic shortcut"
(cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*******************
Allen Matlick
2017-02-08 22:33:32 UTC
Permalink
The subform is not a subtable.

I tried creating a new detail form with a new subform, a couple of search variables and a very simple list form attached to the subform.

I’m not seeing the subform redraws to the extent they occur in my problematic forms. e.g. I don’t get a redraw every time I type a character into the entry variable. So, the behavior I’m seeing is not a new default behavior for subforms.

These are forms that have existed since at least v6. I guess my next step is to try recreating the form from scratch.

Do you have any idea what things in 4d trigger the redraw of the subform?

Thanks again.

Allen
Post by Chip Scheide
I would try replacing with a listbox (just as a test) maybe 4D changed
something with subforms and the way they redraw.
BTW - is the subform a subtable?
Post by Allen Matlick
It's a subform. All relations to related tables are manual.
Sent from my iPad
On Feb 8, 2017, at 11:16 AM, Chip Scheide
the 'subform' is it a subform (an included listing form from another
table), a listbox, or a widget (also called a subform)?
Are the relations between the parent and child table(s) automatic or
manual?
if any are automatic - try making them manual.
Post by Allen Matlick
Thanks for your responses.
The events associated with the various variables and forms are
minimized and the methods associated with the variables and forms are
wrapped with the corresponding ‘if (form event = …) conditionals.
What I seem to be seeing is that the subform is being redrawn much
more frequently in v15.3 than v13.5. With each redraw I’m seeing
another on display detail event, as I would expect.
I’m comparing identical forms, with identical settings in v13.5 and v15.3.
The form displays payroll transactions for employees. There are some
display variables that are used to trigger searches the appropriate
table and the results are displayed in the subform. The search does
not occur until the “on data change” event fires.
The main form has only the events on load, on clicked, on activate
and on data change.
The subform has no associated events
The list form associated with the subform has only the on display detail event.
The display variables have only the on data change event.
I added another display variable to the main form which to display
the number of times on display detail event occurs. The variable is
a process variable.
In the list form method, inside the "on display detail conditional" I
added code that increments the count variable by one.
The subform displays 7 records.
Here’s what I see with v13.5
Action Cumulative count
Open form 0 opens within a second
Click into employee name variable 0
keystroke 1 0
keystroke 2 0
keystroke 3 0
keystroke 4 0
keystroke 5 0
tab out of field 7 this initiates a query and updates the display
click into different search variable 7
By comparison with v15.3
Open form 0 opens in about 8 seconds — much slower
Click into employee name variable 14
keystroke 1 21
keystroke 2 28
keystroke 3 35
keystroke 4 42
keystroke 5 49
tab out of field 56 this initiates a query and updates the display
click into different search variable 70
Can you think of any way to reduce the number of redraws? Any other ideas?
Allen
Post by Keith Culotta
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the events
you actually need.
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case
Notes: when a form is created, some events are automatically checked
by 4D even if they are not required (at least by me). The "default"
tab of the properties palette shows a restricted set of events,
while the "detailed event" tab shows them all. The "magic shortcut"
(cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
***********************************************************
John E. Bowen
2017-02-08 23:50:14 UTC
Permalink
The recreate form from scratch may not be a bad idea. They (4D) have done a
great job with maintaining compatibility, but things have changed.

For the question as to why it redraws, at a fundamental level, ah, no, but
agree it can be frustrating.

There's one more trick I've used in the past. It's not as satisfying,
maybe, but does the job.

For your list form method, put in one additional check: has this operation
already been run "recently"?

c_longint(L_last_run_ms;$L_threshold_ms)

$L_threshold_ms:= 10 // if called more often than this, ignore
if(Milliseconds - L_last_run_ms > $L_threshold_ms)
//do stuff
L_last_run_ms := Milliseconds
else
// just ignore it
end if

So, basically, if we get called "too often" we ignore one or more calls. I
have also used this idea when there are a lot of calls from different
places in the code, and the calculation, or lookup or whatever, is fairly
"expensive".

In your example, care needs to be taken that no user input is lost, e.g.
user types 'hello' and the last 'o' does not get processed.

So it can take some tuning. Again, it's better to find the real root cause
or recreate the form if that solves.



John Bowen
Solutions in 4D since 1989
***@gmail.com
949-281-6321
Post by Allen Matlick
The subform is not a subtable.
I tried creating a new detail form with a new subform, a couple of search
variables and a very simple list form attached to the subform.
I’m not seeing the subform redraws to the extent they occur in my
problematic forms. e.g. I don’t get a redraw every time I type a
character into the entry variable. So, the behavior I’m seeing is not a
new default behavior for subforms.
These are forms that have existed since at least v6. I guess my next step
is to try recreating the form from scratch.
Do you have any idea what things in 4d trigger the redraw of the subform?
Thanks again.
Allen
Post by Chip Scheide
I would try replacing with a listbox (just as a test) maybe 4D changed
something with subforms and the way they redraw.
BTW - is the subform a subtable?
Post by Allen Matlick
It's a subform. All relations to related tables are manual.
Sent from my iPad
On Feb 8, 2017, at 11:16 AM, Chip Scheide
the 'subform' is it a subform (an included listing form from another
table), a listbox, or a widget (also called a subform)?
Are the relations between the parent and child table(s) automatic or
manual?
if any are automatic - try making them manual.
Post by Allen Matlick
Thanks for your responses.
The events associated with the various variables and forms are
minimized and the methods associated with the variables and forms are
wrapped with the corresponding ‘if (form event = …) conditionals.
What I seem to be seeing is that the subform is being redrawn much
more frequently in v15.3 than v13.5. With each redraw I’m seeing
another on display detail event, as I would expect.
I’m comparing identical forms, with identical settings in v13.5 and v15.3.
The form displays payroll transactions for employees. There are some
display variables that are used to trigger searches the appropriate
table and the results are displayed in the subform. The search does
not occur until the “on data change” event fires.
The main form has only the events on load, on clicked, on activate
and on data change.
The subform has no associated events
The list form associated with the subform has only the on display detail event.
The display variables have only the on data change event.
I added another display variable to the main form which to display
the number of times on display detail event occurs. The variable is
a process variable.
In the list form method, inside the "on display detail conditional" I
added code that increments the count variable by one.
The subform displays 7 records.
Here’s what I see with v13.5
Action Cumulative count
Open form 0 opens within a second
Click into employee name variable 0
keystroke 1 0
keystroke 2 0
keystroke 3 0
keystroke 4 0
keystroke 5 0
tab out of field 7 this initiates a query and updates the display
click into different search variable 7
By comparison with v15.3
Open form 0 opens in about 8 seconds — much slower
Click into employee name variable 14
keystroke 1 21
keystroke 2 28
keystroke 3 35
keystroke 4 42
keystroke 5 49
tab out of field 56 this initiates a query and updates the display
click into different search variable 70
Can you think of any way to reduce the number of redraws? Any other ideas?
Allen
Post by Keith Culotta
Post by Keith Culotta
Allen,
I'll add my voice to Keith's suggestion that you turn off all events on the
forms (except On Load) and try working with the form. Turn on the
events
Post by Chip Scheide
Post by Allen Matlick
Post by Allen Matlick
Post by Keith Culotta
Post by Keith Culotta
you actually need.
Case of
:(evt1)
:(evt2)
else
trace //unexpected, check or uncheck but don't let it this way
end case
Notes: when a form is created, some events are automatically checked
by 4D even if they are not required (at least by me). The "default"
tab of the properties palette shows a restricted set of events,
while the "detailed event" tab shows them all. The "magic shortcut"
(cmd+clic, I do like this one!) can be use to uncheck all at once.
--
Arnaud de Montard
************************************************************
**********
Post by Chip Scheide
Post by Allen Matlick
Post by Allen Matlick
Post by Keith Culotta
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
************************************************************
**********
Post by Chip Scheide
Post by Allen Matlick
Post by Allen Matlick
************************************************************
**********
Post by Chip Scheide
Post by Allen Matlick
Post by Allen Matlick
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
************************************************************
**********
Post by Chip Scheide
Post by Allen Matlick
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
***********************************************

Continue reading on narkive:
Loading...