PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11/21/2016 3:19 PM by  Bill Alt
Getting Error on ListBox
 35 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Bill Alt
Senior Technical Consultant
Private
Advanced Member
(71 points)
Advanced Member
Posts:25


Send Message:

--
11/14/2016 7:58 PM

    Unable to get property 'appendChild' of undefined or null reference error on listbox. Here is the code. 

    function FORM_OnAfterDataInit()
    {
    var strPDL = portalWnd.oUserProfile.getAttribute("productline"); 
    var s = "?PROD="+strPDL; 
    s += "&FILE=EMPLOYEE&INDEX=EMPSET1&KEY=10&SELECT=SEC-LVL=2"; 
    s += "&FIELD=EMPLOYEE;LAST-NAME;FIRST-NAME"; 
    s += "&OUT=XML&MAX=200";
    var sReturn = portalWnd.httpRequest(portalWnd.DMEPath + s)
    var vObjDMEXML = new portalWnd.DataStorage(sReturn); 
    var vRecord = vObjDMEXML.document.getElementsByTagName("RECORD");
    // 
    //Variables defined to fill listbox 
    //
    var Level1List = document.getElementById("VALUES_l27"); 
    var ListVal;
    ListVal = document.createElement("span"); 
     
    for (var ix=0; ix < vRecord.length - 1 ; ix++) 

    var vCols = vRecord[ix].getElementsByTagName("COL"); 
    var str = vCols[0].firstChild.data; 
    var str1 = vCols[1].firstChild.data;
    var str2 = vCols[2].firstChild.data;
    var str3 = str1 + ' ' + str2;
    alert('str ' + str);
    alert('str1 ' + str1);
    alert('str2 ' + str2);
    alert('str3 ' + str3);
    ListVal.setAttribute("tran",str); 
    ListVal.setAttribute("text",str1);
    ListVal.setAttribute("disp",str3); 
    alert('Maybe disp?');
    Level1List.appendChild(ListVal); 
    }
    }

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/14/2016 8:55 PM
    I can get past the error if I remove VALUES_ from the document.getElementById, but then the list box does show anything on the drop down.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/15/2016 8:18 AM

    Bill,

    Are you using Infor version10.x?  Infor changed the way you access list boxes.  You've already discovered you have to remove "values" (you still need the underscore).  Instead of creating a span and adding it to the listbox you just use a new function.  Change your code to:

      
    for (var ix=0; ix < vRecord.length - 1 ; ix++) 

    var vCols = vRecord[ix].getElementsByTagName("COL"); 
    var str = vCols[0].firstChild.data; 
    var str1 = vCols[1].firstChild.data;
    var str2 = vCols[2].firstChild.data;
    var str3 = str1 + ' ' + str2; 
    lawformAddListboxOption('_l27, str1,str3);

    }
     

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 12:13 PM
    Thanks. I would never have seen that. Is that documented somewhere? And I have seen the question posted on here before, but if I want to populate the second value in the list str3 into either a label or output only text field, how would I do that?
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 12:20 PM
    Thanks again for the information above. In addition to putting str3 into a label field, how to I set the listbox field to str1? When I drop down I see the info, but it doesn't populate the select box.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/15/2016 2:21 PM

    It is documented but not overtly.  In Design Studio, go into Tools --> Objects Viewer and expand Forms.  Click on Form Functions and you'll see it there along with a function to remove an item from a listbox. 

    By the way, I left off a quote in my initial answer but you must have caught it.  It should be lawformAddListboxOption('_l27', str1,str3);

    If you want to select an item in the dropdown list you use setFormValue.  Here is an example of populating a list box and selecting one of the options:

     //Add 3 items to a dropdown list named of 'select36' with a field number of '_l680'
     lawformAddListboxOption('_l680', 'OR','OREGON');
     lawformAddListboxOption('_l680', 'WA','WASHINGTON');
     lawformAddListboxOption('_l680', 'CA','CALIFORNIA');

     //Select the second item in the list.
     lawForm.setFormValue('select36','WA');

    Setting the form value doesn't actually select the item in the dropdown however.  If you were to get the selectedIndex attribute for the drop down list after setting the form value it would be -1 rather than "1" as you would expect.

    Unfortunately you can't do much more (or if you can I don't know how).  For example, standard javascript functions to get the text for WA (which is Washington) don't work.  I'm not sure how Infor is rendering the drop down list but I have a feeling it's not a normal drop down list otherwise we'd be able to access the "text" attribute which would give you "Washington".

    The way I got around this was to load my dropdown list items into an array.  Then I loaded the dropdown list from the array.  Then when someone selected an item from the dropdown list I would get the corresponding value from the array and place it into a label field.

    Hopefully this helps.

     

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 3:49 PM
    Thanks Randy. If you have some code that shows the array and how you loaded into that array and then selected it, that would make my day. This is what I have tried but it always selects the first value no matter which selection I pick.

    var vTest = document.getElementById("_l28");
    var vDesc = vTest.childNodes[1].getAttribute("tran");
    alert(vTest.childNodes[1].getAttribute("tran"));
    lawForm.setFormValue("select1",vDesc);
    var vTest = document.getElementById("_l28");
    var vDesc = vTest.childNodes[1].getAttribute("disp");
    alert(vTest.childNodes[1].getAttribute("disp"));
    lawForm.setFormValue("text23",vDesc);
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 3:53 PM
    And I do that in the VALUES_OnBlur function. Again, appreciate the assistance. I know that I am hardcoding the node above, but not sure if I put in tran where the 1 goes as the index or what.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/15/2016 4:22 PM

    Bill,

    I've attached a javascript file that I include in AP10.1.  The file contains functions to load a dropdown list of states.  Our users wanted a dropdown list when adding vendors rather than a freeform text box so this is what I came up with.  Note that I had to rename the file with a "txt" extension because I can't upload a .js file.  If you want to use it you'll need to rename it back to a .js file once you download it.

    In your FORM_OnInit() function you would call two functions:

     // Load the global gStateProvinceObject with all the US States and Canadian Provinces.
     loadStateProvinceArray();

     // Load the State or Province drop down with the values in gStateProvinceObject.  Note that we
     // can't assign the database field 'VDR-STATE' to the listbox.  If we do, we can't populate it so
     // we use our own listbox and then set the form value in the values_onblur event for the listbox.
     loadStateProvinceListBox('_l623',gStateProvinceObject);

    Here is the code I added to VALUES_OnBlur:

     

     // Get the State or Province value that the user selected for this vendor.
     if (id == "select35") {
      var stateCode = lawForm.getFormValue("select35");

      // Set the value of the hidden state field to the value that was selected so
      // when we do a change, the new value gets updated in the database.
      lawForm.setFormValue('hidden78',stateCode);

      // Set the value of the label next to the state listbox to the name of the state.
      lawForm.setFormValue("text85",getNameFromAbbreviation(stateCode,gStateProvinceObject));
     }

    And then finally, here is the code I added to the FORM_OnAfterTransaction function to select the state based on the state code for this vendor:

     //Select the state in the state list box.
     lawForm.setFormValue(gStateOrProv_sel,lawForm.getDataValue("VDR-STATE"));

     // Get the State or Province name for this vendor and put it in the textbox next to the state.
     lawForm.setFormValue("text85",getNameFromAbbreviation(lawForm.getDataValue("VDR-STATE"),gStateProvinceObject));

     

     

     

    Attachments
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 5:13 PM
    Thanks Randy. Is there a trick to downloading that file? I am using Chrome and it errors out. I will try IE. So basically we intercept the data between the init and the post. So that means during an inquire/next/previous that we need to populate that manually as well?
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 5:38 PM
    I was able to download and thank you. I can display data in a text field, but once I make it a select field, I can't set it at all, so I am not sure how to show data from the table just doing an inquire.
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 6:27 PM
    Hate to keep being a pain, and thanks ahead of time, but I took your code and fit it in my stuff. The list box displays but instead of displaying the "key" it comes out [object Object] - Employee Name. Where am I going wrong on this?

    for (var ix=0; ix < vRecord.length ; ix++)
    {
    ListVal = document.createElement("option");
    var vCols = vRecord[ix].getElementsByTagName("COL");
    var str = vCols[0].firstChild.data;
    var str1 = vCols[1].firstChild.data;
    var str2 = vCols[2].firstChild.data;
    var str3 = str2 + ' ' + str1;
    Lev1Array[str] = [str3];
    }
    for (var abbreviation in Lev1Array)
    {
    lawformAddListboxOption('_l25',Lev1Array,Lev1Array[abbreviation]);
    }
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/15/2016 9:36 PM
    Working and researching I see that object object is the default. I see this in the console log, which is correct.
    [object Object]{" 31": "BILLY XALTER", " 45280": "James ZAlt"}
    Now, how can I grab those values and see them in the list display? Again, sorry for so many questions.
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 6:54 AM
    Randy, I want to thank you again for the help. What I ended up doing was below, basically loading the array at the same time as the list. That helped with the object object issue and then allowed me to put the rest of the code in that found and displayed the name. The last thing that I can't figure out is how to populate that select field if I am just doing inquire/next/previous. I tried tying the field ID, but as you said, that won't work. So I have tried every set function available but it just does not seem to populate the select field on the inquire. Any ideas on that?

    for (var ix=0; ix < vRecord.length ; ix++)
    {
    ListVal = document.createElement("option");
    var vCols = vRecord[ix].getElementsByTagName("COL");
    var str = vCols[0].firstChild.data;
    var str1 = vCols[1].firstChild.data;
    var str2 = vCols[2].firstChild.data;
    var str3 = str2 + ' ' + str1;
    Lev1Array[str] = str3;
    lawformAddListboxOption('_l25',str,str3);
    }
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 8:59 AM

    Bill,

     

    When you do any transaction (inquiry, next, prev, change, etc) the FORM_OnAfterTransaction function will be invoked when the data is returned from the COBOL program.  At that point you can obtain the value of the field you want by using lawForm.getDataValue("your data field name");  Then you put that value into the form field using lawForm.setFormValue("your form field");.  In the example below I am getting the value of the state code (VDR-STATE) that was returned by my inquiry and placing it in the drop down list (select35).  Give that a shot and see if it works.

    Put this in the FORM_OnAfterTransaction function:

     //Select the state in the state list box.
     lawForm.setFormValue("select35",lawForm.getDataValue("VDR-STATE"));

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 9:47 AM
    Thanks Randy. I was doing that with a variable field, but went ahead and put it like you have above, but I get the same result. It sets the text22 box with no issues. Is there something different about a select box?

    var lev6 = lawForm.getDataValue("ZZR-LEVEL6-APPROV");
    lawForm.setFormValue("text22",lev6);
    lawForm.setFormValue("select1",lawForm.getDataValue("ZZR-LEVEL6-APPROV"));
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 10:10 AM

    Bill,

    Your code looks correct.  Your dropdown list isn't in a detail area control is it?  If so you need to specify the index of the line with the control.  That doesn't sound like it's the case though.

    In order to set the value of select1, the value has to be one of the options that are already in the select1 list.  For example, if your select1 contains 'CA','OR' and 'WA', you can only set it to one of those values.  You can't set it to 'NV' for example.  If you are populating the list in the form_onInit function it should already have all your values.  Can you confirm that the value in the lev6 variable is already in the list box?

     

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 10:52 AM
    That was it. Thanks so much. I was trying to use a field that wasn't being used so that I wouldn't mess up the rest of the form. Now I have to apply that to all of the other drop downs that they want. Only every field on the form. :-)

    And to make a text field hidden, I need to go into the xml and under tp make it tp=hidden. Is that correct?

    Again, thanks so much for the assistance.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 11:03 AM
    Great, glad you were able to get it working.  And yes, adding tp="Hidden" to a form field will make it hidden.
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 12:43 PM
    I swear this is the last question. :-) I am trying to make my text2 field hidden and then reference like you mentioned for updating. If I leave the field as not hidden, all of the functions work and I am able to update the table. If I type hidden in the tp, then it doesn't work. It doesn't change the id of the field so I am still referencing the same text2, but it doesn't populate a change so that the update to the database works.




    Thoughts?
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 2:36 PM

    Is Text2 where you are displaying the description for the value selected in the list box?  If so, rather than making it hidden, just make it an output only field by selecting the field in Design Studio; selecting (Custom) in the properties window and checking the Output Only check box.

    Also, you appear to be about 99% there so I wouldn't recommend re-engineering your solution but I did figure out how to get the display value of the selected item in a list box.  I put the following in my VALUES_OnBlur function.

    if (id == "select2") {  // This is your list box

        var mylistbox = lawForm.getElement("_l623"); // This gets a reference to your list box.  Make sure you change the ID (_l623') to your list box ID.
     

        for (var i=1; i < mylistbox.childNodes.length; i++) { // This will loop through all the items in the list box.  
           if (mylistbox.childNodes.selected == true) { // This tests to see if the item is selected.
                var myDisplayValue = mylistbox.childNodes.attributes['disp'].nodeValue; // This gets the display value of the selected item.
                break; //This breaks out of the for loop.  No need to continue checking items after you've found your selected item.
             }
        }

    }

    When you leave this loop, myDisplayValue will contain the display value of the item that was selected.  If you use this method you don't need to mess with arrays; you can just load your list box and then use this method to get the display value.  I also placed the code in my FORM_OnAfterTransaction function (removing the if (id == "select2") code ) to display the name of the state from the value in VDR-STATE. 

                  
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 2:57 PM

    Oops, sorry, I left out the index.  Use this one:

    if (id == "select2") {  // This is your list box

        var mylistbox = lawForm.getElement("_l623"); // This gets a reference to your list box.  Make sure you change the ID (_l623') to your list box ID.
     

        for (var i=1; i < mylistbox.childNodes.length; i++) { // This will loop through all the items in the list box.  
           if (mylistbox.childNodes.selected == true) { // This tests to see if the item is selected.
                var myDisplayValue = mylistbox.childNodes.attributes['disp'].nodeValue; // This gets the display value of the selected item.
                break; //This breaks out of the for loop.  No need to continue checking items after you've found your selected item.
             }
        }

    }

     

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 3:00 PM
    Sorry. I wasn't specific enough. No, text2 is the text box tied to the table source field. I remember yours had hidden28 or something like that. When I make it hidden, it doesn't seem to update the data in the table with the change. So I don't know if I should reference it by something else or what. The ID is still text2 even when hidden.

    That code looks a lot more concise than what I had. I will take it and maybe try it in one of the list boxes. They want 6 of them and they take forever to load on form init.
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 3:03 PM
    And both of your code posts look the same. Did I miss something on the second one?
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 3:20 PM

    Apparently code in brackets gets removed when you post.  So for these two lines:

           if (mylistbox.childNodes.selected == true) { // This tests to see if the item is selected.
                var myDisplayValue = mylistbox.childNodes.attributes['disp'].nodeValue; // This gets the display value of the selected item.
      

    after the word "childNodes" and before the period add a left bracket, an "i" and a right bracket.

    As for that hidden field, I understand now.  This is what my XML source looks like:

       fld al="left" blankzero="1" col="13" ed="upper" height="1" id="hidden78" label="State or Province:" mxsz="2" nbr="_f52" nm="VDR-STATE" par="TF0-0" row="11" seltype="" sz="2" tp="Hidden"

    Make sure the nbr and nm fields contain the proper values for the field you are updating.  Not sure if the field name is important but you might try changing it to hiddenxx (something unique).

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 3:48 PM
    Got it. Thanks. I was wondering about what was different. So just to make sure, I will change


    to


    And then reference in the VALUES_onBlur
    if (id == "select1") {
    var empname = lawForm.getFormValue("select1");
    lawForm.setFormValue("hidden50",empname);
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 3:50 PM
    OK, it left out my post that time.

    fld al="left" blankzero="1" col="42" ed="upper" height="1" id="text2" label="Level1 Approv" nbr="_f4" nm="ZZR-LEVEL1-APPROV" row="13" sz="15" tp="Text"

    will be

    fld al="left" blankzero="1" col="42" ed="upper" height="1" id="hidden50" label="Level1 Approv" nbr="_f4" nm="ZZR-LEVEL1-APPROV" row="13" sz="15" tp="Hidden"
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/16/2016 3:56 PM
    That looks good to me (assuming select1 is your list box).  Let me know if that does the trick.
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/16/2016 4:05 PM
    Will do. Appreciate all the help.
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/17/2016 1:58 PM
    OK. I lied. I am experiencing a couple of anomalies. I use the code that you first had given me to display the name. It works great in VALUES_OnBlur. I figured, why not populate the names on an inquire instead of a read to the database. It seems to work sometimes and others not. The values are there because they appear in the drop down list and once I select, the name appears. Any ideas on that?

    And as for the hidden fields, I can rename it and it still works for populating the database. It seems though once I make it hidden it stops working.

    And this one should be easy for you I am sure. I was changing the text boxes to read only depending on the user. Worked fine for text boxes. Not so much it looks like for select boxes.
    lawForm.getFormElement("text5").readOnly=true; works
    lawForm.getFormElement("select5").readOnly=true; doesn't work

    Thanks again.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/17/2016 3:35 PM

    Are you populating names in the FORM_OnAfterTransaction function?  You'll find that even though the list box shows a value, it's not actually "selected".  So what you need to do is set the select form field to the value of the data that came back in the transaction and then call the routine to get the display value for the selected value.  For example, here is what I did for state:

     //Select the state in the state list box.
     lawForm.setFormValue("select35",lawForm.getDataValue("VDR-STATE"));

     // Put the state name in the textbox next to the state.
     lawForm.setFormValue("text85",getSelectedListboxValue("_l623"));

    Incidentally, I placed the getSelectedListboxValue in a global functions include file so I can just call it with one line rather than coding that loop everywhere.  Here is the function:

    function getSelectedListboxValue(lb) {
     
     /* This function returns the display value of the selected item in a listbox.
      Example call: var myselectedvalue = getSelectedListboxValue("_l623"); */
     var myDisplayValue = ''; // This is the value that will be returned to the caller.
     var myListbox = lawForm.getElement(lb); // This gets a reference to the list box.
     
     // Loop through all the items in the list box until we find the one that was selected.
     for (var i=1; i < myListbox.childNodes.length; i++) {
      if (myListbox.childNodes.selected == true) { // Test to see if the item is selected.
       myDisplayValue = myListbox.childNodes.attributes['disp'].nodeValue; // Get the display value of the selected item.
       break; //This breaks out of the for loop.  No need to continue checking items after we've found the selected item.
      }
     }

     return myDisplayValue;
     
    }

    Regarding your hidden field not working, it's difficult to determine the issue without actually having your full program.  In my case I didn't even change the field name; I just added tp="Hidden" to the field.  Below is what I did for the state field.  Make sure the "nbr" and "nm" match the Infor generated values for those fields.

      fld al="left" blankzero="1" col="42" ed="upper" height="1" id="text11" label="State or Province:" nbr="_f29" nm="VDR-STATE-PROV" par="TF0-0" row="8" sz="2" tp="Hidden"/

    Regarding the read only attribute, listboxes don't have that property.  Try lawForm.getElement("_l183").disabled=true; (use your field ID).

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/17/2016 3:48 PM
    I ended up just making the boxes 1 character and output only. That works. I will try the disabled.

    I am seeing one more oddity. As I move the data from the hidden field to the select box and then from the select box back to the hidden field on blur, it is putting spaces in front of the field. Can I do a trim on that before putting back in the hidden field for updating?

    I just went back to reading the employee table for the initial name on a query. That's where I get it from anyway. It may have been an issue with the spaces, but I am not sure.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/17/2016 4:03 PM
    You can do a portalWnd.strTrim() function on the string to remove spaces from the front and back but be careful.  Some Infor fields are left padded with spaces in the database and you may need to preserve them. 
    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/20/2016 4:19 PM
    I have a question or two about some strange behavior in the form. The form has all of the fields as select fields except the last field. On init or after a transaction (inquiry/change), the cursor is positioned in the last field even though I put in a positioninfieldbyid. I put in alerts and can see it pop in there, but then it goes back to the last field. Second, the list fields only allow drop down entry. You can't enter anything free form. Is this normal behavior for select fields? Thanks again.
    Randy Jacoy
    Application Developer
    U.S. Bank
    Veteran Member
    (131 points)
    Veteran Member
    Posts:45


    Send Message:

    --
    11/21/2016 8:42 AM

    Click on Edit ---> Tab Order.  Is the text box the first field in the list?  If so, that's where your cursor will go.  Set your select box as the first field in the list and you don't need to use positioninfieldbyid.

    And apparently in Infor v10 the list box is a true list box rather than a combo box.  In version 9 you had the option of typing a new value into the combo box but not in version 10.  You can only type in an existing item.

    Bill Alt
    Senior Technical Consultant
    Private
    Advanced Member
    (71 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    11/21/2016 3:19 PM
    Thanks. I remember seeing that but thought it was just for tab order, not field order.

    I do remember those combo boxes. It didn't dawn on me that they were removed. Thanks for that explanation.
    You are not authorized to post a reply.