I have two sets of forms identical in construction – a custom controller and a main form which holds a two-tab tab panel. One tab is in record view, the other in table. The custom controller has first, previous, next and last record navigation buttons. One set works perfectly throughout, the other works for first, previous and next, but not last.
Coding for the “last” button is identical in both sets, yet works in one and not in the other.
This code for a “first” button works:
var tp = forms.peopleMain.elements.tabs_70.tabIndex;
if (tp == 1)
{
forms.peoDetails.controller.setSelectedIndex(1);
}
if (tp == 2)
{
forms.peoTable.controller.setSelectedIndex(1);
}
And so does this for a “last” button:
var tp = forms.companyMain.elements.tabs_70.tabIndex;
if (tp == 1)
{
forms.comDetails.setSelectedIndex(currentcontroller.getMaxRecordIndex());
}
if (tp == 2)
{
forms.comTable.setSelectedIndex(currentcontroller.getMaxRecordIndex());
}
But with this “last” button routine it goes to the right place but the setSelectedIndex function doesn’t execute:
var tp = forms.peopleMain.elements.tabs_70.tabIndex;
if (tp == 1)
{
forms.peoDetails.setSelectedIndex(currentcontroller.getMaxRecordIndex());
}
if (tp == 2)
{
forms.peoTable.setSelectedIndex(currentcontroller.getMaxRecordIndex());
}
The cause is likely something simple, something overlooked. I’ve spent hours pouring over this puzzle and am getting nowhere. Can anyone suggest a method to debug this?