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.
BUG with itemmarked in DCBROWSE?
Re: BUG with itemmarked in DCBROWSE?
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:
Roger
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)
The eXpress train is coming - and it has more cars.
Re: BUG with itemmarked in DCBROWSE?
Hello,
I use the oBrowse:StableBlock callback slot. Works like a charm.
Regards,
Jack Duijf
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
Jack Duijf
Regards,
Jack Duijf
Jack Duijf
Re: BUG with itemmarked in DCBROWSE?
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.
I will try the postappevent,this should work.
I wasn't aware about the existence of the :stableblock. I will check this.
Re: BUG with itemmarked in DCBROWSE?
No, the itemmarked isn't fired.rdonnay wrote: I usually do a :refreshAll() after a :forceStable().
I think that this will generate the xbeBRW_itemMarked event.
Seems as this isn't doing anything at all. It doesn't fire the event as expected.rdonnay wrote: You can also do it this way:Code: Select all
- dc_setscope - oBrowse:gobottom() - oBrowse:forceStable() PostAppEvent(xbeBRW_ItemMarked,,,oBrowse)
I added the following to check
Code: Select all
PostAppEvent(xbeBRW_ItemMarked,,,oBrowse)
wtf 'postevent'
Re: BUG with itemmarked in DCBROWSE?
Hi Jack,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
The stableblock is always executed. Seems as this is the most reliable to work with.