This content has been marked as final. Show 4 replies
Sure. If you are binding directly to lastResult, you just found another reason not to.
Use a result handler function, and in that function, apply whatever UI logic you want, based on your data.
If no data is returned, as seen in the result handler function, set the datagrid "visible" property to false. You can also set "includeInLayout" property to false so the layout does not act like the datagrid is there.
I'm new to Flex...and I'm sure I won't get any replies to this followup, but what is a result handler?
Events are what allow Flex programs to recognize user interaction with the Flex program, and also non-user system events. Events can be user actions like clicking a button, typing text, etc., or events can be an image finishing loading, or in your case the "result" of a data request being fulfilled.
In some cases you need to explicitly add an event "listener" to a component, such as a button, httpservice, but in other cases, you just specify a funtion that will act as the "handler" of events for the component. It is the function that will often receive the event as a parameter. Then you can look at the properties of the event object that was received as the handler parameter, and access the data, the component that dispatched the event, etc.
Look at the following FB3 help topics for a fairly concise description of what you need to know:
Preventing layout of hidden controls