What exception are you getting when using ItemRenderer as the root tag?
If you don't need interactivity, you can use MXMLComponent as the root tag. This is just a Group that implements IDataRenderer.
Thanks for reply. Using MXMLComponent solves the problem.
But still I don't know why can't i use ItemRenderer. This is the exception I get while in UIComponent.as using ItemRenderer.
private function getState(stateName:String):State
if (!states || isBaseState(stateName))
// Do a simple linear search for now. This can
// be optimized later if needed.
for (var i:int = 0; i < states.length; i++)
if (states[i].name == stateName)
var message:String = resourceManager.getString(
"core", "stateUndefined", [ stateName ]);
throw new ArgumentError(message); /// HERE I GET ERROR
In regards to error, you probably didn't define your states (normal, hovered, and selected) in your ItemRenderer.
Try adding this to your ItemRenderer:
<s:State name="normal" />
<s:State name="hovered" />
<s:State name="selected" />
I had an error from the same line you pointed out in UIComponent.
Hope this helps.