--- In [email protected], "sandi.pond" <sandi.p...@...>
wrote:
>
> Hello all, I'm new to Flex and so full of questions ... Is there a
way
> to use logic to determine a dataProvider for a list? By that I
mean, I
> have 2 attributes in my XML nodes and one will always contain a
value
> and the other will always not. For example,
>
> <node this="" that"" />
>
> And my XMLList may contain several nodes:
>
> <node this="value" />
> <node that"anothervalue" />
> <node this="andanother" />
>
> And then I have an <mx:List> that I'd like to display the attribute
> that has a value - either this or that. I've tried using the ||
> statement but no luck yet.
Use a labelFunction (something like this):
private function labelXML(value:XML):String {
if (value.attribute('this').length() >0) {
return value.attribute('this');
else {
return value.attribute(that);
}
}