Page 1 of 1

Browser event posting

Posted: Fri Sep 28, 2012 9:36 am
by c-tec
Hello,
to fill the browser with the scoped records, I post the event CTRL+PGDN to the browser object, but in my code it does not work. It is still only the last record displayed in the browser, so I have manually to skip up. The code for scoping in init_tab() is executed correct.
regards
Rudolf


// Tabpage with browse object
@ 0,0 DCTABPAGE aoTabPage[2] CAPTION 'MA Buchungen' RELATIVE aoTabPage[1] STATICAREA aoTabStatic[2] GOTFOCUS {||init_tab("STD",oBrowse2,getlist)}
...
// Browse
@ .1,.5 DCBROWSE oBrowse2 PARENT aoTabStatic[2] ALIAS "STD" SCOPE SIZE SIZE_X-18,SIZE_Y-6 CURSORMODE XBPBRW_CURSOR_ROW
...


static function init_tab(cCode,oBrowse,aGetlist)
******************************************************************
std->(setorder("MITARB")) //
std->(DC_SETSCOPE(0,pers->nummer))
std->(DC_SETSCOPE(1,pers->nummer))
std->(dc_dbgobottom())
setappfocus(oBrowse)
postappevent(xbeK_CTRL_PGDN,,,oBrowse)
return .t.

Re: Browser event posting

Posted: Fri Sep 28, 2012 10:14 am
by rdonnay
I don't understand why you would want to do a page down in the browse when the record pointer is already at the bottom.

What are you trying to acheive?

Re: Browser event posting

Posted: Fri Sep 28, 2012 10:47 am
by c-tec
Hello Roger,
attached are screenshots, one is when I go bottom, the otherone after I press CTRL and PGDN key. Ohterwise I have only one line in my browser, the last one of the scope.
regards
Rudolf

Re: Browser event posting

Posted: Fri Sep 28, 2012 1:15 pm
by rdonnay
Do this:

Code: Select all

@ .. DCBROWSE .. EVAL {|o|o:goBottom(),o:forceStable(),o:refreshAll()}

Re: Browser event posting

Posted: Fri Sep 28, 2012 1:38 pm
by Auge_Ohr
c-tec wrote:

Code: Select all

 postappevent(xbeK_CTRL_PGDN,,,oBrowse)
your Syntax is wrong, must be

Code: Select all

    Postappevent( xbeP_Keyboard ,;
                  xbeK_CTRL_PGDN,;
                                ,;
                          oBrowse)

Re: Browser event posting

Posted: Sun Sep 30, 2012 11:25 pm
by c-tec
Hello,
thank you all, works now, was my wrong syntax of postappevent()
regards
Rudolf