Xml data using httpservice
I am trying the new Flex 3 Beta. On my local machine I am
referring to data in results.xml stored in the same folder as the
mxml. When I run the program, I get a prompt for local host, choose
cancel and my sheet with the data comes up great. Problem: if I
copy the project to put on another machine when running the program
I get an error and the screen comes up blank. The error is #2148
swf file cannot access local resource file ("even though the path
is correctly displayed!")...followed by.... Only
local-with-filesystem and trusted local SWF files may access local
resources. I am not using any local webhosting, just want to be
able to present the flex application and data on another computer.
Below is the line from my mxml file defining the HTTPService, data
comes from results.xml
<mx:HTTPService id="srv" url="results.xml"
useProxy="false" result="resultHandler(event)"/>
Don't sure about your XML structure, but for now i see the problem here between this 2 lines of code:
loadLangService.send();
btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
Think data that your httpService should receive just can't go so fast to populate the lastResult before you call it in the next line
Try adding a result listener to your service before you send it:
loadLangService.addEventListener(ResultEvent.RESULT, handler);
loadLangService.send();
function handler(event:ResultEvent):void {
btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
Similar Messages
-
How to send te XML data using HTTPS post call & receiving response in ML
ur present design does the HTTP post for XML data using PL/SQL stored procedure call to a Java program embedded in Oracle database as Oracle Java Stored procedure. The limitation with this is that we are able to do HTTP post; but with HTTPS post; we are not able to achieve because of certificates are not installed on Oracle database.
we fiond that the certificates need to be installed on Oracle apps server; not on database server. As we have to go ultimately with HTTPS post in Production environment; we are planning to shift this part of program(sending XML through HTTPS post call & receiving response in middle layer-Apps server in this case).
how i can do this plz give some solutionIf you can make the source app to an HTTP Post to the Oracle XML DB repository, and POST contains a schema based XML document you can use a trigger on the default table to validate the XML that is posted. The return message would need to be managed using a database trigger. You could raise an HTTP error which the source App would trap....
-
Hi all,
From https://www.simple-talk.com/content/print.aspx?article=1756, I mimicked to create the following sql code to do Importing XML data using a CTE:
---Importing XML data using a CTE -----Ad-Hoc XML File Query--simple-talk---1020AM 27 Feb 2015
---query the XML Blob using a CTE (pulling from the XML file each time
USE OPENXMLtesting1
GO
With XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'C:\XML FilesMicrosoft-Samples\books.xml', SINGLE BLOB) AS XmlData
SELECT
FROM XmlFile
GO
I got the following message:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'BLOB'.
I have no ideas why it is incorrect in that code statment. Please kindly help, advise and respond.
Thanks in advance,
Scott Chang
P. S. The books.xml file was copied from the Microsoft samples:
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
<book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant.</description>
</book>
<book id="bk105">
<author>Corets, Eva</author>
<title>The Sundered Grail</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-09-10</publish_date>
<description>The two daughters of Maeve, half-sisters,
battle one another for control of England. Sequel to
Oberon's Legacy.</description>
</book>
<book id="bk106">
<author>Randall, Cynthia</author>
<title>Lover Birds</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-09-02</publish_date>
<description>When Carla meets Paul at an ornithology
conference, tempers fly as feathers get ruffled.</description>
</book>
<book id="bk107">
<author>Thurman, Paula</author>
<title>Splish Splash</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-11-02</publish_date>
<description>A deep sea diver finds true love twenty
thousand leagues beneath the sea.</description>
</book>
<book id="bk108">
<author>Knorr, Stefan</author>
<title>Creepy Crawlies</title>
<genre>Horror</genre>
<price>4.95</price>
<publish_date>2000-12-06</publish_date>
<description>An anthology of horror stories about roaches,
centipedes, scorpions and other insects.</description>
</book>
<book id="bk109">
<author>Kress, Peter</author>
<title>Paradox Lost</title>
<genre>Science Fiction</genre>
<price>6.95</price>
<publish_date>2000-11-02</publish_date>
<description>After an inadvertant trip through a Heisenberg
Uncertainty Device, James Salway discovers the problems
of being quantum.</description>
</book>
<book id="bk110">
<author>O'Brien, Tim</author>
<title>Microsoft .NET: The Programming Bible</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-09</publish_date>
<description>Microsoft's .NET initiative is explored in
detail in this deep programmer's reference.</description>
</book>
<book id="bk111">
<author>O'Brien, Tim</author>
<title>MSXML3: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-01</publish_date>
<description>The Microsoft MSXML3 parser is covered in
detail, with attention to XML DOM interfaces, XSLT processing,
SAX and more.</description>
</book>
<book id="bk112">
<author>Galos, Mike</author>
<title>Visual Studio 7: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>49.95</price>
<publish_date>2001-04-16</publish_date>
<description>Microsoft Visual Studio 7 is explored in depth,
looking at how Visual Basic, Visual C++, C#, and ASP+ are
integrated into a comprehensive development
environment.</description>
</book>
</catalog>I found the mistakes I made and I corrected them. The newly revised/corrected code is:
USE OPENXMLtesting1
GO
With XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'C:\Temp\books.xml', SINGLE_BLOB) AS XmlData
SELECT *
FROM XmlFile
GO
It worked: Results
Contents
1 <catalog><book.id="bk101"><author>Gambardella.M...
If I clicked on this, I got a listing of the whole book.xml!! I don't know what it means. Please comment and respond.
Thanks,
Scott Chang -
Adobe Reader importing XML data using command line reference
Financial Gonverment in Poland prepared new VAT declarations, which are protected from changing.
Restrictions summary is as follows: Printing, Commenting, Filling of form fields: Allowed; other restrictions are not allowed.
I am able to export xml data, using Acrobat Reader, change it to have desired data and than import it and everything works fine. In ERP program I need to fill this document with data from the system. Normally we were doing this using FDF printing channel, but for this document it shows an error with bad user password. We were talking with people from government and only answer was that it is not possible to change document restrictions... We find out the way to create xml document, but we want it now to open from the command line (UNIX commands). But we only find the way to open pdf file with specified fdf file... But when I'm trying to open PDF document with specified fdf URL (url is linked to xml file... i don't know if it is proper... if not than how to create fdf file with desired xml?)
Is there any possible to open a pdf with specified xml url to load to that PDF?I found the mistakes I made and I corrected them. The newly revised/corrected code is:
USE OPENXMLtesting1
GO
With XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'C:\Temp\books.xml', SINGLE_BLOB) AS XmlData
SELECT *
FROM XmlFile
GO
It worked: Results
Contents
1 <catalog><book.id="bk101"><author>Gambardella.M...
If I clicked on this, I got a listing of the whole book.xml!! I don't know what it means. Please comment and respond.
Thanks,
Scott Chang -
Upload XML data using XSQL and HTTP Post ?
Upload XML data using XSLQ and HTTP Post: is that possible ?
An xsql contains an <xsql:insert-request table="aTable">
The XML data file follows the ROWSET/ROW paradigm.
What is the HTML form to upload the xml file to the XSQL ?
I tried:
<form action="myXSQL.xsql" method="POST" ENCTYPE="multipart/form-data">
XML data file to upload: <input type="file">
<input type="submit">
</form>
But the answer of myXSQL is:
<xsql-status action="xsql:insert-request" result="No posted document to process" />
Where is the problem ?
Thank you.Hello,
You are posting your XML file as a parameter therefore you should use the <xsql:insert-params/> tag, not the <xsql:insert-request/>. The insert-request can only handle data not posted via a parameter.
Usage:
<form action="myXSQL.xsql" method="GET" ENCTYPE="multipart/form-data">
XML data file to upload: <input type="file" name="myXML">
<input type="submit">
</form>
in combination with
<xsql>
<xsql:insert-params name="myXML" table="your table"/>
</xsql>
2 remarks:
I was not able to succesfully POST the form. The answer was <xsql-status action="xsql:insert-request" result="No posted document to process" />. With GET is was succesfull.
Second, if you use MSInternet explorer 5 or higher use could post the XML directly (not aw parameter) using an ActiveX object.
Regards,
Harm Verschuren -
How can we store xml data using jsp
hai,
Can anyone please explain in brief how to store xml data using jsp. Also if possible please explain by specifying the code.
regards,
Praveen Vinnakota.[email protected] wrote:
how can we publish Labview data using the web?
You could use shared variables and publish them to the network or use data sockets.
Kudos always welcome for helpful posts -
How to get an object of choice from XML data using XMLBean?
I have xml schema and I have generated a jar to represent my schema using XMLBean. I also have few xml data files, these are valid xml for generated schema. Now I want to write a utility which takes xml file as input and returns an object of my choice (Assuming this Object type is available in the jar) as output and vice versa. Some thing like this –
1. Object getObjectFromXML(File xmldatafile, Class classname)
xmldatafile = presents the source of XML data
classname = an object of this class type as output filled from the xml data.
2. String getXMLStrFromObject(Object)
Pass Object and get XML as String output
Any pointer?
Thanks,Hi! Maybe have a look at the documentation for XmlObject.Factory.parse(). It should allow you what you need to do.
Cheers,
G. -
How to convert MS SQL Server data to XML data using Java
Hi all!
How do I generate XML document for SQL Server data using java / jsp.
Thanks in advancehttp://www.fdsapi.com
-
Variable indent based on xml data using xsl-fo start-indent
I am trying to make a report of a peoplesoft tree which includes xml data to indicate the level of the tree.
I have a template which sort-of works but has some strange behavior. First I set a variable to the value of the treelevel, and multiply by ten to set the value for the indent that I want. I then apply that value for the indent to the start-indent attribute
<?xdoxslt:set_variable($_XDOCTX, 'x', (fld_TREE_LEVEL_NUM)*10)?>
<xsl:attribute name="start-indent" xdofo:ctx="table-cell"><?xdoxslt:get_variable($_XDOCTX, 'x')?></xsl:attribute>
These tags are put in a table row which repeats within a for-each group along with the data to get indented.
The problem is that the indenting seems to work but not consistently and some rows which clearly have different indent levels are printing as if they are at the same level.
Any ideas would be appreciated.Hi! Use xsl:variable:
<xsl:variable name="var"><?fld_TREE_LEVEL_NUM*10?></xsl:variable>
<xsl:attribute name="start-indent" xdofo:ctx="table-cell"><xsl:value-of select="$var" /></xsl:attribute> -
Free order of tags when deserialising XML-data using Simple Transformatiosn
Hi everybody,
I'm consuming a WebService and get something like this XML-data in the response:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getSalesResponse>
<getSalesReturn href="#id0"/>
</getSalesResponse>
<multiRef id="id0">
<customer href="#id1"/>
<salesOrg href="#id2"/>
<salesRecord soapenc:arrayType="SalesRecord[2]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<salesRecord href="#id3"/>
<salesRecord href="#id4"/>
</salesRecord>
</multiRef>
<multiRef id="id1"><customer>124843</customer></multiRef>
<multiRef id="id2"><salesOrg>0001</salesOrg></multiRef>
<multiRef id="id3"><material>mat1</material></multiRef>
<multiRef id="id4"><material>mat2</material></multiRef>
</soapenv:Body>
</soapenv:Envelope>
</xml>
I've written a Simple Transformation: it fills my fields i_customer, i_salesorg, i_mat1 and i_mat2 from this XML-Data from the content of the <multiRef>-tags. But only if the order is exactly like this:
<multiRef><customer><tt:value ref="I_CUSTOMER"/>
</customer></multiRef>
<multiRef><salesOrg><tt:value ref="I_SALESORG"/>
</salesOrg></multiRef>
<multiRef><material><tt:value ref="I_MATERIAL1"/>
</material></multiRef>
<multiRef><material><tt:value ref="I_MATERIAL2"/>
</material></multiRef>
However the WebService doesn't guarantee a certain order for the <multiRef>-tags. That means the salesOrg could be contained ahead of the customer.
In a next step I've tried to use the command '<tt:group>' that allows free order of the first two elements:
<tt:group>
<tt:d-cond frq="1">
<multiRef><customer><tt:value ref="I_CUSTOMER"/>
</customer></multiRef>
</tt:d-cond>
<tt:d-cond frq="1">
<multiRef><salesOrg><tt:value ref="I_SALESORG"/>
</salesOrg></multiRef>
</tt:d-cond>
</tt:group>
<multiRef><material><tt:value ref="I_MATERIAL1"/>
</material></multiRef>
<multiRef><material><tt:value ref="I_MATERIAL2"/>
</material></multiRef>
However the WebService doesn't guarantee any order for the <multiRef>-tags. That means the first material could be contained ahead of the customer.
How can I insert the lines for my materials into to <tt:group>-command? Actually the WebService could deliever n materials, so I tried this (but that didn't work any more):
<tt:group>
<tt:d-cond frq="1">
<multiRef><customer><tt:value ref="I_CUSTOMER"/>
</customer></multiRef>
</tt:d-cond>
<tt:d-cond frq="1">
<multiRef><salesOrg><tt:value ref="I_SALESORG"/>
</salesOrg></multiRef>
</tt:d-cond>
<tt:d-cond frq="*">
<tt:loop name="tab" ref=".IT_MATERIALS">
<multiRef><material><tt:value ref="$tab.MATERIAL"/>
</material></multiRef>
</tt:loop>
</tt:d-cond>
Any help would be greatly appreciated. My colleagues have already begun to leave the office because I look more and more frustrated...
Greeting from Munich,
markus
Message was edited by: Markus Jarasch
Message was edited by: Markus JaraschI have some Interface Mapping questions I was hoping someone could help me with. As you know, my source is an XML File and my target is an OracleDB. I'll start with the "EFFECTIVEDATE" field which was automatically mapped when I added the Source and Target Datastores. As I previously mentioned, this caused an error "Target Column EFFECTIVEDATE: Data may be truncated: the target Column is smaller than the source Column". After looking further into it, would the problem be that the "EFFECTIVEDATE" datatype in the XML is "DATETIME" whereas the "EFFECTIVEDATE" datatype in the database is "TIMESTAMP"? If so, what would be the fix for this? Could I convert it in the Implemenation Mapping like so? -
CONVERT(MONEY.EFFECTIVEDATE,TIMESTAMP)
Would using that in the Implementation simply do the trick?
Anyway, moving onto some of the other TARGET fields...
-ACTIVITYGUID
This should be an automatically generated new GUID value. How could I implement this into the Implementation?
-TRANSACTIONGUID
I'll need to query some of the other tables in the database in order to get this value. Is this allowed in the Implemenation? Do I have to add said tables to the target somehow? Can I just query the other tables in the Implementation field using normal select statements, etc.? I'm a bit confused on how this would work...
-TYPECODE
This needs to be a fixed value of '01'. How do I simply do that in the Implementation?
The other fields will all be implemented similar to the above so those are the main questions I have for now. Any help would be appreciated.
Thanks again for your help. -
Prepopulating Interactive Form with XML Data using VBA
I have an excel spreadsheet with data on it. I need to click on a button that will cause an Interactive PDF form to open and be populated with data from the spreadsheet. To do this I want to use an XML data file. I know how to create the file, but how do I cause the PDF to open in Adobe Reader with the XML data file using VBA? The link needs to be a soft link, in that the name of the XML file could change.
Many thanks for answers.strXFDFFile = "c:\temp\" & strFileName & "tmp.xfdf"
'Open the PDF file
appPDFInit = True
Status "Processing " & strFileName
DoEvents
' Create PDF File, if any
If strXFDFFile <> "" Then
Dim fldValue As String
Open strXFDFFile For Output As #1
Print #1, "<?xml version=""1.0"" encoding=""UTF-8""?>"
Print #1, "<xfdf xmlns=""http://ns.adobe.com/xfdf/"" xml:space=""preserve"">"
Print #1, "<f href=""" & strFilePath & strFileName & """/>"
Print #1, "<fields>"
For Each fdField In rsData.Fields
If IsNull(fdField.Value) Then
fldValue = ""
Else
fldValue = fdField.Value
fldValue = XMLit(fldValue)
End If
If InStr(1, fdField.Name, "ID") > 0 Then
fldValue = Format(fldValue, "##########")
End If
If InStr(1, fdField.Name, "ZIP") > 0 Then
fldValue = Format(fldValue, "#####")
End If
If InStr(1, fdField.Name, "Rate") > 0 Then
fldValue = Format(fldValue, "#0.00#")
End If
' Write #1, fdField.Name,
Print #1, "<field name=""" & fdField.Name & """>"
Print #1, "<value>" & fldValue & "</value>"
Print #1, "</field>"
Next
Print #1, "</fields>"
Print #1, "</xfdf>"
Close #1
End If
Dim x As Long
For x = 1 To 1000000: Next x
LaunchPDF.LaunchFile strXFDFFile, 0, 2
Make sure you reference the Adobe Acrobat Browser Control Library under Tools | References
It will merge to Adobe Reader. Note that I have made the strXFDFFile variable unique by including the name of the PDF file. This assures that you can merge to more than one PDF at a time (this is taken from a loop for multiple PDF files). Note that the XFDF file must include the path and the PDF file name in order to open the correct PDF for merging.
I don't have time to explain the code, but if you have any questions let me know.
Daniel H. Smith
Smith Enterpises LLC -
Problem creating nested xml data using XSQLServlet
Hi,
This is sort of a sql question.
I'm trying to create a nexted xml data file.
The data in a rows format can be had using the
following query...
SELECT username, portlet_name, count(instance_name) as
INSTANCE_COUNT
FROM portlet_user_subscriptions
GROUP BY username, portlet_name
to get is back in a hierrachical format, I tried the
following...
SELECT distinct(username) as USERNAME,
CURSOR (
SELECT portlet_name, count(instance_name) as
NUM_INSTANCES
FROM portlet_user_subscriptions T2
WHERE T2.username=USERNAME
GROUP BY portlet_name ) AS PORTLETS
FROM portlet_user_subscriptions T1
But, that is running the CURSOE for every username in the
other loop when it should be doing it only for distinct
usernames.
What am I doing wrong here...
cheers,
VijayHow you store the data in the database?
Basically, you can query the database with XSQL(<xsql:query/>)
to get the output in XML. Then you can use XSLT to transform it
to the format you want.
<?xml-stylesheet type="text/xsl" href="doyouxml.xsl" ?>
... -
Delete Power Query queries' custom XML data using VBA
I have Power Query queries in an Excel 2010 file and would like to delete these queries using VBA. so far I can achieve that manually with the following steps:
unload Power Query addin
run Document Inspector and click to delete Custom XML data
The Macro recorder record the following code for step 2.
Sub Makro1()
' Makro1 Makro
ActiveWorkbook.RemoveDocumentInformation (xlRDIPrinterPath)
ActiveWorkbook.RemoveDocumentInformation (xlRDIDocumentProperties)
ActiveWorkbook.RemoveDocumentInformation (xlRDIInactiveDataConnections)
End Sub
However, using this macro I do not achieve the same result (=PQ query code gone from the workbook).
Any ideas on how to achieve the PQ query codes to be removed using VBA?On some cases Macro Recording is not complete, and misses to record the full set of VBA to automate the actions you record. This is probably such a case.
We are looking into future ways to allow you automate Power Query cleanup.
For the time being, please see if the
Document Inspector interface can clean the custom XML data (which holds the Power Query data structures).
thx, Gil. -
Error loading data from an XML file using HTTPService
Hello All,
I have a runtime error that has got me beat at the moment I am building an App in Flash Builder 4 to run on AIR.
The error is as follows: TypeError: Error #1009: Cannot access a property or method of a null object reference.
What i'm Trying to Do:
I have 2 DropDownList controls, the first is populated with country names and the other with language options. All the 1st DropDownList control does
is set an image control to display the country flag and enable the 2nd DropDownList.
The 2nd DropDownList sets the langCode variable equal to the chosen language code. I then call the language function and pass it langCode. Using this variable, I build up the string
so that langFilePath will be equal to the XML file (which is "Lang_GBR.xml") location on my desktop and then call the HTTPService.
As soon as the language function is called, the runtime error occurs and highlights the line with btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
where I try to assign the button label with a new value from the XML file.
I suspect this may be a trivial error but I just can't see it at the moment.
Any help or guidance would be appreciated. Thanks
Code:
<fx:Script>
<![CDATA[
[Bindable]
public var langFilePath:String;
public var langDir:File = File.desktopDirectory;
public var langCode:String;
public function countrySelect_changeHandler(event:IndexChangeEvent):void
switch (countrySelect.selectedItem)
case ('United Kingdom'):
trace("Item Selected was: "+ countrySelect.selectedItem);
img_countryFlag.source = AngolaFlag;
break;
case ('France'):
trace("Item Selected was: "+ countrySelect.selectedItem);
img_countryFlag.source = AustraliaFlag;
break;
default:
break;
langSelect.enabled = true;
trace("1st dropdownbox");
public function langSelect_changeHandler(event:IndexChangeEvent):void
switch (langSelect.selectedItem)
case ('English'):
trace("Language Selected was: "+ langSelect.selectedItem);
langCode = "Lang_GBR";
break;
case ('French'):
trace("Language Selected was: "+ langSelect.selectedItem);
langCode = "Lang_FRA";
break;
language(langCode);
public function language(aParam:String):void
trace("Code Was: " + aParam);
trace("Lang dir: " + langDir.nativePath);
langFilePath = langDir.nativePath + "/" + aParam + ".xml";
trace("File to load: " + langFilePath);
trace("loadLangFile.url: " + loadLangService.url);
loadLangService.send();
btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService id="loadLangService" url="{langFilePath}"/>
</fx:Declarations>
<s:DropDownList x="10" y="201" id="countrySelect" prompt="Please Select Your Country" width="274" enabled="true" change="countrySelect_changeHandler(event)">
<s:DropDownList x="10" y="348" id="langSelect" prompt="Please Select Your Language" width="274" enabled="false" change="langSelect_changeHandler(event)">Don't sure about your XML structure, but for now i see the problem here between this 2 lines of code:
loadLangService.send();
btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
Think data that your httpService should receive just can't go so fast to populate the lastResult before you call it in the next line
Try adding a result listener to your service before you send it:
loadLangService.addEventListener(ResultEvent.RESULT, handler);
loadLangService.send();
function handler(event:ResultEvent):void {
btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu; -
How do I initialize an array after getting xml data via httpservice?
I am having a problem trying to initialize an array with data from an external xml file obtained via httpservice. Any help/direction would be much appreciated. I am using Flex 4 (Flash Builder 4).
Here is my xml file (partial):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root>
<Row>
<icdcodedanddesc>00 PROCEDURES AND INTERVENT</icdcodedanddesc>
</Row>
<Row>
<icdcodedanddesc>00.0 THERAPEUTIC ULTRASOUND</icdcodedanddesc>
</Row>
<Row>
<icdcodedanddesc>00.01 THERAPEUTIC US VESSELS H</icdcodedanddesc>
</Row>
<Row>
<icdcodedanddesc>00.02 THERAPEUTIC ULTRASOUND O</icdcodedanddesc>
</Row>
</Root>
Here is my http service call:
<s:HTTPService id="icdcodeservice" url="ICD9V2MergeNumAndDescNotAllCodes.xml"
result="icdcodesService_resultHandler(event)" showBusyCursor="true" />
(I have tried resultFormat using object, array, xml).
I am using this following Tour de Flex example as the base -http://www.adobe.com/devnet-archive/flex/tourdeflex/web/#docIndex=0;illustIndex=1;sampleId =70500
and updating it with the httpservice call and result handler. But I cannot get the data to appear - I get [object Object] instead. In my result handler code I use "icdcodesar = new Array(event.result.Root.Row);" and then "icdcodesar.refresh();".
The key question is: How to I get data from an external xml file into an array without getting [object Object] when referencing the array entries. Thanks much!
(Tour de Flex example at http://www.adobe.com/devnet-archive/flex/tourdeflex/web/#docIndex=0;illustIndex=1;sampleId =70500 follows)
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*"
skinClass="TDFGradientBackgroundSkin"
viewSourceURL="srcview/index.html">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace local "*";
s|Label {
color: #000000;
</fx:Style>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private var names:ArrayCollection = new ArrayCollection(
["John Smith", "Jane Doe", "Paul Dupont", "Liz Jones", "Marie Taylor"]);
private function searchName(item:Object):Boolean
return item.toLowerCase().search(searchBox.text) != -1;
private function textChangeHandler():void
names.filterFunction = searchName;
names.refresh();
searchBox.dataProvider = names;
private function itemSelectedHandler(event:SearchBoxEvent):void
fullName.text = event.item as String;
]]>
</fx:Script>
<s:layout>
<s:HorizontalLayout verticalAlign="middle" horizontalAlign="center" />
</s:layout>
<s:Panel title="Components Samples"
width="600" height="100%"
color="0x000000"
borderAlpha="0.15">
<s:layout>
<s:HorizontalLayout horizontalAlign="center"
paddingLeft="10" paddingRight="10"
paddingTop="10" paddingBottom="10"/>
</s:layout>
<s:HGroup >
<s:Label text="Type a few characters to search:" />
<local:SearchBox id="searchBox" textChange="textChangeHandler()" itemSelected="itemSelectedHandler(event)"/>
</s:HGroup>
<mx:FormItem label="You selected:" >
<s:TextInput id="fullName"/>
</mx:FormItem>
</s:Panel>
</s:Application>Hello,
Instead of extracting the first zero element from the vid array, you should take that out and connect it allone.
Attachments:
init.bmp 339 KB
Maybe you are looking for
-
Table for special G/L indicator and withholding tax?
Hi experts, Iu2019m trying to post a vendor invoice on F-02. When I use vendor invoice posting key the system brings withholding tax automatically but when I use special G/L indicator (incoming credit posting ) withholding tax is not coming. Is ther
-
Transaction type field not copied into FLAGLFLEXT or FLAGLFLEXA
Dear all, I would like to run a query on the transaction types used for posting line items. (initial balance, changes on the account, ending balance). However if I look into the totals table (new GL: FLAGLFLEXT or FLAGLFLEXA) I see the field transact
-
Storage Location Error duing GR of Subcontarct for The Sales Order Stock.
HI , Is there any settings to avoid individual entry of Storage Location field for the child components during the Goods Receipt from Subcontractor for the Sales Order Stock. As per SAP standard , I have created Separate storage location for Sale
-
My notes vanished into thin air on my iPhone 5.
All my data in notes just disappeared, vanished into thin air and I didn't do anything? How can this happen. I'm using iPhone 5. Please advice, need to know why this happened so that it doesn't happen again.
-
How to stop Adobe Connect Pro from resizing my content window?
Version info: Adobe Connect Pro version 8 When I upload training content in the form of output of a SWF to my company's Connect server, and then play back the training content, the size of the window that Connect opens is whatever size I have created