On Jan 14, 2017, at 2:00 PM, Max Morrison wrote:
> v15R5 standalone and server/client, upgraded from v12, interpreted atm.
>
> First, I’d like to verify a possible change in behavior going from v12 to
> v15… It use to be the case that Tab Controls would maintain the currently
> displayed page across new-record load events, on an input form. In other
> words, an input form is displaying a record with a tab control on page 2. In
> v12 when I click the next record button the next record displays with page 2
> of the tab control still active and highlighted. In v15 my tab control is
> reverting to page 1. Is this behavior the same for all or just me?
This is how it has always worked for me, so I think it is standard behavior.
You need to add some code to the “On Load” event in the Form Method. I’ll
outline how I handle this.
Project Method: PageTabControl
---------------------------------------------------------------------------
Case of
: (pageTabControl_l=1)
// do query or relate command to load related records for subforms on this
page
: (pageTabControl_l=2)
// do query or relate command to load related records for subforms on this
page
End case
FORM GOTO PAGE(pageTabControl_l)
Form Method:
---------------------------------------------------------------------------
Case of
: (Form event=On Load)
// handle first time displaying the form
If (pageTabControl_l=0)
pageTabControl_l:=1 // start on the first page
End if
End case
PageTabControl // call the method to setup everything needed for the currently
selected page/tab
So you set up the tab control to have a Standard Action of “No Action”. Then
you control switching pages using the PageTabControl method. When a user clicks
on a tab it sets pageTabControl_l to the page number on the form you need to
switch to.
4D does not reset the value of pageTabControl_l when the form is loaded if you
have the Standard Action for the tab control set to “No Action”. That allows
you to rely on the pageTabControl_l value when moving between records.
> Input form strangeness:
>
> Many-table records displayed in a subform are not automatically updating
> after record-change button click (next, previous, etc). The relations are
> automatic for simplicity. The subform operated as expected under v12. Oddly…
> after the next-record button click and record data changes but subform data
> does not, if I activate a different data object or click on a different tab
> of a tab control, the many-records subform data updates. Object methods
> contain nothing related to records, and, tracing shows nothing significant to
> generate the update of the subform.
I have not noticed this, but then again I would not see something like this
because I have code in my Tab Control Object Method that runs when you change
tabs to load any related records.
> I feel like I’m missing something obvious but I can't grok it so far... I’ve
> read everything pertinent (I think) from versions 13 to 15 and can not find
> anything that indicates functionality of subforms or relations or input forms
> have changed, such that, an input-form record-change-click no longer
> automatically updates related many-table records in a subform. I’ve
> re-instantiated the subform but no luck. This happens on a number of tables,
> many-to-one as well, multi-tab-controlled subforms too.
You may have run across a “feature” that older versions of 4D had and this
“feature” was removed from v15r5. Some would call that a “bug” in v15r5. It
really doesn’t matter if it is a feature change or a bug, that’s how it works
in v15r5. So if you want to use v15r5 then you will need to add a bit of code
to your Form Method and to the Tab Control Object Method to make it work the
way you want it to work.
What’s that old saying… if you’re given lemons, just make some lemonade. :)+
Tim
********************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
********************************************
**********************************************************************
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:[email protected]
**********************************************************************