BUG with itemmarked in DCBROWSE?

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

BUG with itemmarked in DCBROWSE?

#1 Post by skiman »

Hi Roger,

I think there is a bug in dcbrowse concerning the ITEMMARKED codeblock, it is NOT always fired!

I have a database browse with documents. There are three buttons with 'Show orders', 'Show delivery notes' and 'Show invoices'.

At startup the invoices are shown. There is a setscope, the invoices appears, I do a gobottom so the last line is selected AND the itemmarked is fired.

Now I click the button to show the orders. This is what happens in my code:
- dc_setscope
- oBrowse:gobottom()
- oBrowse:forceStable()

The orders are shown, and the last record is selected. However the ITEMMARKED is NOT fired. When I select this line with a single click OR a double click, the ITEMMARKED is not fired.

This way the ITEMSELECTED codeblock is started, without the ITEMMARKED. This can have unpredictable results according to the use of the codeblock.

I would prefer there is a parameter for the DCBROWSE that the ITEMMARKED is fired each time there happens something with the browse.

I also have the following situation.
- PC1: Line with invoice is selected in a browse, and the itemmarked is fired. The browse stays on the screen.
- PC2: Someone changes something in this invoice.
- PC1: Select the same line with a single click. The ITEMMARKED isn't fired. In some cases I would prefer to have the possibility to force this.

I can't find in the sources where there is a check if the eval(itemmarked) has to be executed or not. I hoped I could find something as oBrowse:lFireItemmarked := .T. to force this.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: BUG with itemmarked in DCBROWSE?

#2 Post by rdonnay »

Chris -

I usually do a :refreshAll() after a :forceStable().
I think that this will generate the xbeBRW_itemMarked event.

You can also do it this way:

Code: Select all

- dc_setscope
- oBrowse:gobottom()
- oBrowse:forceStable()
PostAppEvent(xbeBRW_ItemMarked,,,oBrowse)
Roger
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: BUG with itemmarked in DCBROWSE?

#3 Post by jdsoft »

Hello,

I use the oBrowse:StableBlock callback slot. Works like a charm.

Code: Select all

LOCAL bMemo          := {||cMemo := DC_GetColArray(10,oBrowse), Dc_GetRefresh(GetList,,,,"PERM")}

@ nLine, 2  DCBROWSE oBrowse DATA oDb:oPermanent:aDetails SIZE 80,4.5 NOHSCROLL ;
            CURSORMODE XBPBRW_CURSOR_ROW FIT;
            EVAL {|o|o:stableBlock := bMemo} POINTER nPointer 
Regards,
Jack Duijf
Regards,
Jack Duijf

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: BUG with itemmarked in DCBROWSE?

#4 Post by skiman »

Hi Roger, Jack,

I will try the postappevent,this should work.

I wasn't aware about the existence of the :stableblock. I will check this.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: BUG with itemmarked in DCBROWSE?

#5 Post by skiman »

rdonnay wrote: I usually do a :refreshAll() after a :forceStable().
I think that this will generate the xbeBRW_itemMarked event.
No, the itemmarked isn't fired.
rdonnay wrote: You can also do it this way:

Code: Select all

- dc_setscope
- oBrowse:gobottom()
- oBrowse:forceStable()
PostAppEvent(xbeBRW_ItemMarked,,,oBrowse)
Seems as this isn't doing anything at all. It doesn't fire the event as expected.
I added the following to check

Code: Select all

PostAppEvent(xbeBRW_ItemMarked,,,oBrowse)
wtf 'postevent'
I see it is executed, but the 'wtf' from the itemmarked isn't shown.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: BUG with itemmarked in DCBROWSE?

#6 Post by skiman »

jdsoft wrote: I use the oBrowse:StableBlock callback slot. Works like a charm.

Code: Select all

LOCAL bMemo          := {||cMemo := DC_GetColArray(10,oBrowse), Dc_GetRefresh(GetList,,,,"PERM")}

@ nLine, 2  DCBROWSE oBrowse DATA oDb:oPermanent:aDetails SIZE 80,4.5 NOHSCROLL ;
            CURSORMODE XBPBRW_CURSOR_ROW FIT;
            EVAL {|o|o:stableBlock := bMemo} POINTER nPointer 
Hi Jack,

The stableblock is always executed. Seems as this is the most reliable to work with.
Best regards,

Chris.
www.aboservice.be

Post Reply