Reputation: 433
I'm working a flex UI component with multiple tabs and I need to be able to cover 2 scenarios:
1.) If a relevant record is found, populate the view with a datagrid and populate the datagrid with the values from the returned result.
2.)Else if no record is found, display a label centered in the tab component. (this would be the label currently shown in the second line of the code block.)
Pointers would be appreciated on how to programmatically implement this.
Initial:
<s:NavigatorContent label="Evaluations" width="100%" height="100%">
**<s:Label text="No Evaluations Completed To Date" horizontalCenter="0" verticalCenter="0" color="#F43ACB" fontSize="12" textDecoration="underline" includeIn="State1"/>**
<s:Button includeIn="State1" x="10" y="10" label="Create Evaluation" cornerRadius="20" width="112" color="#FC7EEF"/>
<s:Button x="146" y="10" label="Generate Standard Eval." cornerRadius="20" width="163" color="#FC7EEF" includeIn="State1"/>
</s:NavigatorContent>
Upvotes: 0
Views: 70
Reputation: 51
You could do this by giving your "No Evaluations Completed To Date" label an id and a property visible="false" set your dataGrid visible property to "false"
Then check your dataProvider, when it's empty set the dataGrid visible="false" and noEvaluationsLabel.visible="true"
When the dataProvider is not empty set dataGrid visible="true" and noEvaluationsLabel.visible="false"
Upvotes: 1