Populating List box

 1 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
jerome
New Member
Posts: 4
New Member
    I am trying to populate a list box with a dme query. Does anyone have an example of how to do this ? I am also interested in some sort of reference guide if there is such a thing.
    Thanks Jerome
    jerome
    New Member
    Posts: 4
    New Member
      Ok I got my dropdown to populate from a custom file setup in Lawson. I modified the AP20 screen to add a dropdown on the account detail line. There are 5 detail lines so I had to create a loop to populate the dropdown for each row. Here is the code I used.

      function FORM_OnInit()

      {

      var DMEstring = "/cgi-lawson/dme.exe?PROD=LAWAPP8&FILE=SXMCHG&FIELD=CHGCODE;CHGDESC;&XCOLS=TRUE&XKEYS=TRUE&XRELS=TRUE&XCOUNT=TRUE&XIDA=TRUE&XNEXT=TRUE&OUT=XML";
      var DMEinfo = top.httpRequest(DMEstring);

      if (DMEinfo.status)
      {
      alert(DMEinfo.status);
      return;
      }
      var vOBJDMEXML = new top.DataStorage(DMEinfo);
      var vRecords = vOBJDMEXML.document.getElementsByTagName("RECORD");
      if (vRecords.length ==0)
      {
      alert("No Records Exist");
      return true;
      }

      var k;
      var i;

      // get misc charge list
      var miscList0 = document.getElementById("VALUES_f241r0");
      var miscList1 = document.getElementById("VALUES_f241r1");
      var miscList2 = document.getElementById("VALUES_f241r2");
      var miscList3 = document.getElementById("VALUES_f241r3");
      var miscList4 = document.getElementById("VALUES_f241r4");

      for (k=0;k<5;k++)
      {


      for (i=0;i {
      var vCols=vRecords[i].getElementsByTagName("COL");
      var span = document.createElement("span");
      span.setAttribute("text", vCols[1].firstChild.data); // long description
      span.setAttribute("tran", vCols[0].firstChild.data); // transaction value
      span.setAttribute("disp", vCols[0].firstChild.data); // display value
      eval("miscList"+k).appendChild(span);
      }
      }