The callback is used to add the selected cell to another uitable in the same uifigure yet it is behaviour changes, it most of the time makes double callbacks and it sometimes only single which the correct behaviour required.
Is any settings that can be looked at. Recently there was an upgrade from R2018b to R2019a which has more features and behaviour especially to the tables.
Any solutions?
I have tried debugging using the Editor and disp() displaying output, double callbacks where occurring.
%%%% Else where in the code, for ref with question
app.table.CellSelectionCallback = @(src, event)ItemSelected_Callback(app, event);
% add the selected item to the selection table;
% enable edit and remove buttons if there was no item before
% (if there was a item before, the buttons are already enabled)
function ItemSelected_Callback(app, event)
disp(event.Indices);
row = event.Indices(1, 1);
[n, ~] = size(app.Selection_table.Data);
data = cell(n+1, 1);
for c = 1:n
data{c} = app.Selection_table.Data{c};
end
data{n+1} = char(AddItem.genItemcode(app.table.Data{row, 2}, app.table.Data{row, 3}, app.table.Data{row, 4}, app.table.Data{row, 5}, app.table.Data{row, 6}, app.table.Data{row, 7}, app.table.Data{row, 8}, app.table.Data{row, 9}, app.table.Data{row, 10}, app.table.Data{row, 11}, app.table.Data{row, 12}, app.table.Data{row, 13}, app.table.Data{row, 14}, app.table.Data{row, 15}, app.Fluid_DropDown.Value, app.dbConn));
app.Selection_table.Data = data;
if app.selectionLine < 1
app.remove_button.Enable = 'on';
app.edit_button.Enable = 'on';
app.selectionLine = 1;
end
end
Expected: single callback and therefore single entry into the second table.
This may have a bug in R2019a as R2019b resolves it.