I am building a master - detail interface where Master is a dataGrid
and detail is a form.
...
<mx:FormItem width="110" direction="horizontal" label="Badge"
required="true">
<mx:TextInput id="badgeid" focusOut="formatBadge(badgeid)"
text="{templist.selectedIndex==-1 ? templist.dataProvider
[0].bedge_id : templist.dataProvider
[templist.selectedIndex].bedge_id}"
width="50" restrict="0-9" maxChars="5"/>
</mx:FormItem>
...
I am getting an error at:
text="{templist.selectedIndex==-1 ? templist.dataProvider
[0].bedge_id : templist.dataProvider
[templist.selectedIndex].bedge_id}"
The error:
Error: Unknown Property: '-1'.
at
mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscr
ipt/flash/proxy::getProperty()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\collections\ListCollectionView.a
s:694]
at <anonymous>()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\ArrayElementWatcher.as:8
4]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.binding::Watcher/wrapUpdate()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\Watcher.as:182]
at mx.binding::ArrayElementWatcher/updateParent()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\ArrayElementWatcher.as:8
2]
at mx.binding::Watcher/updateChildren()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\Watcher.as:128]
at mx.binding::PropertyWatcher/updateProperty()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:302]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.binding::Watcher/wrapUpdate()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\Watcher.as:182]
at mx.binding::PropertyWatcher/eventHandler()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:325]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
at mx.controls.listClasses::ListBase/set dataProvider()
[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as
:1827]
at mx.controls::DataGrid/set dataProvider()[E:\dev\3.1.0
\frameworks\projects\framework\src\mx\controls\DataGrid.as:1334]
If I choose continue for a couple of times it will work perfectly.
Please help. Thanks