Results 1 to 8 of 8

Thread: [Answers] Combobox

Threaded View

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Combobox

    Q:
    How do I create a combo box for the user to select from a few predefined selections in a form
    A:
    If you specify selections in the Choices attribute of a field in a Form Section, it will automatically be displayed as a combobox.



    Q:
    Combobox in grid
    A:
    This is not currently supported for numeric columns in Grids. If you datamap it to character you should be able to do it:
    Choices: 1,2,3,4
    Get data mapping: str(name-of-field,1,0)
    Set data mapping: val("{}")



    Q:
    On my page I have a combobox (ankrtpar) that only should be enabled if a property (ankrtkey) of my object is filled.
    So I entered in the combobox attribut dialog: not empty(loObj.ankrtkey)
    That had no effect. So I deleted it and opend the code and filled in:
    proc page1_section2_ankrtpar_enabledwhen()
    set step on
    THIS.Enabled = not empty(loObj.ankrtkey)
    endproc
    A:
    The enabledwhen() event should be triggered when you go into Runtime View.
    The 'Enabled When' is expecting an inline command or the name of the delegate to call - it does not evaluate a condition. Try putting your condition in the actual method and set Lianja.get("ankrtpar").enabled to .T. or .F. .



    Q:
    After I add a new entry on page1, if I select page2, the combobox does not get updated with the newly added values from page1.
    A:
    Lianja.get("page2.section1.mycombo").choicelist = Lianja.get("page2.section1.mycombo").choicelist
    in the section.activate.
    The activate, visiblewhen, enabledwhen and mousedown events for the combobox itself are also called before the list is populated.



    Q:
    We can change the choicelist ie Lianja.get("page1.section1.field1").choicelist = "East,West,North,South" in code (and can test it in code to ensure it has changed ok) but how do we refresh the combo box contents?
    We have tried :
    Field.Refresh()
    Section.Refresh()
    Page.refresh()
    but the only time it seems to take effect is change page & then back to the original page.
    We didn't understand what you meant when you wrote
    "You can change the selections in the "dataChanged" delegate if you need to." We are not changing records, rather reacting to a selection in another combo box which calls our function().
    We are trying to make these changes from code as the conditions are fairly complicated.
    A:
    Just do it from the console and the values should change in the combo. If that works as expected the just change it in the "Change" delegate for another combo box.
    In your case you are always in edit mode so i'm not sure if that is affecting it.
    That being the case switch in and out of edit mode should do the trick.



    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2016-03-02 at 04:13.

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