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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s