{"id":151,"date":"2007-09-18T10:35:04","date_gmt":"2007-09-18T18:35:04","guid":{"rendered":"http:\/\/dougmccune.com\/blog\/2007\/09\/18\/using-complex-headers-with-the-flex-accordion\/"},"modified":"2008-11-02T14:10:08","modified_gmt":"2008-11-02T22:10:08","slug":"using-complex-headers-with-the-flex-accordion","status":"publish","type":"post","link":"https:\/\/dougmccune.com\/blog\/2007\/09\/18\/using-complex-headers-with-the-flex-accordion\/","title":{"rendered":"Using complex headers with the Flex Accordion"},"content":{"rendered":"<p>Here&#8217;s an example of how to use complex UI components for the header renderers of a Flex <a href=\"http:\/\/livedocs.adobe.com\/flex\/2\/langref\/mx\/containers\/Accordion.html\">Accordion<\/a> component. Normally the Accordion only allows you to specify a Button as the header renderer, and any customization still requires you to subclass Button, so it&#8217;s hard to get full control over the headers. The <a href=\"http:\/\/flexlib.googlecode.com\/svn\/trunk\/docs\/flexlib\/controls\/CanvasButton.html\">CanvasButton<\/a> component in <a href=\"http:\/\/flexlib.net\">FlexLib<\/a> is an extension of Button that acts like Canvas, which means that it subclasses Button but allows you to easily add children via MXML. <\/p>\n<p>I&#8217;ve created a special extension of CanvasButton that is specifically for use as a header renderer in an Accordion. The new <a href=\"http:\/\/flexlib.googlecode.com\/svn\/trunk\/docs\/flexlib\/containers\/accordionClasses\/CanvasButtonAccordionHeader.html\">CanvasButtonAccordionHeader<\/a> (nice name huh?) is now in the FlexLib <a href=\"http:\/\/code.google.com\/p\/flexlib\/source\">SVN repository<\/a>. Note that this is in the FlexLib SVN repository but is not in the zip distribution on the main FlexLib page yet, once we get a few more updates I&#8217;ll update the .zip distribution. For now you&#8217;ll have to get the source from the repository.<\/p>\n<p>The example below shows using a header renderer for the Accordion that display a ComboBox and a CheckBox in the header. The point here is that since you&#8217;re effectively using a Canvas as the header, you can easily add whatever UI components to the headers that you want.<\/p>\n<p><a href=\"http:\/\/flexlib.googlecode.com\/svn\/trunk\/examples\/CanvasButtonAccordionHeader\/\">Browse the MXML source of this example<\/a>.<br \/>\n<div id=\"swfa5a41\">This movie requires Flash Player 9.<\/div>\n<script type=\"text\/javascript\">\n\tswfobject.embedSWF(\"http:\/\/flexlib.googlecode.com\/svn\/trunk\/examples\/CanvasButtonAccordionHeader\/CanvasButtonAccordionHeader_Sample.swf\", \"swfa5a41\", \"450\", \"450\", \"9.0.0\", \"\", {}, {wmode: \"window\", menu: \"false\", quality: \"high\", bgcolor: \"#FFFFFF\", allowScriptAccess: \"always\"}, {});\n<\/script>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s an example of how to use complex UI components for the header renderers of a Flex Accordion component. Normally the Accordion only allows you to specify a Button as the header renderer, and any customization still requires you to subclass Button, so it&#8217;s hard to get full control over the headers. The CanvasButton component [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[3],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-flex","tag-flexlib"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":2,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":352,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions\/352"}],"wp:attachment":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}