In flex builder 4.6,am trying to bind data from am sql query, showed in a <s:List>
with an item renderer <s:Textarea>
My Code as follows:
<s:List id="listapagar" x="304" y="276" width="330" height="42" borderVisible="false"
color="#FF0000" dataProvider="{dataProvider}" enabled="false" fontSize="22"
fontStyle="italic" fontWeight="bold" labelField="nome" textAlign="center"
textDecoration="underline">
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:TextArea id="apagar" width="330" height="42" text="R$ {data.valorapagar}" />
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
and here, my sql, displayed trough the <s:list>
:
protected function buttonX():void
{
var sqlConnection:SQLConnection = new SQLConnection();
sqlConnection.open(File.applicationDirectory.resolvePath("testeDb.sqlite"));
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConnection;
stmt.text = "SELECT * FROM comandatual order by numerodatransacao desc limit 1 ";
stmt.execute();
dataProvider = new ArrayCollection(stmt.getResult().data);
}
after it , i trying to take the result showed at the s:TextArea id="apagar" and bind with another text area, to perforn a simple minus calc, like this :
<fx:Binding source="apagar.text" destination="restroco.text"/>
<fx:Model id="Calculos" >
<Calculos>
<!-- Perform a calculation. -->
<a>{(Number(restroco.text)) - 3}</a>
</Calculos>
</fx:Model>
but at this time, flex return an error that cannot let me advance :
1120: Access of undefined property apagar. Flex Problem
so, i'm get stucked, if anyone want to see my full code, they are here :