Results 1 to 6 of 6

Thread: Trying to control Combobox

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Posts
    3

    Trying to control Combobox

    Hi All, Trying to control a combobox with a substr of a data field with no success so far.
    I have populated the object with the "Choices" field with ",Part Time, Full Time"

    and put this code in the datachanged delegate

    function page1_section1_field6_datachanged()
    {
    // insert your code here
    var emp = Lianja.getCursor("emp0_000");
    var ddep = emp.getData("ddep");
    var emptypidx = substr(ddep,4,1);
    var Oitem = Lianja.getElementByID("page1.section1.field6");
    switch(emptypidx){
    case "F":
    Oitem.value = "Full Time";
    break;
    case "P":
    Oitem.value = "Part Time";
    break;
    case "T":
    Oitem.value = "Temportary";
    break;
    default:
    };
    };

    What am I doing wrong, it's getting into switch with the proper value?
    TIA

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Try setting the "text" not the "value".

    Oitem.text = "Full Time";

    You can try this type of thing interactively in the JavaScript console.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Posts
    3
    Quote Originally Posted by barrymavin View Post
    Try setting the "text" not the "value".

    Oitem.text = "Full Time";

    You can try this type of thing interactively in the JavaScript console.
    Yep, that worked. Thanks. I doesn't help that all the commands are in upper/lower case in the doc and it only says once that all javascript properties are lower case.

    Something else, I couldn't get the list method to work? It comes up undefined. Reason?

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    If you encounter an issue like that please submit a ticket so that the method is exposed in JavaScript.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Junior Member
    Join Date
    Jan 2020
    Posts
    3
    Quote Originally Posted by barrymavin View Post
    If you encounter an issue like that please submit a ticket so that the method is exposed in JavaScript.
    Can do. Thks.

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    I've added list( n ) in 5.3.

    Note that n starts at 1 not 0.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us