10.2B04: GUI Messagebox (ABL or .NET) is changing the actual

Posted by Stefan Marquardt on 14-Jun-2011 04:39

Hello,

this is a code within our ABL.NET (GUI for .NET) application:

find

last ttReceiptRow no-lock no-error.

iReceiptPosition = ttReceiptRow.Position + 1.

create ttReceiptRow.

assign

ttReceiptRow.Receipt_obj = ttReceipt.Receipt_obj

ttReceiptRow.ReceiptRow_obj = guid

ttReceiptRow.Position = iReceiptPosition

ttReceiptRow.Type = ReceiptRowTypeEnum:Pay

.

message "a" ttReceiptRow.Type

view-as alert-box.

message "a1" ttReceiptRow.Type

view-as alert-box.

(ReceiptRowTypeEnum:Pay = 1)

Result:

"a" 1

"a1" 0

I tried to find what changes the buffer from one line to another and set an breakpoint at message "a" ...

Result:

"a" 0

"a1" 0

With the attached debugger i get the wrong value at the first messagsbox.

Then i set a breakpoint at create ttReceiptRow to see what happens from create to message "a1".

Result:

"a" 1

"a1" 1

With attached debugger and set the breakpoint at create the code is running as expected!

Looks like a timing trouble?!?!

The temp-table is within a dataset which has a query on it bound to a DataSource/DataGridView Control.

This control is the only thing that can reposition the buffer ttReceiptRow, but with debugger i should see this ?!?

In this example, i use the "message" but it happens the same when using .NET MessageBox.

Before creating the new ttReceiptRow there is a method which deletes a few ttReceiptRow records and opens the query to refresh the DataSource of DataGridView.

I noticed the the first row in the Grid is selected and this is the buffer value with Type = 0.

I am thinking about opening a WR at PSC because i don't know what is running wrong, any suggestions?

Stefan

All Replies

Posted by Admin on 14-Jun-2011 04:49

I am thinking about opening a WR at PSC because i don't know what is running wrong, any suggestions?

 

I'd say that's the way to proceed in issues like that.

Posted by Stefan Marquardt on 14-Jun-2011 07:04

I did ...

this is the trace between the 2 message boxes:

[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE a 1
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE ** ABL Debug-Alert Stack Trace **
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE --> AddPay prohibisCash.Services.Receipt.ReceiptService (C:\workspace_prohibisCash\Kasse\prohibisCash\Services\Receipt\ReceiptService.r) at line 3205
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     HandleButton prohibisCash.Controller.ButtonPressHandler.PayCash (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\ButtonPressHandler\PayCash.r) at line 84
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     ButtonPressHandler prohibisCash.Controller.CashController (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\CashController.r) at line 1609
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     OnKeyPressHandler prohibisCash.Controller.CashController (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\CashController.r) at line 1088
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     ButtonClickHandler prohibisCash.UserInterface.Controls.NumBlockControl (C:\workspace_prohibisCash\Kasse\prohibisCash\UserInterface\Controls\NumBlockControl.r) at line 204
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     Launch prohibisCash.Controller.CashController (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\CashController.r) at line 626
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     C:\workspace_prohibisCash\Kasse\prohibisCash\cash.p (C:\workspace_prohibisCash\Kasse\prohibisCash\cash.r) at line 27
[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL PROEVENTS  START GUI WM_ENABLE WINDOW  Handle:1000 prohibisCash.Services.Receipt.ReceiptService
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL PROEVENTS  START GUI WM_ENABLE WINDOW  Handle:1000 prohibisCash.Services.Receipt.ReceiptService
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE a1 0
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE ** ABL Debug-Alert Stack Trace **
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE --> AddPay prohibisCash.Services.Receipt.ReceiptService (C:\workspace_prohibisCash\Kasse\prohibisCash\Services\Receipt\ReceiptService.r) at line 3208
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     HandleButton prohibisCash.Controller.ButtonPressHandler.PayCash (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\ButtonPressHandler\PayCash.r) at line 84
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     ButtonPressHandler prohibisCash.Controller.CashController (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\CashController.r) at line 1609
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     OnKeyPressHandler prohibisCash.Controller.CashController (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\CashController.r) at line 1088
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     ButtonClickHandler prohibisCash.UserInterface.Controls.NumBlockControl (C:\workspace_prohibisCash\Kasse\prohibisCash\UserInterface\Controls\NumBlockControl.r) at line 204
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     Launch prohibisCash.Controller.CashController (C:\workspace_prohibisCash\Kasse\prohibisCash\Controller\CashController.r) at line 626
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL 4GLMESSAGE     C:\workspace_prohibisCash\Kasse\prohibisCash\cash.p (C:\workspace_prohibisCash\Kasse\prohibisCash\cash.r) at line 27


The problem is this:

[11/06/14@13:53:37.593+0200] P-004428 T-003652 2 4GL PROEVENTS  START GUI WM_ENABLE WINDOW  Handle:1000 prohibisCash.Services.Receipt.ReceiptService
[11/06/14@13:53:38.467+0200] P-004428 T-003652 2 4GL PROEVENTS  START GUI WM_ENABLE WINDOW  Handle:1000 prohibisCash.Services.Receipt.ReceiptService

This is the only thing that happens i can see.

Posted by Admin on 14-Jun-2011 07:09

This is the only thing that happens i can see.

Anything in the 4GLTrace? An ENTRY Trigger, a LEAVE Trigger?

Posted by Stefan Marquardt on 14-Jun-2011 07:16

mikefe schrieb:

This is the only thing that happens i can see.

Anything in the 4GLTrace? An ENTRY Trigger, a LEAVE Trigger?

Mike, this is from the 4GL Trace and that's all between the two messages ...

Posted by Admin on 15-Jun-2011 00:13

I a ProBindingSource attached to the same buffer (or a query using that buffer)?

In that case I've seen something like that, probably because the Grid did react on the Focus change caused by the message. We've solved these issues in our framework by using alternative buffers and reducing the scope of buffers etc.

Posted by Stefan Marquardt on 15-Jun-2011 01:01

I a ProBindingSource attached to the same buffer (or a query using that buffer)?

In that case I've seen something like that, probably because the Grid did react on the Focus change caused by the message. We've solved these issues in our framework by using alternative buffers and reducing the scope of buffers etc.


Yes, we do use the same buffer for delete and updates but not for searching in this data.

We had other problem as we used buffer for doing this.

I am sure that the DataGridView does the repositioning too late after deleting records. The next method creates a record, shows a message and then the grid does it's "job".
This changes the buffer from one message to the other ...

This thread is closed