LinkBar was meant to be used with a ViewStack

I had to read the source code for LinkBar and its parent NavBar to understand why my LinkBar wasn’t highlighting the clicked item. Turns out, it’s because I use an ArrayCollection as a dataProvider. According to the documentation and the source code, it is possible to use an IList (such as an ArrayCollection), a String (that refers to a ViewStack in the current document) or an actual ViewStack object. But, when a selection occurs,┬áLinkBar makes sure that we supplied a ViewStack before allowing the highlight.

Why, I have no idea. All I know is that I want to use an ArrayCollection as my dataProvider and still highlight clicked elements. I extended the LinkBar component with a tiny workaround. Feel free to use it as you wish.

StacklessLinkBar – forgive me if you find the name unoriginal.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">