Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313354
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:06:20+00:00 2026-05-17T22:06:20+00:00

probably a newbie question, but after looking through the ‘net, still cannot find an

  • 0

probably a newbie question, but after looking through the ‘net, still cannot find an answer… I have an XML object like this:

<questionpools>
 <questionpool id="1">
  <name>Sample test bank</name>
  <description>This is a Sample test bank description</description>
  <createdate>2010.10.10</createdate>
  <moddate>2010.10.11</moddate>
  <createdby>testuser</createdby>
  <modby>testuser</modby>
</questionpool>
<questionpool id="2">
  <name>alme</name>
  <description>newpool</description>
  <createdate>2010.10.31</createdate>
  <moddate>2010.10.31</moddate>
  <createdby>testuser</createdby>
  <modby>testuser</modby>
</questionpool>
<questionpool id="9">
  <name>pool_new</name>
  <description>newpool</description>
  <createdate>2010.10.31</createdate>
  <moddate>2010.10.31</moddate>
  <createdby>testuser</createdby>
  <modby>testuser</modby>
</questionpool>

I load this file to an XML variable:

var poolMenuXML:XMLList = questionpoolsXML.questionpools;
poolMenu = new XMLListCollection(poolMenuXML.children());

and bind the ‘name’ node to a dropdown’s label field

<s:DropDownList id="s_poolnumber" dataProvider="{poolMenu}" labelField="name"></s:DropDownList>

but how to add the id attribute as the ‘data’ field of the dropdown so when an item is selected, it returns that field?

Shall I create a custom component that uses the @id attribute as the source of the ‘data’ values? (I’ve also tried to add a node thinking that might help but unfortunately that does not work either…)

thanks
peter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:06:21+00:00Added an answer on May 17, 2026 at 10:06 pm

    Pass whole object and fetch id attribute later. See onDropDownListChange method

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application 
        minHeight="600"
        minWidth="955"
        creationComplete="application1_creationCompleteHandler(event)"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx">
    
        <fx:Script>
            <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.events.FlexEvent;
    
                import spark.events.IndexChangeEvent;
    
                [Bindable] private var poolMenu:XMLListCollection;
    
                private var questionpoolsXML:XML = <questionpools>
                        <questionpool id="1">
                            <name>Sample test bank</name>
                            <description>This is a Sample test bank description</description>
                            <createdate>2010.10.10</createdate>
                            <moddate>2010.10.11</moddate>
                            <createdby>testuser</createdby>
                            <modby>testuser</modby>
                        </questionpool>
                        <questionpool id="2">
                            <name>alme</name>
                            <description>newpool</description>
                            <createdate>2010.10.31</createdate>
                            <moddate>2010.10.31</moddate>
                            <createdby>testuser</createdby>
                            <modby>testuser</modby>
                        </questionpool>
                        <questionpool id="9">
                            <name>pool_new</name>
                            <description>newpool</description>
                            <createdate>2010.10.31</createdate>
                            <moddate>2010.10.31</moddate>
                            <createdby>testuser</createdby>
                            <modby>testuser</modby>
                        </questionpool>
                    </questionpools>;
    
                private function application1_creationCompleteHandler(event:FlexEvent):void
                {
                    poolMenu = new XMLListCollection(questionpoolsXML.children());
                }
    
                private function onDropDownListChange(event:IndexChangeEvent):void
                {
                    trace(s_poolnumber.selectedItem.@id);
                }
            ]]>
        </fx:Script>
    
        <s:DropDownList id="s_poolnumber"
            dataProvider="{poolMenu}"
            labelField="name"
            change="onDropDownListChange(event)"/>
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Probably a very newbie question but, Ive been reading around and have found some
Probably this is a newbie question :) But I have some Flash games built
Probably a newbie question, but everyone seems to use e.printStackTrace() , but I have
I'm a bit new to Rails/RSpec/Capybara, so this is probably a newbie question, but
This is probably a really newbie question (well, I'm pretty sure it is), but
I realize this is probably a hopelessly newbie question, but what is the difference
Newbie here with a frustrating, but probably simple question. I am trying to write
This is probably a newbie question, but is it possible to add a sprite
This is probably a newbie question, but I can't seem to think of a
I know this is probably a newbie question, but is it possible to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.