Table Box Page Up and Down

Toddy_BoyToddy_Boy Member Posts: 231
Is there an easy way (I'm guessing not) of getting Navision to page up and down the entries on a table box by clicking aPage Up and Down buttons, this will have the same effect as clicking the slide bar so the current bottom row of the table box moves to the top and the rows underneath are refreshed.

Cheers
Life is for enjoying ... if you find yourself frowning you're doing something wrong

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    :?:
    This should just work.
    My page up and down buttons do what you describe.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Toddy_BoyToddy_Boy Member Posts: 231
    what do i have to assign to a button to make it page up and down? there's nothing obvious in the onPush event.
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • tinoruijstinoruijs Member Posts: 1,226
    Ok. Now I understand you. You want to click on new button which simulates page up and a new button which simulates page down. Right?

    Just Curious; why?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Toddy_BoyToddy_Boy Member Posts: 231
    Your assumption is correct. Our client has touch screen terminals, so when presented with a list of records they would like to click a nice big page up and page down button rather than trying to click on the slide bar.
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • garakgarak Member Posts: 3,263
    Make a new MenuButton.

    1. Up (Ctrl+U)
    2. down (Ctrl+D)

    behind 1. type follwing in OnPush() Trigger
    if next(-20) = 0 then;
    

    behind 2. type follwing in OnPush() Trigger
    if next(20) = 0 then;
    

    Regards
    Do you make it right, it works too!
  • Toddy_BoyToddy_Boy Member Posts: 231
    Hi garak

    I like that solution =D>

    however, how do I know how many rows are visible? if there are 20 rows visible as in your example then all well and good, but if the user has the screen resized then the paging isn't quite right. :-k
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • garakgarak Member Posts: 3,263
    Tja, thats the problem ;-)
    Do you make it right, it works too!
  • kinekine Member Posts: 12,562
    You can use SendKeys to send the PgUp PgDown keypress when you press the button... :mrgreen:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    ever i say: people use sendkeys and wsh, but here i've forgotten the sendkey option ](*,)

    here the source
    Variable:
    Name	DataType	Subtype	Length
    WSHShell	Automation	'Windows Script Host Object Model'.WshShell	
    
    if isclear(WSHShell) then
      create(WSHShell);
    
    WSHShell.SendKeys('{PGDN}'); //{PGUP}
    

    Regards :oops:
    Do you make it right, it works too!
  • Toddy_BoyToddy_Boy Member Posts: 231
    Guys well done and thanks that works well =D> Had a few problems with PgDown until I used the correct syntax.

    However, the table box doesn't seem to refresh properly. When I click on a row after I have paged the details on the row change. I am using a temp table for this card so could the real records and the temp records become out of step after paging?
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • Toddy_BoyToddy_Boy Member Posts: 231
    A bit of a mistake, the table is not temp table, which makes the reason why the records are not refreshing properly a little curious. #-o
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • DaveTDaveT Member Posts: 1,039
    Hi,

    Have you tried putting in a currform.update(FALSE); to refresh the screen ?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.