Solved TD-23945 (regression 7.0.4), new: TD-24495: wrong context row when calling SalTblDeleteRow() and SalGridApplyState()

Report bugs and possible workarounds.
Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 130
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

TD-23945 (regression 7.0.4), new: TD-24495: wrong context row when calling SalTblDeleteRow() and SalGridApplyState()

Post by Uwe van der Horst » 15 Feb 2018, 14:10

We have found a mayor problem with 7.0.4. In some cases we are filling Grids in the follwing way (columns as bind variables):

Call SqlPrepareAndExecute( hSql, 'select x, y into :col1, :col2 from z' )
Call SalTblSetContext( hWndForm, SalTblInsertRow( hWndForm, TBL_MaxRow ) )
While SqlFetchNext( hSql, nDummy )
...Call SalTblSetContext( hWndForm, SalTblInsertRow( hWndForm, TBL_MaxRow ) )
Call SalTblDeleteRow( hWndForm, SalTblQueryContext( hWndForm ), TBL_MaxRow )

Logically after processing the While SqlFetchNext... we have to delete the last row because it is empty. Here is the regression:

With TD 7.0.3 and all previous versions after calling SalTblDeleteRow() the context row is "TBL_Error". This is the expected behaviour.
With TD 7.0.4 after calling SalTblDeleteRow() the context row is "row 0". This can cause some heavy unwanted effects.

I have attached a test case that shows the probem. Extract the .zip and run the .exe (not the .apt). With the cdlli70.dll (version 7.0.4) the context row is 0 (wrong). With the cdlli70.dll (version 7.0.3) the context row is TBL_Error (ok).

I will make a support case.
SalTblDeleteRowGivesWrongContextRow.zip
You do not have the required permissions to view the files attached to this post.
Best regards,
Uwe van der Horst
Advo-web GmbH

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1292
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

7.0.4: incorrect context row 0 after calling SalTblDeleteRow()

Post by Dave Rabelink » 16 Feb 2018, 06:18

I can confirm this, Uwe.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 130
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

7.0.4: incorrect context row 0 after calling SalTblDeleteRow()

Post by Uwe van der Horst » 22 Feb 2018, 10:16

The bug number is TD-23945.
Best regards,
Uwe van der Horst
Advo-web GmbH

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 130
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

TD-23945 (regression 7.0.4): incorrect context row 0 after calling SalTblDeleteRow()

Post by Uwe van der Horst » 12 Jul 2018, 18:32

This bug is fixed in TD 7.05 and 7.1.
Best regards,
Uwe van der Horst
Advo-web GmbH

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 130
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: TD-23945 (regression 7.0.4), new: TD-24495: wrong context row when calling SalTblDeleteRow() and SalGridApplyState()

Post by Uwe van der Horst » 04 May 2019, 08:41

The issue is partially back in 7.1.2 (not checked with 7.1.1). When filling the grid from outside the behaviour is different from filling the grid from inside of the grid.

no problems here:
On SAM_CreateComplete
... fFillGrid()
Here when calling SalGridApplyState() the grid might be sorted, but row 0 has the context.

different behaviour:
Call SalCreateWindow( grid1, hWndMDI)
Call grid1.fFillGrid()
Here when calling SalGridApplyState() the grid might be sorted and then we have a row somewhere in the middle of the grid that has the context (= "row 0" BEFORE calling SalGridApplyState).
Maybe customer does not notice and marks multiple rows by holding ctrl. Then we have one more line selected. Think about attached documents with secret information that customer sends to a person via E-Mail...

The new number is TD-24495, fix is requested for the 7.1.3 release.
You do not have the required permissions to view the files attached to this post.
Best regards,
Uwe van der Horst
Advo-web GmbH

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 130
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: TD-23945 (regression 7.0.4), new: TD-24495: wrong context row when calling SalTblDeleteRow() and SalGridApplyState()

Post by Uwe van der Horst » 14 Jun 2019, 15:02

This is fixed in TD 7.1.3 and 7.2 Beta.
Best regards,
Uwe van der Horst
Advo-web GmbH

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 0 guests