PDA

View Full Version : CodeJock 13.6.1



Clive Richmond
12-Nov-2015, 11:35 AM
Programs compiled without a hitch.

Just wanted to know if 18.2 is compatible with CodeJock 13.6.1 before I starting digging? I am running into Grid issues with errors like that below after which any rows that were displayed 'vanish'.


D:\triumph6.0\triumph\programs\triumph.exe
selected col has no selected row

Error: 4402

Release: 6.0, Build Date: 9-Nov-2015, Rev.: 2

MSG_NEWCOLUMN (13262) - oSuppliers (1308) - at address 108445
GET_COLUMNCHANGE (13264) - oSuppliers (1308) - at address 108479
GET_MOVETOCOLUMNOBJECT (13295) - oSuppliers (1308) - at address 109391
MSG_MOVETOFIRSTENTERABLECOLUMN (13297) - oSuppliers (1308) - at address 109428
MSG_MOVEDOWNROW (12641) - oSuppliers (1308) - at address 109794
MSG_ONUNKNOWNAREACLICK (13247) - oSuppliers (1308) - at address 108248
MSG_ONCOMMOUSEUP (5554) - oSuppliers (1308) - at address 108076
[start] - at address 1115484

Stephen W. Meeley
12-Nov-2015, 11:43 AM
Hi Clive,

I'm not sure what you are trying to do here. DataFlex 18.2 uses the CJ 16.4.0 components supplied in Bin. Our package files are generated based on that version.

DaveR
12-Nov-2015, 11:56 AM
I imagine Clive has Codejock controls other than those built-in to DF, I do, and as the UKSIG hasn't yet released their 16.4 packages, he's probably winging it like I am.

Stephen W. Meeley
12-Nov-2015, 12:01 PM
Dave,

I didn't want to assume that scenario. He mentions running into grid problems but didn't specify if they are our grids (which will only use the 16.4.0 components) or grids supplied by the SIG (in which case the question is really for them, not us).

Clive Richmond
12-Nov-2015, 12:14 PM
Hi Dave,


I imagine Clive has Codejock controls other than those built-in to DF, I do, and as the UKSIG hasn't yet released their 16.4 packages, he's probably winging it like I am.

Nothing that fancy :p

DaveR
12-Nov-2015, 12:14 PM
Dave,

I didn't want to assume that scenario. He mentions running into grid problems but didn't specify if they are our grids (which will only use the 16.4.0 components) or grids supplied by the SIG (in which case the question is really for them, not us).

Fair enough. It's early days with testing for me and I haven't found a CJ issue yet but with the mix of 16.4 and 16.3.1 I'm expecting them.

DaveR
12-Nov-2015, 12:15 PM
Hi Dave,



Nothing that fancy :p

suitably chastened, I'll go to lunch.....

Stephen W. Meeley
12-Nov-2015, 12:19 PM
Clive,

So what are you doing to get this? Our packages will only use the components they are generated from. I'm still confused :confused:

ivansc
12-Nov-2015, 04:39 PM
Clive,

So what are you doing to get this? Our packages will only use the components they are generated from. I'm still confused :confused:

when I scroll with the wheel mouse I received the same error:
9432
regards
Ivan

ivansc
12-Nov-2015, 04:58 PM
I see I have a OnWmMouseWheel event that worked ok until 18.1 and now something has been broken. I need to investigate what is.

Clive Richmond
12-Nov-2015, 07:30 PM
Stephen,

I have a pretty good idea what's causing this. I'll report back once I get a chance to test my hypothesis.

Nils G. Svedmyr
13-Nov-2015, 03:34 AM
Hi All,

Since this thread seems to describe a new bug with cDbCJGrid in 18.2 I can testify to that as well.

And it is very easy to reproduce. Watch this video; all I do after finding Order # 2211 is to click in the grid and press the down arrow. Suddenly you will see that - as described by Clive - that rows start to disappear. And when reaching below the last line you will get the error stack.

http://www.screencast.com/t/IGrOUygAG

Hope this helps.

Clive Richmond
13-Nov-2015, 05:17 AM
Stephen,

Change that from:


I have a pretty good idea what's causing this.

to


I have no idea what's causing this.

:(.

My original hunch was I had forgotten copy across the new 16.4 .ocx files plus update the application's manifest files accordingly.

It's actually pretty simple to get the order entry sample to break. Find the first order, click on the last item (MENU) and the down arrow. As you do the last row disappears from grid until the error pop ups as shown below.

9438

Clive Richmond
13-Nov-2015, 05:19 AM
Hi Nils,

Posted before reading yours but ditto.

Stephen W. Meeley
13-Nov-2015, 06:10 AM
Clive,

I see it. We'll check it out.

Garret Mott
13-Nov-2015, 07:19 AM
There is another thread on this that does not mention anything about different CJ versions. http://support.dataaccess.com/Forums/showthread.php?57639-Grids-not-working-correctly

I can confirm that the 18.2 grid does this with no CJ stuff installed other than the DAW supplied pieces. Happens in OE as well as all my apps.

Stephen W. Meeley
13-Nov-2015, 07:55 AM
Garret,

Yes, the mention of differing CJ versions was a red herring. We've confirmed the behavior and are looking inot the cause.

John Tuohy
13-Nov-2015, 04:32 PM
Sorry about that. This was a side-effect from a last minute bug fix (which didn't even make it in the fixed list) reported by Tom Aravich on the forum.

Bug 6999: In cDbCJGrids if a saved record is constraint invalid the record is not removed from the cache and is displayed

We will repair this next build. In the meantime, you can workaround this and undo the fix by adding this to your code:


Function SaveSelectedRow for cDbCJGrid Returns Boolean
Boolean bRet
Forward Get SaveSelectedRow to bRet
End_Function


Just remember to remove it when you get the next beta.

-John

Garret Mott
13-Nov-2015, 04:59 PM
Thank you John!

I have applied it & it works fine in my initial tests.

Interestingly enough, adding it to my subclass (without the "for cDBCJGrid") did not work. I added to a pkg file that all exe's use & it works.

ivansc
13-Nov-2015, 05:20 PM
... adding this to your code:

Function SaveSelectedRow for cDbCJGrid Returns Boolean
Boolean bRet
Forward Get SaveSelectedRow to bRet
End_Function

Just remember to remove it when you get the next beta.
-John
Thanks John,
Now works again.
I removed the SaveSelectedRow in the original cDbCJGrid, your next beta will override that.
best regards
Ivan

John Tuohy
13-Nov-2015, 06:12 PM
The fix that wasn't quite right was in SaveSelectedRow in cDbCJGrid, so this workaround replaces that code and makes it work the way it did in 18.1. This is why you cannot just add this to your class layer. The actual change in cDbCJGrid will be:


{ NoDoc=True }
Function SaveSelectedRow Returns Boolean
RowID riRow
Integer iSel iFile
Boolean bValid bCancel bOldNRS bTest bSave
Handle hoDataSource hoServer
Get phoDataSource to hoDataSource
Get SelectedRow of hoDataSource to iSel

If (iSel<>-1) Begin
Get ShouldSaveSelectedRow of hoDataSource to bSave
If (not(bSave)) Begin
Function_Return False // nothing to do but that's ok
End
End

Forward Get SaveSelectedRow to bCancel
If not bCancel Begin
// this would only be false for compatibility sake. Having an invalid
// row after a save is going to cause problems
Get pbTestValidityAfterSave to bTest
If bTest Begin
// attempt to read record again. If it fails, it must be filtered.
Get Server to hoServer
Get Main_File of hoServer to iFile
Get CurrentRowId of hoServer to riRow
Get No_Relate_State of hoServer to bOldNRS
Set No_Relate_State of hoServer to True // no need to relate
// Use this instead of Validate_Constraints to handle SQL filtering as well
Get ReadByRowIdEx of hoServer iFile riRow to bValid
Set No_Relate_State of hoServer to bOldNRS
If not bValid Begin
Get SelectedRow of hoDataSource to iSel
If (iSel<>-1) Begin
// this removes the record from the grid (does not delete it)
Send RemoveRowAndSelect iSel
End
End
End
End
Function_Return bCancel
End_Function

This should fix the new error and fix the bug as intended. Tom's original report was that he was getting a grid cache error when a row was getting saved. What was happening was that saving the grid made the row constraint invalid. We've never handled this case so you'd end up with a row that did not belong. Usually this error corrects itself, so it was not noticed. In 18.1, we started reporting this as a refind error - and it was. This fix now checks if the saved row is no longer constraint valid. If it is not valid, it now removes it from the grid. This was a good improvement - just didn't quite get it right on the first attempt.

-John

Clive Richmond
13-Nov-2015, 09:46 PM
Thanks John. The replacement code for SaveSelectedRow has fixed the 'vanishing' row problem.

Martin
16-Nov-2015, 04:22 AM
Thanks fixed here too! :cool:

Stephen W. Meeley
21-Nov-2015, 09:29 AM
To all in this thread,

Beta 2 should address the grid issues discussed here. Please make sure to remove any workaround code you may have used.

Garret Mott
21-Nov-2015, 10:02 PM
I can confirm that the disappearing rows problem has gone away in Beta2 (& yes, I did remove the "fix").

Nils G. Svedmyr
22-Nov-2015, 05:11 AM
Thanks, it now works as it should!