Hello Roger,
i try to get rid of some temporary DBF-Files, which i used for do some editing.
So i try to use dataobjects for that.
I changed my browsing successful (in the attached sample aLeist is the Array with objects, see Tabpage 3)
Now i try to edit the different objects (Tabpage 2).
My problem is, that the DCGET vars are not refreshed, when i change between the positions (Next Pos, Last Pos buttons or on Tabpage 3 the Browse ItemSelected).
I see the positions right changing (Pos xx of yy) but the GETS are always showing the content of the first object.
Can you please show me, what i am doing wrong or what is missing ?
The sample is attached.
Thank you.
Best regards and greetings from Berlin
Wolfgang
Browsing and edit dataobjects
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Browsing and edit dataobjects
- Attachments
-
- ForRoger.zip
- (294.7 KiB) Downloaded 352 times
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Browsing and edit dataobjects
Wolfgang -
Do not create a new record object every time you move the TP record pointer.
Instead, simply use DC_DbScatter() to load the new data into the existing record object.
This is due to the fact that your DCGET objects are bound to the original record object.
Here is modified code:
http://bb.donnay-software.com/ciriack/test.zip
Do not create a new record object every time you move the TP record pointer.
Instead, simply use DC_DbScatter() to load the new data into the existing record object.
This is due to the fact that your DCGET objects are bound to the original record object.
Code: Select all
;// ACTION {|| oLstRec := TxtNextPos(oLstRec), DC_GetRefresh(Getlist), SetAppFocus(oAnr)} ;
ACTION {|| TxtNextPos(oLstRec), DC_GetRefresh(Getlist), SetAppFocus(oAnr)} ;
Static Function TxtNewPos(oRec)
// LOCAL oRec
if nPosLeist > Len(aLeist)
// oRec := tp->(DC_DbRecord():New())
// tp->(DbGoBottom())
// tp->(DbSkip())
tp->(dbGoto(0))
tp->(DC_DbScatter(oRec))
AAdd(aLeist, {oRec, 0, .T.})
oRec:Pos := Len(aLeist)
oRec:KundNum := oTERec:KundNum
oRec:Name1 := oTERec:Name1
oRec:LfDat := oTERec:TxtDat
nGesPos := Len(aLeist)
nPosLeist := Len(aLeist)
else
tp->(DC_DbScatter(oRec))
// oRec := aLeist[nPosLeist, 1]
endif
return (oRec)
http://bb.donnay-software.com/ciriack/test.zip
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Browsing and edit dataobjects
Hello Roger,
sorry, but that does not work for me.
I load all existing records in aLeist and only want to edit these different dataobjects of aLeist.
Only if there is a additional object, i add an (empty) object to aLeist for editing.
If then all is done i will write these objects back to the database (or if aLeist[n, 2] is 0, then add this as a new record).
Is there no possibilty, to set the content of the GETS to the different objects in aLeist ?
Your DC_DbScatter loads the content from the database, i like to load the content from aLeist.
sorry, but that does not work for me.
I load all existing records in aLeist and only want to edit these different dataobjects of aLeist.
Only if there is a additional object, i add an (empty) object to aLeist for editing.
If then all is done i will write these objects back to the database (or if aLeist[n, 2] is 0, then add this as a new record).
Is there no possibilty, to set the content of the GETS to the different objects in aLeist ?
Your DC_DbScatter loads the content from the database, i like to load the content from aLeist.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Browsing and edit dataobjects
Regardless of how you do it, you still must use the original pointer to the DCGET record object if you want DC_GetRefresh() to refresh the data.
Otherwise, you will need to pass down a pointer to the DCGET object itself and use oGet:_assign(oNewRecordObject).
Otherwise, you will need to pass down a pointer to the DCGET object itself and use oGet:_assign(oNewRecordObject).
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Browsing and edit dataobjects
Thank you Roger,
i will redesign my concept.
i will redesign my concept.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang