# RubyAmf + DataGrid Binding

**URL:** <https://www.ruby-forum.com/t/rubyamf-datagrid-binding/162066>\
**Category:** Rails\
**Created:** [March 5, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/rubyamf-datagrid-binding/162066 "2009-03-05T13:01:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![enzor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@enzor](https://www.ruby-forum.com/u/enzor)\
**Post date:** [March 5, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/rubyamf-datagrid-binding/162066/1 "2009-03-05T13:01:11Z")

</div>

Hi there!

I’m trying to bind some data from my Rails application inside a Flex  
Datagrid, and i’m just wondering why this code don’t work!

flex Code:

\</mx:Script\>

\<mx:DataGrid id=“dg” width=“600” height=“400”\>  
mx:columns  
\<mx:DataGridColumn dataField=“id”/\>  
\</mx:columns\>  
\</mx:DataGrid\>  
\<mx:Panel width=“600” height=“400” x=“610” id=“productPanel”  
title=“Prodotti”\>  
\<mx:Label id=“resultTxt” /\>  
\<mx:Button label=“Align” click=“load(event)” /\>  
\</mx:Panel\>

StoreController Code

def retrieveProducts  
respond\_to do |format|  
format html  
format.amf {render :amf =\> Product.find(:all) }  
format.xml {render :xml =\> Product.find(:all) }  
end  
end

from the console i see that the application retrieve the data, but the  
Datagrid remains empty! ☹

some word on this?

thanks a lot in advance!

enzo rivello

---

<div class="post-metadata">

**Author:** ![enzor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@enzor](https://www.ruby-forum.com/u/enzor)\
**Post date:** [March 5, 2009, 1:07pm UTC](https://www.ruby-forum.com/t/rubyamf-datagrid-binding/162066/2 "2009-03-05T13:07:33Z")

</div>

Update:

actually it load the data  
the problem is that the data remains invisible!  
someone can explain me why?
