May 16, 2008

Pages


Search Site


Topics


Useful Links

Blogs I Read


Archives

Entries for month: July 2006

Spry :: Dynamic Panels Within Dynamic Accordions

July 31 2006 by Andrew Powell
For the last week or so, my holy grail has been a dynamic content panel in a dynamic accordion via Spry. Well, I have finally achieved this goal! I started with the region observer/dynamic accordion example on Adobe Labs. I then modified the file so that I had a detail dataset (which could return multiple rows), and then put the output for that dataset in the PanelContent section of the accordion. When you click on the panelTab, the current row of the master dataset is set, and the region observer sees that the region has changed. The region observer then reads the current row of the master dataSet and sets the current panel to the same index. The code is a bit hard to follow, but here it is: <script language="JavaScript" type="text/javascript">
   dsOrders = new Spry.Data.XMLDataSet("/spry/?event=orderSummaryList", "/orders/row", {useCache:false});
   dsOrderDetail = new Spry.Data.XMLDataSet("/spry/?event=orderStatusDetail&orderNumber={dsOrders::ORDERNUM}", "/orderDetail/order", {useCache: false});

   var regObserver = new Object;

   regObserver.onPostUpdate = function(notifier, data)
   {
      var acc = new Spry.Widget.Accordion("orders", {defaultPanel: dsOrders.getCurrentRowNumber()});   
   };
   
   Spry.Data.Region.addObserver("orders", regObserver);
   
   function clicker(rowNum)
   {      
      dsOrders.setCurrentRow(rowNum);
   }

</script>


<div id="orders" class="Accordion" spry:region="dsOrders dsOrderDetail">
   <div class="AccordionPanel" spry:repeat="dsOrders">
      <div class="AccordionPanelTab" spry:hover="AccordionPanelLabelHover" onclick="clicker({dsOrders::ds_RowID});"><b spry:content="{dsOrders::ORDERNUM} - {dsOrders::ORDERDATE}"></b></div>
      <div class="AccordionPanelContent">
         <div spry:state="loading"><img src="/assets/images/ajax-loader.gif"/></div>
         <div spry:state="error"><span spry:content="Error loading data..."></span></div>
         <div id="details" spry:state="ready">
            <span spry:content="{dsOrderDetail::ORDERNUMBER}"></span><br/>
            <span spry:content="{dsOrderDetail::PONUMBER}"></span><br/>
            <span spry:content="{dsOrderDetail::SHIPPED}"></span><br/>
            <span spry:content="{dsOrderDetail::BACKORDERED}"></span><br/>
            <span spry:content="{dsOrderDetail::SKU}"></span><br/>
            <span spry:content="{dsOrderDetail::PARTNUM}"></span><br/>
            <span spry:content="{dsOrderDetail::SHIPDETAIL}"></span><br/>
         </div>
      </div>
   </div>
</div>
Please, as always, leave any and all questions in the comments.

Posted in ColdFusion | Spry | 0 comments

RTF2HTML Update

July 21 2006 by Andrew Powell
I didn't realize how many people were actually using my RTF2HTML webservice. I understand that since the migration to the new server, it is not working. If you would let me know what your problem is and what error you are getting, please post it to the comments and I will do my best to work with you on it. If you are looking to access the service, the WSDL is: http://www.infoaccelerator.net/cfc/rtf2html.cfc?wsdl

Posted in ColdFusion | General | Linux | RTF2HTML | 0 comments

RTF2HTML Update 2

July 21 2006 by Andrew Powell
Ok, so the problem has been diagnosed. I need to completely re-write the service to use a java object instead of a com object. This should be done relatively quickly. I just need my license for the engine to arrive and we're set to go. The WSDL will remain the same and the service will be invoked the same. I just need to update the underlying engine. This is just one of the casualties of upgrading to Linux from Windows servers!

Posted in ColdFusion | Linux | RTF2HTML | 0 comments

That's One Way To Get FP9 To The Masses...

July 21 2006 by Andrew Powell
Danny Patterson has post on his blog about how mySpace requires FP9 now for some of the audio & video stuff they have on their site. That is deffinitely one way to get the world to upgrade to FP9. I wonder if this was a well placed move to help Flex 2 by working a deal to get FP9 required on the largest site on the web.... Can we say conspiracy boys and girls? Maybe, maybe not.

Posted in Flex | General | Adobe | 0 comments

Dynamic XML Generation For Spry and Flex 2 with Mach-II

July 21 2006 by Andrew Powell
A knowledge of Mach-II and its structure is required to setup and execute this XML Generation Methodology. Spry has garnered a lot of talk lately. This new framework for AJAX from Adobe makes AJAX even easier than before. The natural progression, for us inquisitive types, is to ask ourselves how far we can push this new technology. With a little ingenuity and some intermediate ColdFusion knowledge, you can get ColdFusion to generate XML from a query object. If you want to take it a step further, and are using MSSQL, you could even get an XML document straight from the database, but that's a topic for another day. Generating XML from a CFM template is fine and works well. A lot more CF developers are starting to use frameworks and moving into an object oriented environment (CFCs are your friend, remember?). Wouldn't it be nice if we had a way to get XML into Spry's datasets while keeping within the mechanism in our framework? Well, of course! We have developed a Mach-II based XML generation enigne. Now, we don't call this a Spry-Mach-II bridge because the XML that is generated, is NOT SPRY SPECIFIC!!! It can be consumed by any application that needs dynamic XML from your Mach-II application. This, is where Flex 2 comes in.... It can consume XML natively. So can Flash. XML plays nicely with everyone, even .NET. Please read the Flex 2 documentation on Adobe's site to find out more about consuming XML with Flex 2. The file that accompanies this post contains all the pieces you need to get started in generating your own dynamic XML with Mach-II. The model contains the DAO that actually does the generation of the XML. The listener passes the XML from the model up to the view (bubbles it up for you Flex2 people). The view then renders the CF XML object as readable XML to the user agent (Spry, Flex2, Browser, etc.). Finally, there is the mach-ii.xml file. This ties everything together. If you have any Mach-II experience, this should be familiar to you. Within Spry, you simply point your dataset to "http://myserver/myMachIIApp/?event=mySpryEvent". You will need to set caching to false, or else your XML dataset will not refresh as your data, and the dyanmic file generated for it does update. Spry does not know, or care, that it is getting its data from ColdFusion, .Net, PHP, or wherever. As long as the XPath is defined an the XML is good, Spry is happy. Please take some time to look over these files and try some dynamic xml generation within your Mach-II applications. If you have any questions, please feel free to post them in the comments section below.

Posted in ColdFusion | Flex | Spry | Mach-II | 0 comments