I have two questions regarding the Flex combo box.
-
The string representing the function name will be read from xml @ run time.
var combo:ComboBox = new ComboBox();
combo.labelFunction = “functionName”;
How can I achieve this?
-
So the first name, which is to be displayed in the combo box, can be only retrieved by accessing another DTO, called person and then its first name.
var combo:ComboBox = new ComboBox();
combo.labelField= “person.firstName”;
My class looks like this,
public class Test
{
public var person:PersonDTO;
}
public class PersonDTO
{
public var firstName:String;
}
Is it possible to access any multi-level text using the combo box label field ?
ad 1) labelFunction
Calling functions when you know only the name as String is quite easy. The following snippets shows how you can execute a function that is a member of the same class. In case you need to call a function from another class replace
thiswith the according variable name.ad 2) labelField
It’s normally not possible to use “person.firstName” as labelField. However, you should be able use it within your labelFunction. Something like this should work…