Hi again,

skar schrieb:
> Hi Daniel,
>> qx.ui.embed.Html is the weapon of choice if you want to insert plain 
>> HTML into your application. But it won't solve your problem as any 
>> Javascript within the HTML won't be evaluated.
>> Generally speaking, it's preferable to keep all the Javascript code 
>> within your qooxdoo application. Maybe your server could just put a 
>> "placeholder" in the HTML which you could analyze in your frontend app 
>> and then call the corresponding method?
>>
>> If you could give some more details of what you want to achieve, perhaps 
>> we can find a better solution.
>>   
> Thanks for the tips. I need some flash based charting. When the user 
> clicks on a button called "stats", I wanted a window to appear which 
> loads a flash based chart with the apt data.
> 
> I used to use the rails plugin at 
> "http://www.pullmonkey.com/projects/open_flash_chart";. It basically 
> gives ruby wrapper for the OFC2 swf and js. For eg, I just need 2 
> methods in main_tab_controller of rails like this:
> 
>> def stat_tab
>>         @graph = open_flash_chart_object(600,300,"/main_tab/graph_code")
>>   end
>    
>> def graph_code
>>     title = Title.new("My TITLE")
>>     bar = BarGlass.new
>>     bar.set_values([1,2,3,4,5,6,7,8,9])
>>     chart = OpenFlashChart.new
>>     chart.set_title(title)
>>     chart.add_element(bar)
>>     render :text => chart.to_s
>>   end
>>   
> 
> 
> And I get this HTML when calling the URL "/main_tab/stat_tab" :
>> <div id="stat">
>>  
>> <script type="text/javascript" src="/swfobject.js"></script>
>>  
>>         <div id="flash_content_EhBeFfP1"></div>
>>       <script type="text/javascript">
>>       swfobject.embedSWF("/open-flash-chart.swf", 
>> "flash_content_EhBeFfP1", "600", "300", "9.0.0", 
>> "expressInstall.swf",{"data-file":"*%2Fmain_tab%2Fgraph_code*"}, 
>> {"wmode":"transparent"});
>>       </script>
>>       <noscript>
>>         <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
>> codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";
>>  
>> width="600" height="300" id="chart_EhBeFfP1" align="middle" 
>> wmode="transparent">
>>           <param name="allowScriptAccess" value="sameDomain" />
>>           <param name="movie" 
>> value="/open-flash-chart.swf?data=%2Fmain_tab%2Fgraph_code" />
>>           <param name="quality" value="high" />
>>           <param name="bgcolor" value="#FFFFFF" />
>>           <embed 
>> src="/open-flash-chart.swf?data=%2Fmain_tab%2Fgraph_code" 
>> quality="high" bgcolor="#FFFFFF" width="600" height="300" 
>> name="chart_EhBeFfP1" align="middle"  allowScriptAccess="sameDomain" 
>> type="application/x-shockwave-flash" 
>> pluginspage="http://www.macromedia.com/go/getflashplayer"; 
>> id="chart_EhBeFfP1" />
>>         </object>
>>       </noscript>
>>
>>
>> </div>
> The parameter "data-file" contains the URL path from where the JSON data 
> can be fetched. Now from what you said, I need to move this javascript 
> generated above to the QX app's code and then get the flash to use the 
> json data from the data returning method. But I wanted to know if there 
> is a way to use the rails/ruby wrapper for OFC2(Open Flash Chart 2), as 
> it's easier/simpler to use, as evidenced from the above 2 rails' methods.

I see. Is there a way to tell OFC2 or the ruby wrapper to return a full 
HTML document instead of just a div node? Then you could simply load it 
in a qx.ui.embed.Iframe. If not, maybe you could write a wrapper for the 
wrapper that returns a complete document.

If that's not possible you could try creating the Flash object yourself: 
Parse the HTML you get from Rails, extract the information you need and 
create a qx.ui.embed.Flash with it. I guess the important parts are 
"flash_content_EhBeFfP1", which would be the Flash object's id and the 
map containing the "data-file" key which you would set by using the 
"variables" property of the qx.ui.embed.Flash instance.

> 
> Also, when I tried "var h = qx.ui.embed.Html();" firebug had the warning 
> from QX "qx.ui.embed is undefined". What could be the problem here?

This usually happens when your app's dependencies have changed. Running 
generate.py source (or build, respectively) again should do the trick.


Regards,
Daniel

> 
> cheers,
> skar.
> 
> -- 
> --
> The life so short, the craft so long to learn. 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to