How to display all devices into a table in a subpage.

marcussulicmarcussulic Member Posts: 15
edited 2016-08-17 in NAV Three Tier
Hello community.
I know its probably a very basic topic but even a key word to look for or where to look in the documentation would help.
I am very new at coding and NAV overall so sorry for my shitty code.

I use POS for .NET to show text on my display. To make it possible I used:
FOR  i := 1 TO 21 DO BEGIN
  PosDeviceInfo := PosDeviceCollection.Item(i);
  MESSAGE(STRSUBSTNO('%1 is %2',i,PosDeviceInfo.ToString));
to locate what Item(int) my target device (Line Display) has.

But right now I would like display all pos devices from 1 to 21 in a list that I added in a subpage which references to a table with 2 Columns: Device ID, Name
u07qvacf7wpc.png

And I really have no clue where to start it so that it gets displayed. Is it even possible? Where do I even code this? In my "Test Display" Page, in the subpage where I attached the table "Device Collection Sub", or in my newly created table "Device Collection".


Heres my code that im using to show some text on the display. Ive got it in my "Test Display" Page in Page Actions. It's all working, I just want to display every device on the list in the bottom part of the image.
Instantiation - OnAction()
PosExplorer := PosExplorer.PosExplorer;
PosDeviceCollection := PosExplorer.GetDevices();
PosDeviceInfo := PosDeviceCollection.Item(DeviceID);
PosLineDisplay := PosExplorer.CreateInstance(PosDeviceInfo);

Claim Display - OnAction()
PosDeviceType := PosDeviceType;
//IF NOT PosLineDisplay.Claimed THEN BEGIN
  PosLineDisplay.Open();
  PosLineDisplay.Claim(10000);
  PosLineDisplay.DeviceEnabled(TRUE);
  PosLineDisplay.ClearText();
//END;


Release Display - OnAction()

Show Text - OnAction()
PosLineDisplay.ClearText();
PosLineDisplay.DisplayTextAt(0,0,AnzeigeText1);
PosLineDisplay.DisplayTextAt(1,0,AnzeigeText2);

Show Devices - OnAction()
PosDeviceCollection := PosExplorer.GetDevices();

FOR  i := 1 TO 21 DO BEGIN
  PosDeviceInfo := PosDeviceCollection.Item(i);
  MESSAGE(STRSUBSTNO('%1 is %2',i,PosDeviceInfo.ToString));
  //PosDeviceInfo.HardwareId
  //PosDeviceInfo.ServiceObjectName
END;

I somehow need the last 2 Lines (Parameters) to show in the table for all 21 Devices. Hopefully it is possible.
//PosDeviceInfo.HardwareId
//PosDeviceInfo.ServiceObjectName

If you need any more screenshots or better explanation just ask away.

Answers

  • archer89archer89 Member Posts: 337
    check if you set page property SourceTable correct.
    compare your settings with page 46.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
Sign In or Register to comment.