is it possiable to use conditional operator in combo box dataprovider using flex?
In my Combo box i have to shows team names condition based . So i will try like
dataProvider="{usersXML.users.user.(id=10).name}"
but shows some errors开发者_高级运维 . but if i tried
dataProvider="{usersXML.users.user.name}"
display all name . It's working .
How can i condition based to display the list . In combobox . Plz refer me . is it possiable to check array of id on the dataProvider ?
It seems like this is more an E4X question than one to do with the Combo box specifically. Did you try:
usersXML.users.user.(@id==10).name
I think you're going about it the wrong way. Have you tried storing something like this:
[Bindable]
var targetList:XMLList
function setID( id:int ):void
{
var tmpList:XMLList = usersXML.users.user.( @id==id );
if( tmpList && tmpList.length() && tmpList.@name.toXMLString().length )
{
targetList = tmpList
}
}
If you use the above to set the id, then you can run tests to make sure that user ID and the appropriate name attribute definitely exists in this case.
To get the XML to point to this object:
<mx:Combobox dataprovider="targetList" />
精彩评论