Binding Datagrid XML Data
Hi,
Summary: I cannot get my DataGrid binding with XML data.
Specifically, I cannot bind a DataGridColumn with a child of a
child using the dataField property. However, I can bind with a
direct child.
I'm currently building an application where I retrieve data
from a XML database and contact it through posting a XQuery to the
database. I set the resultFormat of my HTTPServer to "e4x".
quote:
<mx:HTTPService id="searchRequest" url="
http://localhost:8080/exist/rest/db/"
contentType="application/xml" useProxy="false"
method="POST" resultFormat="e4x" />
I receive this data:
quote:
<exist:result exist:hits="1" exist:start="1"
exist:count="1" xmlns:exist="
http://exist.sourceforge.net/NS/exist">
<schedule>
<tournament>
<sport>Testing Our DTD</sport>
<tname>Well-formed Document</tname>
<match>
<mdate>Oct. 12, 2007</mdate>
<competitor>
<cname>sd</cname>
<score>2</score>
</competitor>
<competitor>
<cname>sdgs</cname>
<score>3</score>
</competitor>
<location>
<city>San Luis Obispo</city>
<state>CA</state>
<country>USA</country>
<stadium>Test Stadium, OPTIONAL</stadium>
</location>
<tv>SVN</tv>
<description>Basic testing...</description>
</match>
</tournament>
</schedule>
</exist:result>
I receive the data fine however, I cannot nested
elements of the XML nodes I retrieve. Here is my data grid.
quote:
<mx:DataGrid id="grid" width="446" height="100%"
dataProvider="{searchRequest.lastResult.schedule.tournament.match}"
enabled="true">
<mx:columns>
<mx:DataGridColumn headerText="Tournament" />
<mx:DataGridColumn headerText="Match Date"
dataField="mdate" />
<mx:DataGridColumn headerText="Sport" />
<mx:DataGridColumn headerText="City"
dataField="location.city"/>
<mx:DataGridColumn headerText="State"
dataField="location.state"/>
</mx:columns>
</mx:DataGrid>
The 'mdate' shows up however, 'location.city'
and 'location.state' do not. I am not sure how the dataField works.
Does it get the 'current' node and allow me to drill down in the
XML node?
I will note that I can get it working with a labelFunction
and an ItemRenderer. I feel that using either of those methods for
this is a bit verbose.
The default DGColumn picks up the property value by doing
data[dataField]. Due to this the nested value would not be picked
up.
By extending DGColumn and overriding the itemToLabel function
it is possible to get the desired functionality by adding code to
detect "field1.field2" kind of dataField value and returning the
nested value.
This custom DGColumn can be used whererever the functionality
is desired.
Similar Messages
-
Schema binding versus XML data binding
I have been able to create a fillable XFA form using XML data and employing the xfa.host.importData(""); script.
This has worked well.
I now find that I must do a similar thing - only using a schema to bind the data to the PDF form fields ...
Can you help me to find out what the differences are between these two approaches and alos can you help me to find some good documentation on how to perform this ?
thanksI noticed that the default scripting language was set to formcalc - and by chabging this to javascript - I no longer get this error -
I have moved on to my next error -
which is: the data doesn't at all load as expected -
This particular form is only slightly more complicated d than my last loadable form but, truly , the only difference between them, really, is using I am using a schema for this particular form and my previous form didn't and that one works fine and functions perfectly - (this one .... no!)
I could probably skip the schema and proceed without it but that would defeat the whole purpose of using the schema in the first place so it is not really an option .
some data loads as the default of zero - is it possible for you to review this pdf for me? - just to get me past this hurdle.
The schema is good - and the data as well.
I would appreciate it .
Thanks -
Binding an XML file into LiveCycle
Currently we are using a .dat file to populate a .docx file, but we are having issues with layout and formatting and I want to switch it to using a PDF.
I have found lots of information on adding an XML Data Connection to a PDF, but nothing to do with troubleshooting. I created a simple XML file with three fields and I was able to connect it to a dynamic PDF and then generate the fields into the document. Now when I preview the PDF the values dont fill in, nor when I open it in Reader.
I have tested this on Designer ES2 and ES3 and Reader X.
I cant seem to find a way to attach the XML and PDF, but i will include the XML for reference:
<?xml version="1.0" encoding="UTF-8" ?>
<draft>
<number>100040</number>
<entered>02-18-2015</entered>
<name>Name</name>
</draft>Hello,
I believe I spoke too soon, the data now binds when I Preview the PDF in LiveCycle, but when I save it and then open it in Acrobat Pro or Reader, it does not bind the XML data in.
Any help is appreciated.
Ian -
DataGrid does not display XML data
Hello, and thanks for reading this...
I am having a problem displaying XMLList data in a DataGrid.
The data is coming from a Tree control, which is receiving it
from a database using HTTPService.
The data is a list of "Job Orders" from a MySQL database,
being formatted as XML by a PHP page.
If it would be helpful to see the actual XML, a sample is
here:
http://www.anaheimwib.com/_login/get_all_orders_test2.php
All is going well until I get to the DataGrid, which doesn't
display the data, although I know it is there as I can see it in
debug mode. I've checked the dataField property of the appropriate
DataGrid column, and it appears correct.
Following is a summary of the relevant code.
...An HTTPService named "get_all_job_orders" retrieves
records from a MySQL database via PHP...
...Results are formatted as E4X:
HTTPService resultFormat="e4x"
...An XMLListCollection's source property is set to the
returned E4X XML results:
...The "order" node is what is being used as the top-level of
the XML data.
<mx:XMLListCollection id="jobOrdersReviewXMLList"
source="{get_all_job_orders.lastResult.order}"/>
...The "jobOrdersReviewXMLList" collection is assigned to be
the dataProvider property of a Tree list, using the @name syntax to
display the nodes correctly, and a change event function is defined
to add the records to a DataGrid on a separate Component for
viewing the XML records:
<mx:Tree dataProvider="{jobOrdersReviewXMLList}"
labelField="@name"
change="jobPosForm.addTreePositionsToDG(event)"/>
...Here is the relevant "jobPosForm" code (the Job Positions
Form, a separate Component based on a Form) :
...A variable is declared:
[Bindable]
public var positionsArray:XMLList;
...The variable is initialized on CreationComplete event of
the Form:
positionsArray = new XMLList;
...The Tree's change event function is defined within the
"jobPosForm" Component.
...Clicking on a Tree node fires the Change event.
...This passes an event object to the function.
...This event object contains the XML from the selected Tree
node.
...The Tree node's XML data is passed into the positionsArray
XMLList.
...This array is the dataProvider for the DataGrid, as you
will see in the following block.
public function addTreePositionsToDG(event:Event):void{
this.positionsArray = selectedNode.positions.position;
...A datagrid has its dataProvider is bound to
positionsArray.
...(I will only show one column defined here for brevity.)
...This column has its dataField property set to "POS_TITLE",
a field in the returned XML record:
<mx:DataGrid width="100%" variableRowHeight="true"
height="75%" id="dgPositions"
dataProvider="{positionsArray}" editable="false">
<mx:columns>
<mx:DataGridColumn width="25" headerText="Position Title"
dataField="POS_TITLE"/>
</mx:columns>
</mx:DataGrid>
In debug mode, I can examine the datagrid's dataProvider
property, and see that the correct XML data from the Tree control
is present. However, The datagrid does not display the data in any
of its 6 columns.
Does anyone have any advice?
Thanks for your time.Hello again,
I came up with a method of populating the DataGrid from the
selected Item of a Tree Control which displays complex XML data and
XML attributes. After the user clicks on a Tree branch, I call this
function:
public function addTreePositionsToDG(event:Event):void{
//Retrieve all "position" nodes from tree.
//Loop thru each Position.
//Add Position data to the positionsArray Array Collection.
//The DataGrid dataprovider is bound to this array, and will
be updated.
positionsArray = new ArrayCollection();
var selectedNode:Object=event.target.selectedItem;//Contains
entire branch.
for each (var position:XML in
selectedNode.positions.position){
var posArray:Array = new Array();
posArray.PK_POSITIONID = position.@PK_POSITIONID;
posArray.FK_ORDERID = position.@FK_ORDERID;
posArray.POS_TITLE = position.@POS_TITLE;
posArray.NUM_YOUTH = position.@NUM_YOUTH;
posArray.AGE_1617 = position.@AGE_1617;
posArray.AGE_1821 = position.@AGE_1821;
posArray.HOURS_WK = position.@HOURS_WK;
posArray.WAGE_RANGE_FROM = position.@WAGE_RANGE_FROM;
posArray.WAGE_RANGE_TO = position.@WAGE_RANGE_TO;
posArray.JOB_DESCR = position.@JOB_DESCR;
posArray.DES_SKILLS = position.@DES_SKILLS;
positionsArray.addItem(posArray);
So, I just had to manually go through the selected Tree node,
copy each XML attribute into a simple Array, then ADD this Array to
an ArrayCollection being used as the DataProvider for the DataGrid.
It's not elegant, but it works and I don't have to use a Label
Function, which was getting way too complicated. I still think that
Flex should have an easier way of doing this. There probably is an
easier way, but the Flex documentation doesn't provide an easy path
to it.
I want to thank you, Tracy, for the all the help. I checked
out the examples you have at www.cflex.net and they are very
helpful. I bookmarked the site and will be using it as a resource
from now on. -
How do I use the Session State to manage bind variables & download xml data
I have a Report Query with more than 30 queries; many have bind variables in them. I'd like to create sample xml so that I can develop my word templates. When I try to download the XML data Source for Layout, it doesn't ask for the bind variable values.
How can I download the XML data without replacing the bind variable values in each of the queries?
Thank you.If you are using the Standalone version, then first of all make sure to UNCHECK (BIP10g 10.1.3.4.1)
"AUTO RUN" (it is under General Settings when you select your Report Definition)
Next, you should define the parameters in the corresponding parameter Section.
Its simplest form is of "Text" type so you will have to enter values at runtime.
Then these parameters can be used in your query as bind variables.
When you run the report it will prompt for parameter values. Enter these values
and you would get a sample of your XML data.
This should work and you should not find any issues.
regards
Jorge -
Date time field will not bind over into XML data file
am using the Current Date field in a form that is supposed to give me the current date & time. In the Object, Value, I am using a "calculated - Read Only" , with Run-time property of Date and Time. WHen I view this as a PDF, the current datae & time display on the form as well as when I view the body pages, the {current date/time} is displayed in the actual field of the form. My only problem is I want to bind this so I can export the data to an XML data file, to import to an Access Database. WHen I use these settings, I do not have a "binding" tab to use. WHen I change vaule to "calculation script), it then pops up the binding tab and let's me export the field to the XML data file, but the data in that field is not comming over (the date & time). The field comes into the database inport, but is blank. What am I doing wrong..?? Thanks in advance for any suggestions...
Well, I'm assuming that when you change it to a calculation script you see the date in the PDF and therefore have the script to set the value written properly. So, if you change the binding from None to Normal or an explicit binding the date will be exported in the data. If all of that is correct, then the most likely problem is the data format you are exporting is not a format that your database will accept.
Chris
Adobe Enterprise Developer Support -
Trying to bind XML data and form fields
I have a fairly simple PDF - and I am trying to bind XML data to he form fields.
In the designer I can bring up the data connection and
select Global - for the binding method - and as I understand it - this will link Form Fields and XML data fields with the same name - (sounds logical to me)
but all that happens is :
I see the name of the field in the form field rahter than seeing the actual data
should I select : None as the binding or normal ....
but Normal doesnt show Anything - even after i select it .
I can't quite seem to make this work -
Any help here would be appreciated
Thanks :)This is on a stand - alone system
Using Designer ES ......
I saved the Form as an xdp form
and it seems as if all goes well until
View the data and nothing appears - or
just the names of the fields appear -
ActionScript to bind XML data to components
How can I use ActionScript to bind XML data to a comboBox
component instead of using the component inspector? (I have done
the latter, successfully, but that doesn’t allow access to
the code - .)
My ActionScript so far imports the data (the trace picks it
up) – but the ‘cbType.dataProvider line’
doesn’t work. It works when I change the data provider to an
array – so what am I doing wrong?
MY CODE:
import mx.data.components.XMLConnector;
var xcFestival:XMLConnector = new XMLConnector();
xcFestival.ignoreWhite = true;
xcFestival.direction = "receive";
xcFestival.URL = "festivalItems.xml";
xcFestival.trigger();
//POPULATE THE COMPONENTS WITH THE DATA
var festXMLlistener:Object = new Object();
festXMLlistener.result = function(evt:Object) {
trace(xcFestival.results);
cbType.dataProvider = xcFestival.results;
xcFestival.addEventListener("result",festXMLlistener);This is on a stand - alone system
Using Designer ES ......
I saved the Form as an xdp form
and it seems as if all goes well until
View the data and nothing appears - or
just the names of the fields appear -
Query with bind var created under apex to generate xml data
Hi all;
BiP: 10.1.3.4
Apex: 4
DB 10G
Goal: want to generate a report by running a query with bind variables under apex.
problem: when attempted to create a query under shared components in apex, at the downloading xml data stage, I always get "no data found" eror. Thus I can't save xml data for further report work. This only occurs when bind var involved. I have tticked "incl. session variables" and added the item but to no avail.
Does anyone know how to do this and get the xml data to recive the bind variable ?
Thanks.
luluTo get the xml data, sql query has to return something. Why the sql is not returning anything can be better investigated outside the BI Publisher with special tool like SQL Developer or TOAD. There you have to run your query and make it working. One of the steps would be to try the sql without the parameter, see what data it brings back and go from there. One of possibilities why the parameter kills the output may be the NULL values involved, but you need to try the sql outside the BIP first.
-
Bind XML data to PDF417 barcode - LiveCycle Designer ES
Trying to create a shipping form for a supplier that contains a PDF417 barcode. The source data will come from an XML data file. The form in not interactive, the data file will simply populate the pdf form, read-only via a Coldfusion program that queries our shipping data. But I'm not quite able to connect the dots. Does anyone know how to supply the data in the correct format within the XML doc? It consists of 5 fields / row, with 10 rows max. I'm unclear because the barcode software previously used embedded control chars within the data, such as record separators, group separators, and end of transmission. Do I need to include these for LiveCycle? As you've probably already guessed, yes, I do not use LiveCycle much at all.
I'm using LiveCycle ES2 version 9
Any advice is much appreciated. Thanks!There are a couple of ways to populate the barcode from Designer. First, is the manual coding method. In the "calculate" or (preferably) the "pre-print" event you change the .rawValue of the barcode object and change it to the value of the fields you wish to include. Alternatively there is a fairly good script generator built into designer that is accesible through the barcode object properties UI. Here you can have the content of the barcode auto-filled based on the entire form or selected fields in a collection. As a general rule of thumb: never select XML as your barcode data format and don't use the auto-generated code on a form with more than 30 or 40 fields.
-
Dynamically populating more than one field using xml data binding
Hi All,<br /><br />I have the following code that works fine to dynaically populate a<br />second drop-down list2 from a choice in drop-down list1 using xml data<br />biding.<br /><br />var tempString = "xfa.record." + this.boundItem(xfa.event.newText);<br />var oItems = xfa.resolveNode(tempString);<br />var nItemsLength = oItems.nodes.length;<br /><br />myinfo.page1.state.clearItems();<br />myinfo.page1.state.rawValue = null;<br /><br />for (var nItemCount = 0; nItemCount < nItemsLength; nItemCount++)<br />{<br />myinfo.page1.state.addItem(oItems.nodes.item(nItemCount).value);<br />}<br /><br />Here is my xml file<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><myinfo><br /><country/><br /><countries><br /><item uiname="United States" token="US"/><br /><item uiname="South Africa" token="SA"/><br /><item uiname="Australia" token="AU"/><br /></countries><br /><state/><br /><AU><br /><item>Australian Capital Territory</item><br /><item>New South Wales</item><br /><item>Northern Territory</item><br /><item>Queensland</item><br /><item>South Australia</item><br /><item>Tasmania</item><br /><item>Victoria</item><br /><item>Western Australia</item><br /></AU><br /><US><br /><item>California</item><br /><item>New York</item><br /><item>Texas</item><br /><item>Michigan</item><br /><item>North Carolina</item><br /><item>South Carolina</item><br /></US><br /><SA><br /><item>Eastern Cape</item><br /><item>Free State</item><br /><item>Gauteng</item><br /><item>KwaZulu-Natal</item><br /><item>Limpopo</item><br /><item>Mpumalanga</item><br /><item>Northern Cape</item><br /><item>North-West</item><br /><item>Western Cape</item><br /></SA><br /></myinfo><br /><br />I have two questions:<br /><br />1) I want to be able to structure my xml in a way that I can populate<br />a third drop-down list3 from a choice in list2. I need to know how to<br />to include the different capital cities of the states in my xml data<br />so that they can get populated in list3 from a selection in list2;<br /><br />2) And be able to script the third list3 to get dynamically populated<br />from a choice in list2.<br /><br />Thanks in advance for your help.
I would like to ask someone for help.
I have an XML file a result of the XSLT transformation. A schema was created based on this XML and this schema is bound to a form as a data source. When I preview my form using a Preview tab with transformed XML as a Data File in LiveCycle Designer 8.1, I can see only the first form data across 3 Text fields on the form. The rest of the forms are not getting displayed. What am I doing wrong?
Here is the part of the XML file Im trying to display on the form:
FORM 1
FORM 1 DESCRIPTION
$5000
FORM 2
FORM 2 DESCRIPTION
$7000
FORM 3
FORM 3 DESCRIPTION
$4000
Part of the schema that was created based on the XML file from above:
Thank you. -
Based on the examples
here
and
here
I have a datagrid which uses an XML object as its dataprovider. The
xml goes like this:
<questions>
<question>
<prompt>What are your heroes?</prompt>
<answers>
<answer>
<correct>true</correct>
<text>Luther Higgs</text>
</answer>
<answer>
<correct>false</correct>
<text>Barney Fife</text>
</answer>
</answers>
</question>
</questions>
Well formed (if a bit confusing) xml. In my datagrid I have
two columns. The second column binds to
questions.question.answers.answer.text and works just fine. The
datagrid's editable property is set to true, and I'm able to click
on the second colum and type and it saves the answer back into the
xml object just fine. The problem lies in my first column. The mxml
looks like this:
<mx:DataGridColumn headerText="Correct">
<mx:itemRenderer>
<mx:Component>
<mx:VBox horizontalAlign="center">
<mx:RadioButton id="myRadioButton"
buttonMode="true" useHandCursor="true"
group="{outerDocument.myRadioButtonGroup}"
selected="{data.correct}"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
The problem is that the radio buttons' selected properties
aren't bound to the xml, that is the one that is true doesn't
display as selected. If I set the datagridcolumn's editable
property to false, clicking on the radio button doesn't affect the
xml at all either. If I leave the editable property of the
datagridcolumn as the inherited default of true (based on the
parent datagrid's editable property) when I click on the radio
button the default itemEditor appears (a text input box) which
contains the following text:
</answer>
and when I leave the editor (click outside or hit enter) the
xml then looks like this:
<answers>
<answer>
<correct>true</correct>
<text>Luther Higgs</text>
</answer>
<answer>
<correct>false</correct>
<text>Barney Fife</text>
<null><answer>
<correct>false</correct>
<text>Barney Fife</text>
</answer></null>
</answer>
</answers>
I have seen controls that don't have the xml path written
correctly display the entire xml node rather than just the
contained data, but I can think of no reason anything should Ever
reference just the closing tag. To me this looks like a bug in the
data bindings between the radio button and the xml object.
Just to clear the air to avoid suggestions that will work but
not meet the design requirements, what I need is a datagrid that
has a radio button group (only one correct answer out of the group)
in the first column and strings in the second column which need to
be editable. I suppose I could write some hairy event listener code
and manually hack things together, but aside from avoiding that
headache, I'd love to use data bindings for what they were intended
for - I just need to know why it doesn't appear to be working
right. Much thanks in advance for any and all help.Searching the LiveDocs revealed the answer. Under the topic
"Using an E4X expression in an <mx:Binding> tag" I found that
if instead of
<mx:RadioButton id="myRadioButton"
buttonMode="true" useHandCursor="true"
group="{outerDocument.myRadioButtonGroup}"
selected="{data.correct}"/>
I have
<mx:RadioButton id="myRadioButton"
buttonMode="true" useHandCursor="true"
group="{outerDocument.myRadioButtonGroup}"/>
<mx:Binding source="myRadioButton.selected"
destination="data.correct" />
It works just perfectly.
Apparently binding between XML and the selected property of a
radio button (which is of type boolean) needs the <mx:Binding
/> rather than the in-tag curly brace notation.
P.S. The link on livedocs is here:
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=databinding_091_05.html#177459 -
DataSets, DataGrid, XML Oh My
OK -= I am sure everyone is tired of hearing about everyone
else's problems with data binding, but here is another one:)
I am using the Component Inspector to bind my XML Connector,
DataSet, and DataGrid. No matter how many times I try it, all I get
is a grid with column names.
So, what I need to know is how many bindings XML to dataSet,
and dataSet to dataGrid,.
I have tried it MANY differnet ways, but currently, I have:
XML to dataSet: dataProvider to the resu;lts Schema Array,
dataProvider to the paramater schema array, and SelectedIndex to
dataSet.
dataSet to dataGrid: dataProvider and SelectedIndex.
When I open the SWF, it shows a grid with column names and no
data. If I click on a column I get an error that reads:
Property 'Location' (or any column name) not found in schema
for dataSet 'cs_ds' can't build index.
My XML is as follows:
<?xml version="1.0" encoding="iso-8859-1"?>
<Summary>
<CallRow>
<Call>#Q500COG30</Call>
<Priority>3</Priority>
<Type>1182</Type>
<Group>PD</Group>
<Area>512</Area>
<Unit></Unit>
<From>07:10</From>
<To></To>
<Location>Datadata</Location>
</CallRow>
<CallRow>
<Call>#Q500CO232</Call>
<Priority>3</Priority>
<Type>415M</Type>
<Group>PD</Group>
<Area>112</Area>
<Unit>1A35</Unit>
<From>07:11</From>
<To></To>
<Location>datadata</Location>
</CallRow>
<CallRow>
<Call>#Q500COO32</Call>
<Priority>3</Priority>
<Type>459C</Type>
<Group>PD</Group>
<Area>582A</Area>
<Unit>312</Unit>
<From>07:11</From>
<To></To>
<Location>DATADATA</Location>
</CallRow>
</Summary>
Any ideas???
TIA
ThiaI am having similar problems and I think I can reduce the
problem a little more basically,
Conider the tutorial from Macromedia,
Data
Integration: Using XML for a Timesheet (Flash Professional
Only) which uses the XML file,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<datapacket>
<row act="10" custId="0" date="05/12/2002"
billable="true" duration="3" id="1" notes="Here is note(1)"
projId="1" rate="45.50" servId="0"/>
<row act="9" custId="0" date="05/13/2002" billable="true"
duration="8.25" id="2" notes="Here is note(2)" projId="1"
rate="45.50" servId="1"/>
<row act="8" custId="0" date="05/14/2002"
billable="false" duration="7.75" id="3" notes="Here is note(3)"
projId="1" rate="45.50" servId="1"/>
<row act="7" custId="0" date="05/15/2002"
billable="false" duration="6.5" id="4" notes="Here is note(4)"
projId="1" rate="45.50" servId="2"/>
<row act="6" custId="0" date="05/16/2002"
billable="false" duration="5.5" id="5" notes="Here is note(5)"
projId="1" rate="45.50" servId="2"/>
</datapacket>
The tutorial carefully steps you through the process of
creating the Bindings and the Schema in all three components. But
now I'd like to try my own XML file and DataGrid, but my XML file
is a little different. Here is a sample of what I am looking at,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ROOT SYSTEM "CountrySample.dtd">
<ROOT>
<row>
<field name="Code">AFG</field>
<field name="Name">Afghanistan</field>
<field name="Continent">Asia</field>
</row>
<row>
<field name="Code">NLD</field>
<field name="Name">Netherlands</field>
<field name="Continent">Europe</field>
</row>
<row>
<field name="Code">ANT</field>
<field name="Name">Netherlands Antilles</field>
<field name="Continent">North America</field>
</row>
<row>
<field name="Code">ALB</field>
<field name="Name">Albania</field>
<field name="Continent">Europe</field>
</row>
<row>
<field name="Code">DZA</field>
<field name="Name">Algeria</field>
<field name="Continent">Africa</field>
</row>
</ROOT>
In the Macromedia tutorial, the data are attributes in the
row element and the field names are the attribute names. In my
example the child element is the field and the field name is the
attribute "name".
I can find no documentation to help make the transition from
the demonstrated XML to this other schema. I haven't the slightest
idea what to do.
How do you apply the Component Inspector and the Properties
windows for XMLConnector, DataSet and DataGrid to display this data
in the DataGrid? -
How to search XML data from a HTTPMultiService and display the result on the Spark List
Hello all,
I am totally new to Flash Builder and Actionscript and hope someone might be able to help me out. I basically create a mobile app with a single view. The view has a TextInput as a search box and a search button. I conntected a Data/Service using a local XML file and bind the Data to a Spark List. Innitally the List will show nothing until the user enter the search term and hit the button. The List suppose to show the XML data that match the search term.
Now is my problem. I cannot make the List to show the data that match the search text. The List just shows ALL the data.
Here are my MXML code:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:shopping="services.shopping.*"
title="Search">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function button1_clickHandler(event:MouseEvent):void
navigator.popView();
protected function list_creationCompleteHandler(event:FlexEvent):void
getDataResult.token = shopping.getData();
protected function seach_clickHandler(event:MouseEvent):void
getDataResult.token = shopping.getSearchData(searchTxt.text);
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getDataResult"/>
<shopping:Shopping id="shopping"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:actionContent>
<s:Button height="79" label="Back" click="button1_clickHandler(event)"/>
</s:actionContent>
<s:List id="list" left="0" right="0" top="111" bottom="0"
creationComplete="list_creationCompleteHandler(event)" labelField="english">
<s:AsyncListView list="{getDataResult.lastResult}"/>
</s:List>
<s:TextInput id="searchTxt" x="80" y="34" width="250" height="49" enabled="true"
prompt="search..."/>
<s:Button id="search" x="338" y="35" width="72" height="49" label="s"
click="seach_clickHandler(event)"/>
</s:View>
Here is the _Super_Shopping.as file:
* This is a generated class and is not intended for modification. To customize behavior
* of this service wrapper you may modify the generated sub-class of this class - Shopping.as.
package services.shopping
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.services.wrapper.HTTPServiceWrapper;
import com.adobe.serializers.xml.XMLSerializationFilter;
import mx.rpc.AbstractOperation;
import mx.rpc.AsyncToken;
import mx.rpc.http.HTTPMultiService;
import mx.rpc.http.Operation;
import valueObjects.Shop;
[ExcludeClass]
internal class _Super_Shopping extends com.adobe.fiber.services.wrapper.HTTPServiceWrapper
private static var serializer0:XMLSerializationFilter = new XMLSerializationFilter();
// Constructor
public function _Super_Shopping()
// initialize service control
_serviceControl = new mx.rpc.http.HTTPMultiService();
var operations:Array = new Array();
var operation:mx.rpc.http.Operation;
var argsArray:Array;
operation = new mx.rpc.http.Operation(null, "getData");
operation.url = "assets/data/shopping.xml";
operation.method = "GET";
operation.serializationFilter = serializer0;
operation.properties = new Object();
operation.properties["xPath"] = "/::shop";
operation.resultElementType = valueObjects.Shop;
operations.push(operation);
operation = new mx.rpc.http.Operation(null, "getSearchData");
operation.url = "assets/data/shopping.xml";
operation.method = "GET";
operation.resultFormat = "text";
argsArray = new Array("item");
operation.argumentNames = argsArray;
operation.properties = new Object();
operation.properties["xPath"] = "/::shop";
operation.resultElementType = valueObjects.Shop;
operations.push(operation);
_serviceControl.operationList = operations;
preInitializeService();
model_internal::initialize();
//init initialization routine here, child class to override
protected function preInitializeService():void
* This method is a generated wrapper used to call the 'getData' operation. It returns an mx.rpc.AsyncToken whose
* result property will be populated with the result of the operation when the server response is received.
* To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
* You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
* @see mx.rpc.AsyncToken
* @see mx.rpc.CallResponder
* @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
public function getData() : mx.rpc.AsyncToken
var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getData");
var _internal_token:mx.rpc.AsyncToken = _internal_operation.send() ;
return _internal_token;
public function getSearchData(item:String) : mx.rpc.AsyncToken
var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getSearchData");
var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(item);
return _internal_token;
The getSearchData() supposed to return XML data that match the search text, but it doesn't. Can anyoen help?
Thank you!Hi,
are you able to change dynamically the operation.url = "assets/data/shopping.xml";?
i need to do that based on the users input.
Thanks in advance, -
Importing XML Data Back into the Form
I have a form that shows several subforms based on the selections the user has made while filling in the form. This is working quite well but when I import the XML data back into the form it doesn't show the subforms that have been used.
Is there an easy way to change this?
Thanks in advance!
EmmaActually the issue may actually have to do with the fact that the connections aren't bound, but I haven't seen the data.
I have some fairly complex forms that include both subforms and instances, have an XSD embedded and export as XML. When I import the data, everythi
Now, that being said...
Are your subforms "hidden" and you opt to display them upon selection of a radio button for example, or do you SetInstances()? If you're using visible=TRUE or FALSE, that may also cause some issues.
Try this -- on Form:ready try this code:
if(this.rawValue == "on"){ //this radio button 1
_subform1.setInstances(1);
_subform2.setInstances(0);
_subform3.setInstances(0);
else if(this.rawValue == "on"){ //this radio button 1
_subform1.setInstances(0);
_subform2.setInstances(1);
_subform3.setInstances(0);
else if(this.rawValue == "on"){ //this radio button 1
_subform1.setInstances(0);
_subform2.setInstances(0);
_subform3.setInstances(1);
else { // this is fisrt time open -- i sometimes had issues with subforms being visible on first entry
_subform1.setInstances(0);
_subform2.setInstances(0);
_subform3.setInstances(0);
Then on:Click essentially copy most of the code you put in form:ready
if(this.rawValue == "on"){ //this radio button 1
_subform1.setInstances(1);
_subform2.setInstances(0);
_subform3.setInstances(0);
else if(this.rawValue == "on"){ //this radio button 1
_subform1.setInstances(0);
_subform2.setInstances(1);
_subform3.setInstances(0);
else if(this.rawValue == "on"){ //this radio button 1
_subform1.setInstances(0);
_subform2.setInstances(0);
_subform3.setInstances(1);
Of course this will go on top of your radio button group.
If you are exporting to XML, it will make your life a whole lot easier, by the way, to import an XSD and bind your nodes, especially as your forms and data start to get more complex.
Finally, you may also know this but -- unless you have Forms Server, any user that wants to export the data or import the data will need to have at least full Acrobat Professional. If you want people to be able to save data in the form but import/export isn't that important, they will need to have full Acrobat.
I hope that helps a bit. Good luck!
Lisa
Maybe you are looking for
-
Diff b/w creation of Report in Shared folder and in My folder
Dear All, May i know what's the diff b/w creation of Report in Shared folder and in My folder. Is there any features changes. Regards..
-
I'm using HP Mini 210, Windows 7 Starter. The last time I used the built-in cam was 5 days ago. I used it to record a video. No update has been made ever since, but now that I wanna use it again, it won't start. It doesn't show any image when I open
-
Hi, When I configured alert monitoring. Alert is creating when I run report SXMSALERT_PROCESS_DATA_GET. But this alert is not reflecting in the alert inbox eventhough all configuration done. Then I have gone to log then I found errors as follows. war
-
when i close the browser it ask whether you want quit or save and quit , when i selet save and quit none of te pages are saved, or if saved where can i find them?
-
Solo/Mute modes faulty in Audio Mixer
Has anyone else noticed this bug in PP CS 5.5 Audio Mixer: When you have more than 1 audio track in your sequence, you press Solo button, and all the other tracks except the one you're soloing, should mute. Alternately, if you press Mute, just that t