Skip to main content
Participant
July 31, 2008
Question

iconFunction field for NavBar

  • July 31, 2008
  • 4 replies
  • 678 views
So for the past day or so I have been looking for a way to either highlight or put an icon in front of items in a LinkBar for certain items in a dataProvider. For instance in the LinkBar I wanted to highlight certain links that had a property set to true in the value object that I bound to the LinkBar.

For the LinkBar you can specify a labelField and labelFunction, but for icons you can only specify an iconField. To me that seems wrong, like an omission that someone accidentally overlooked. Does anyone have a workaround or know why you can't specify an iconFunction like you can in other components?

I went ahead and posted an issue in the bug system: https://bugs.adobe.com/jira/browse/SDK-16296 to see if that garnered any response.

Sorry if this is the wrong place. The message is more for discussion about adding the iconFunction to the NavBar class so the nav controls all can use it.
This topic has been closed for replies.

4 replies

Participant
July 31, 2008
So here is a work around. If you are binding a value object to the LinkBar you can specify a:

public function get icon():Class

function to return an icon based on data in the value object. It isn't ideal, but it works.
Participating Frequently
July 31, 2008
<div class=Section1><br /><br /><p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:<br />10.0pt;font-family:Arial;color:navy'>From the label, if the labels are unique,<br />you can get back to the item.  Not efficient, but might work.<o:p></o:p></span></font></p><br /><br /><p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:<br />10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p><br /><br /><div><br /><br /><div class=MsoNormal align=center style='text-align:center'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'><br /><br /><hr size=2 width="100%" align=center tabindex=-1><br /><br /></span></font></div><br /><br /><p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;<br />font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2<br />face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> G. Patrick<br />McDaniel [mailto:member@adobeforums.com] <br><br /><b><span style='font-weight:bold'>Sent:</span></b> Thursday, July 31, 2008<br />10:39 AM<br><br /><b><span style='font-weight:bold'>To:</span></b> flexsdk-dev@adobeforums.com<br><br /><b><span style='font-weight:bold'>Subject:</span></b> Re: iconFunction field<br />for NavBar</span></font><o:p></o:p></p><br /><br /></div><br /><br /><p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:<br />12.0pt'><o:p> </o:p></span></font></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'>A new message was posted<br />by G. Patrick McDaniel in <br><br /><br><br /><b><span style='font-weight:bold'>Developers</span></b> --<br><br />  iconFunction field for NavBar<br><br /><br><br />I thought the same thing, but createNavItem only gets passed a label and icon<br />so there is no way to access (or at least from what I can see) the data to send<br />it to an iconFunction. The label and icon are both decided in createNavChildren<br />which sadly is a private function. From reading through the classes it seems<br />like an easy change. Might fill out the paper work and submit a patch. <o:p></o:p></span></font></p><br /><br /><div class=MsoNormal><font size=3 face="Times New Roman"><span<br />style='font-size:12.0pt'><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></span></font></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b5fdd5/1">iconFunction field for<br />NavBar</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b5fdd5!folder=.3c060fa3">unsubscribe</a><br />form to cancel your email subscription.<o:p></o:p></span></font></p><br /><br /></div>
Participant
July 31, 2008
I thought the same thing, but createNavItem only gets passed a label and icon so there is no way to access (or at least from what I can see) the data to send it to an iconFunction. The label and icon are both decided in createNavChildren which sadly is a private function. From reading through the classes it seems like an easy change. Might fill out the paper work and submit a patch.
Participating Frequently
July 31, 2008
<div class=Section1><br /><br /><p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:<br />10.0pt;font-family:Arial;color:navy'>I think you&#8217;re taking the right<br />steps.  Having a bug in JIRA will help us track and prioritize.  Seems like<br />there should be an iconFunction for NavBar.  You can probably workaround it by<br />overriding createNavItem<o:p></o:p></span></font></p><br /><br /><p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:<br />10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p><br /><br /><div><br /><br /><div class=MsoNormal align=center style='text-align:center'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'><br /><br /><hr size=2 width="100%" align=center tabindex=-1><br /><br /></span></font></div><br /><br /><p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;<br />font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2<br />face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> G. Patrick<br />McDaniel [mailto:member@adobeforums.com] <br><br /><b><span style='font-weight:bold'>Sent:</span></b> Thursday, July 31, 2008 7:23<br />AM<br><br /><b><span style='font-weight:bold'>To:</span></b> flexsdk-dev@adobeforums.com<br><br /><b><span style='font-weight:bold'>Subject:</span></b> iconFunction field for<br />NavBar</span></font><o:p></o:p></p><br /><br /></div><br /><br /><p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:<br />12.0pt'><o:p> </o:p></span></font></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'>A new discussion was<br />started by G. Patrick McDaniel in <br><br /><br><br /><b><span style='font-weight:bold'>Developers</span></b> --<br><br />  iconFunction field for NavBar<br><br /><br><br />So for the past day or so I have been looking for a way to either highlight or<br />put an icon in front of items in a LinkBar for certain items in a dataProvider.<br />For instance in the LinkBar I wanted to highlight certain links that had a<br />property set to true in the value object that I bound to the LinkBar. <br><br /><br><br />For the LinkBar you can specify a labelField and labelFunction, but for icons<br />you can only specify an iconField. To me that seems wrong, like an omission<br />that someone accidentally overlooked. Does anyone have a workaround or know why<br />you can't specify an iconFunction like you can in other components? <br><br /><br><br />I went ahead and posted an issue in the bug system: <a<br />href="https://bugs.adobe.com/jira/browse/SDK-16296">https://bugs.adobe.com/jira/browse/SDK-16296</a><br />to see if that garnered any response. <br><br /><br><br />Sorry if this is the wrong place. The message is more for discussion about<br />adding the iconFunction to the NavBar class so the nav controls all can use it.<br /><o:p></o:p></span></font></p><br /><br /><div class=MsoNormal><font size=3 face="Times New Roman"><span<br />style='font-size:12.0pt'><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></span></font></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b5fdd5">iconFunction field for<br />NavBar</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b5fdd5!folder=.3c060fa3">unsubscribe</a><br />form to cancel your email subscription.<o:p></o:p></span></font></p><br /><br /></div>