Nested Loops for Dynamic ComboBox -- Newbie easy fix??
I have a dynamic xml driven form that I am trying to get the "label" and "value" using nested for loops for the combobox. I am using "droplabel" attribute. The xml schema is final, I cannot change this.
I am having problem targeting the child node attributes.
I keep running into error: "A term is undefined and has no properties." I am sure I am not properly formatting the for loop statement.
<element position="1" questionlabel="What is todays time ?">
<item id="1" inputtype="TextInput">Monday</item>
<item id="222" inputtype="TextInput">tonday</item>
</element>
<element position="5" questionlabel="What is your time of arrival ?">
<item id="5" inputtype="ComboBox">
<drop droplabel="Select Answer---" dropvalue="0"></drop>
<drop droplabel="What is this" dropvalue="1" selected="true"></drop>
<drop droplabel="What is that" dropvalue="2"></drop>
</item>
</element>
<mx:Panel title="XML Driven Form -- Send Receive Data from SOA _JSP" height="90%" width="70%"
paddingTop="50" paddingBottom="10" paddingLeft="50" paddingRight="10" layout="vertical" horizontalAlign="left" verticalAlign="top" backgroundColor="#EEEFFD" borderColor="#E2E2E2" x="72.5" y="10">
<mx:Form id="userInfoForm" borderThickness="1" borderColor="#FCFAFA" borderStyle="solid" width="90%"/>
</mx:Panel>
</mx:Application>
not exactly sure of how to fix this, but i can point you in the right direction.
the advantage of using XML in flex is the ease of formatting. there's no need to use for loops to iterate through every XML node -- this is a very inefficient way of working with XML and it is a waste of using e4x formatting. if you want to access a specific node in the XML structure, become familiar with the syntax for elements, attributes, and descendants (" . ", " [email protected] ", " .. ").