Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 4 Jahren, 9 Monaten
Letzter Beitrag:
vor 4 Jahren, 9 Monaten
Beteiligte Autoren:
Alexander WinDev, Piet van Zanten, steve erts, Pragma Tix, Fabrice Harari, ICI

taCurrentRecord works as taInit always

Startbeitrag von Alexander WinDev am 29.03.2013 13:29

I have a table control based on complex query (3 joined tables). 14000 records in it
Table..Value is ID of one of the tables.
There is a form for edit this table, and button to call this form.

Button has a code like follow:

ID = MyTable
HReadSeekFirst(sqltable, IDField, ID)

if Open(myForm) then
TableDisplay(MyTable, taCurrentRecord)
If MyTableID then
MyTable = ID
End
End

The problems:

TableDisplay(MyTable, taCurrentRecord) works IDENTICALLY as TableDisplay(MyTable, taInit). And always positioned to 1st record of table.

Where I'm wrong? Where the problem can be?

How can return after edit to the same position of the table?

TableSavePosition... and TableRestoreposition... also works wrong (shift position 1-10 records up or down).

Antworten:

Hello Alexander

I'm not sure where you are wrong BUT...

You are opening a form on one of the record, but we don't know whya you are doing in it...
If you are modifying the record directly in the file, then the content of the query is stale and you should reexecute it anyway...

If you are modifing inside the query, then that may be be the reason why the table and the query are desynchrnonised...

Best regards

von Fabrice Harari - am 29.03.2013 13:43
Hi Alex,
try taReExecuteQuery instead of taInit.
...and take care about the current sort order..
This should do the trick..HTH,

#pragma

von Pragma Tix - am 29.03.2013 19:53
Hi Alexander,

If you , after you back to the table control, you want to refresh current record on table and refresh context you just need to call TableDisplay(MyTable, tacurrentfirst)

Regards !

von ICI - am 30.03.2013 09:33
You might want to try using

TableSavePositionAndSelection

and TableRestorePositionAndSelection

http://doc.pcsoft.fr/en-US/?1000017412&name=tablesavepositionandselection_function&q=TableSavePositionAndSelection%20can

von steve erts - am 01.04.2013 18:10
Thanx all,
but problem still there...

After a set of experiments I found: all times after first TableDisplay(MyTable, taCurrentRecord) works correctly. Even i'd change record again and again. No undesired scrolling, no taInit.

It means: there is some internal buffer that desynchronized when i select record and synchronized while first table refresh. Are there other ways to make this synchonyzation? (Instead of TableDisplay)

von Alexander WinDev - am 09.04.2013 17:49
Hi Alexander,

As you are not able to modify a 3-file query I'm assuming you modify the record directly in the file.
As Fabrice stated, then you should re-execute the query, because it does not reflect the changes you made in the file.
And if you re-execute the query the current record changes.

Another option might be to use a memory table and use tablemodify after you modified the record.

Regards,
Piet

von Piet van Zanten - am 10.04.2013 06:20
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.