Can you try setting the labelField to “name”?  Your XML is not formatted in the way the Menu expects so you may need to use a labelField or a labelFunction to get it formatted correctly.

 

Matt

 


From: nithya karthik [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 12, 2005 11:14 PM
To: flexcoders@yahoogroups.com; [EMAIL PROTECTED]
Subject: [flexcoders] Menubar control Anybody?

 

I use tab navigator container to display the category names and the menubar to display the subcategories under each tab.. the menu bar should appear if and only if there is any subcategory under the selected tab.. but the problm with my coe is that it displays a menubar with label- 'undefined' when there is no subcategory... when there is a subcategory it displays   "[object object], 1,, [object object], null" when it is clicked.. i want to avoid this.. Please give me the code for this.. herewith i am giving the XML file code and the coresponding MXML code..

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" height="500">
 <mx:TabNavigator id="tab" tabWidth="100" width="100%" height="400" verticalGap="0" marginTop="0" fillColors="[#9999FF,#D8DAFA]" selectedFillColors="[#9966FF,#DFBFFF]">
 
 <mx:Script>
  <![CDATA[
  var dataObject : Object;
  ]]>
 </mx:Script>
 
  
  <mx:Repeater id="subcaty" dataProvider="{dataObject}">
      <mx:VBox id="vb" label="{subcaty.currentItem.name}" width="100%" height="325">
                <mx:MenuBar id="menu1"  width="100%" dataProvider="{subcaty.currentItem}" labelField="name"   />
      </mx:VBox>
  </mx:Repeater>
  
 </mx:TabNavigator>
</mx:Panel>

the XML:

<Category>
 <Id>1</Id>
 <Name>Artistry™ Skin Care and Cosmetics</Name>
 <Description> A full range of basic to speciality skin care treatments made with the highest quality formulations to meet the needs of women today as well as a spectrum of colour for both background and feature cosmetics to match any mood or occasion.TRY™ is among the world's top five, largest selling, prestige brands of facial skincare and cosmetics. Based on a 2000 Euromonitor International study of estimated global retail sales.
 </Description>
 <Image>homephoto.jpg</Image>
 
 <Subcategory>
  <Id>1</Id> 
  <Name>Dry-Skin</Name>
  <Description>Testing jaxb</Description>
  <item>123.xml</item>
 </Subcategory>

 <Subcategory>
  <Id> 2 </Id> 
  <Name>Normal Skin</Name>
  <Description> Testing jaxb</Description>
  <Subcategory>
   <Id> 121 </Id>  
   <Name>Aqua</Name>
   <Description> Testing jaxb2</Description>
   <item> 124.xml </item>
  </Subcategory>
  <Subcategory>
   <Id> 13 </Id>  
   <Name>Non-Aqua</Name>
   <Description> Testing jaxb3</Description>
   <item> 124.xml </item>
  </Subcategory>
 </Subcategory>
 
  <Subcategory>
  <Id>3</Id> 
  <Name>Oily-Skin</Name>
  <Description>Testing jaxb</Description>
  <item>125.xml</item>
  </Subcategory>
  
  <Subcategory>
  <Id>4</Id> 
  <Name>Sensitive-Skin</Name>
  <Description>Testing jaxb</Description>
  <item>126.xml</item>
  </Subcategory>

</Category>


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now



Yahoo! Groups Links

Reply via email to