Flex XML
Hi
i m devlopping an HMI with flex offers to users to create
object, the user has to describe objects, (name , attribute...)
and all informations must be exported in xml file .....
so someone has a idea ????
Of course you can, the only bottleneck for flex is that flex
can´t write to local disks directly (cause of the sandbox), so
you have to first create the xml file on server and than users can
download this file.
( use php for creating the xml file)
best regards
kcell
Similar Messages
-
Flex, xml, and non-English characters
Hello! I have a Flex web app with AdvancedDataGrid. And I use httpService component to load some data to grid. The .xml file contains non-english characters in attributes (russian in my case) like this:
<?xml version="1.0" encoding="utf-8" ?>
<Autoparts>
<autopart DESCRIPTION="Барабан">
</Autoparts>
And when i run app, AdvancedDataGrid display it like "сПÐ". How can i fix it? I try to change encoding="utf-8" with some another charsets, bun unsuccesfully. Thank you.Try changing the xml structure by using CDATA instead of having the russian part as an attribute and see if that makes any difference.
What I meant is use something like this:
<?xml version="1.0" encoding="utf-8" ?>
<Autoparts>
<autopart>
<description><![CDATA[Барабан]]></description>
</autopart>
</Autoparts>
instead of the current xml. -
Flex XML Parsing fails on UTF-8 encoded XML.
Flex doesn't see reliable enough for handling XML.
This basic XML file causes an error in flex. Depending on the contents of the XML, it may or may not be invalid...and its not the characters. If I put in one type of UTF8 characters, the XML is OK, if I put in another type, its also OK. If I however put in both types...then the XML fails.
So in summary, good + good = bad.
Multiple browsers, multiple versions of Flash (latest, as well as a couple prior releases), multiple OS's.
XML headers indicate the content type correctly: Content-Type: text/xml;charset=utf-8
Any suggestions?
--BenI worked around the bad XML handling in Flex by Base64 encoding my data, then Base64 decoding it in Flex. I used com.dynamicflash.util.Base64 to do the decoding.
Its a shame though...wasting extra CPU and making the flash slower just because it can't handle XML reliably.
--Ben -
Hi all,
I am really new so please excuse my lack of knowledge. I have
a flex app that keeps track of a workout program progress. Each
user updates their stats each week.
So I have a section where a new member can be added. I have a
datagrid that is populated by an xml file along with a form to add
a new member. When I test the app it works, the new user is added
and shows up in the data grid. Of course when I run the app again
the new user is no longer there. I would like to know how to get
the app to update the xml file with the new information when a user
is added. A way to save the input from the form into the xml file.
If anyone can help me understand how to do this I would really be
greatful.
Thanks
GhostReading data is almost always easier that writing it. You
probably used HTTPService to load the XML data. All you needed on
the server was the XML file. The web server took care of reading
the file and packaging it to send back to the Flash Player running
the Flex application.
The reverse isn't so straightforward. The Flex part is pretty
simple however. I recommend using HTTPService with method="post" so
you can send a larger amount of data than would be possible with
method="get". If possible, to make it easy, send an entire XML
document back - all of the data. Later you can figure out how to
send just what gets updated. Baby steps are best.
The Flex HTTPService has to send the data to something on the
server which can write the XML file. Unlike reading the file and
sending it, there isn't anything (at least that I'm aware of)
ubiqutous to write the data. Your server system might already have
something you can use - so check that first. If there is nothing,
consider using PHP which is free and easy to learn. A PHP script
can accept the XML data and write it to the server's disk. -
I've written an XML service in Zend Framework and I want to
parse the data to E4X/something else. I get back XML data something
like this:
quote:
<?xml version="1.0" encoding="UTF-8"?>
<root><Pname>caramba</Pname><Email>1</Email><DOB>4</DOB><Sex>1</Sex><Phone>1</Phone><Addre ss>caramba</Address><Photo>1</Photo><Enum>4</Enum></root>
I want to get each variable Pname, Email and so forth into
variable into Flex. How do I go about this?Doc on using an HTTPService is here:
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html
This includes lots of examples, including examples that use
XML as the data source with E4X.
More doc on working with E4X is here:
http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_03.html
hth,
matt horn
flex docs -
hello,
somebody has it a piece of code allowing me in a canvas to
read a file XML and automatically to add as much field text than of
information contained in my file xml
thank you in advanceTry changing the xml structure by using CDATA instead of having the russian part as an attribute and see if that makes any difference.
What I meant is use something like this:
<?xml version="1.0" encoding="utf-8" ?>
<Autoparts>
<autopart>
<description><![CDATA[Барабан]]></description>
</autopart>
</Autoparts>
instead of the current xml. -
How to make an mp3 player with xml playlist. just like
streaming player with volume control and autoplay. Thanks and more
power.are you trying to use your xml data before loading is
complete? is there a security issue? does your player work if you
hardcode one of the mp3s? -
Reading an xml file in actionscript using flex3
plzz tell me how to read an xml file in actionscript using flex3.......
One possible option to parse an xml-file to a flex XML object:
public function parseConXML(source:String):void
xmlLoader = new URLLoader();
xmlLoader.load(new URLRequest(source));
// Eventlistener: if URL loaded --> onLoadComplete function
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadComplete);
public function xmlLoadComplete(evt:Event):void{
var xml:XML = new XML();
// ignore comments in XML-File
XML.ignoreComments = true;
//ignore whitespaces in XML-File
XML.ignoreWhitespace = true;
// XML-Objekt erstellen
xml = new XML(evt.target.data);
//AFTERWARDS use your xml as your wish -
Reading an xml file in the web services java file
I want to read some data in the webservices file.so i am writing my own xml file through which i want to read data.but i am not able to read xml file from web services file.also , i am not able to put xml file in the .ear file,as there is no such tag in servicegen script through which i can add xml file in the .ear file.
i know in case of servlets,i will specify context-param attributes in web.xml,and i can access those in my servlet.can i do anything like this for webservices,and i am not using any servlets for web services.
kindly tell any solution.One possible option to parse an xml-file to a flex XML object:
public function parseConXML(source:String):void
xmlLoader = new URLLoader();
xmlLoader.load(new URLRequest(source));
// Eventlistener: if URL loaded --> onLoadComplete function
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadComplete);
public function xmlLoadComplete(evt:Event):void{
var xml:XML = new XML();
// ignore comments in XML-File
XML.ignoreComments = true;
//ignore whitespaces in XML-File
XML.ignoreWhitespace = true;
// XML-Objekt erstellen
xml = new XML(evt.target.data);
//AFTERWARDS use your xml as your wish -
Conversion of string into XML object
Hi
I am having some problems with conversion of string (containing XML data) into Flex XML object and binding it later to UI elements to output/maintain this data.
Binding of XML structure to UI elements works perfectly fine if I will do following:
1) Hardcode XML object within Flex file
2) Read xml file from repository (xml file inside the Flex project)
3) Use HTTP request to retrieve XML data
Unfortunately none of the above scenarios suits my solution.
I am developing a prototype application for processing Flex forms inside SAP system. I have decided to make data bindings using XML structure stored in Data Base. When rendering form inside web browser based application I am retrieving corresponding XML schema (empty for new forms and populated for saved forms) and pass it to Flex form as a string type import parameter. Data is being passed correctly (I can display it on TextArea control for instance) but after conversion to XML and binding to DataGrid I am not getting any results.
I am converting string (containing XML) to XML object in following way:
Private var xml_obj:XML = new XML(string_xml );
I am catching any potential errors but conversion is going well. After conversion I am not getting any results after binding it to DataGrid control and I am not able to access any of the nodes using AS code either. At the same time variable xml_obj is not empty (not null).
Any help would be much appreciated.
Regards
MichaelDavid
First of all sorry for not stating it clearly but I am using Flex 3 for this development (at the moment it is the only choice when embedding Flex objects inside SAP applications).
You must have missed the bit where I am describing how this XML data finds its way inside Flex. I am passing it to Flex as String type parameter during rendering (directly from DB where it is stored).
Now, following code works perfect (XML is embedded inside Flex project):
<mx:XML id="form_data" source="../assets/example_xml_data.xml"/>
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.controls.Alert;
[Bindable]
public var XML_list:XMLListCollection;
private function setParameters():void
XML_list = new XMLListCollection(form_data.*);
]]>
</mx:Script>
<mx:DataGrid id="myDataGrid" dataProvider="{XML_list}">
<mx:columns>
<mx:DataGridColumn dataField="COMMON" headerText="Popular name"/>
<mx:DataGridColumn dataField="BOTANICAL" headerText="Botanical name"/>
<mx:DataGridColumn dataField="ZONE" headerText="Zone"/>
<mx:DataGridColumn dataField="LIGHT" headerText="Light"/>
<mx:DataGridColumn dataField="PRICE" headerText="Price"/>
<mx:DataGridColumn dataField="AVAILABILITY" headerText="Availability"/>
</mx:columns>
</mx:DataGrid>
But following code does not work (XML passed to Flex form as String input parameter):
import sap.FlashIsland;
import mx.controls.Alert;
import mx.collections.XMLListCollection;
[Bindable]
public var xml_data:String;
private var form_data:XML;
[Bindable]
private var XML_list:XMLListCollection;
private function initApp():void
FlashIsland.register(this);
private function setParameters():void
try
form_data=new XML(xml_data);
catch (error:Error)
Alert.show(error.toString());
XML_list = new XMLListCollection(form_data.*);
XML string does find its way inside Flex form. I can display content of variable xml_data in TextArea and all looks fine. Conversion to XML (variable form_data) goes well (no error)
Please helpJ
Regards
Michael -
Sending a messaqe to Adobe Flex application
Hi All,
Flex has a messaging service and some tutorial show how to connect a Flex mxml application to a JMS queue.
I have a web service which times out since it executes unit tests and returns the result. i would like to execute the underlying remote function module in background and on completion of the function module send a message to a Flex client.
Can this be achieved through XI? And how could I achieve this?
Thank you for your help,
PhilonHi,
As i understood,
If XI would be in place , it will send messages to JMS Queue and it will then transfer data to Flex xml.
Regards,
Akshay.
Don't Forget to give points. -
Recommend a framework for Flex & CF
Hi,
Can people please give a few opinions on learning a
framework, which one, why, and hopefully what kind of knowledge one
needs before even delving into the recommended (or any)
framework...for a Flex 2/Coldfusion MX7.0.2/MS-My-SQL environment.
Good books specific to the software would also be much
appreciated.
Thanks kindly,
Shawn:)So I decided to change the url="
http://xxxxxx.com/test/cgi-vars-for-flex.cfm"
to url="
http://xxxxxx.com/test/cgi-vars-for-flex.xml"
(xml code below), to see if that works, and everything works fine.
So, I suspect there's something wrong with my cfm code.
Any ideas, anyone ? :)
Thanks,
Ray
---- xml file ----
<?xml version="1.0" encoding="ISO-8859-1"?>
<cgi>
<vars>
<name>CGI.SCRIPT_NAME</name>
<value>/dev/development/rdixon/test/cgi-vars-for-flex.cfm</value>
</vars>
<vars>
<name>CGI.SERVER_NAME</name>
<value>fusionmx-dev1.e-dialog.com</value>
</vars>
</cgi> -
Flex & cf 6, am i missing something - code snippet
So my first attempt at this, and I wondering if I'm missing
something....
Flex Builder 3 app, calling a cfm proc on a CF6 server. Code
snippet below. Just a simple call to return some CGI vars as a
test.
I'm not getting my datagrid populated, not sure if it's just
not communicating, or what. Thanks for any suggestiongs, or help.
---- mxml code ----
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*" layout="absolute"
creationComplete="userRequest.send()">
<mx:HTTPService id="userRequest" url="
http://xxxxxx.com/test/cgi-vars-for-flex.cfm"
useProxy="false" method="POST">
</mx:HTTPService>
<mx:DataGrid id="dgUserRequest" x="10" y="10"
dataProvider="{userRequest.lastResult.cgi.vars}" height="142">
<mx:columns>
<mx:DataGridColumn headerText="CGI Variable"
dataField="name"/>
<mx:DataGridColumn headerText="Value"
dataField="value"/>
</mx:columns>
</mx:DataGrid>
<mx:Form x="10" y="10" width="100">
</mx:Form>
<mx:Button label="Refresh" click="userRequest.send()"
x="10" y="160"/>
</mx:Application>
---- cgi-vars-for-flex.cfm ----
<cfprocessingdirective pageencoding = "utf-8"
suppressWhiteSpace = "Yes">
<cfxml variable="cgiXML">
<cgi>
<cfoutput>
<vars>
<name>CGI.SCRIPT_NAME</name>
<value>#CGI.SCRIPT_NAME#</value>
</vars>
<vars>
<name>CGI.SERVER_NAME</name>
<value>#CGI.SERVER_NAME#</value>
</vars>
</cfoutput>
</cgi>
</cfxml>
<cfoutput>#cgiXML#</cfoutput>
<!--- <cfdump var=#cgiXML#> --->
</cfprocessingdirective>So I decided to change the url="
http://xxxxxx.com/test/cgi-vars-for-flex.cfm"
to url="
http://xxxxxx.com/test/cgi-vars-for-flex.xml"
(xml code below), to see if that works, and everything works fine.
So, I suspect there's something wrong with my cfm code.
Any ideas, anyone ? :)
Thanks,
Ray
---- xml file ----
<?xml version="1.0" encoding="ISO-8859-1"?>
<cgi>
<vars>
<name>CGI.SCRIPT_NAME</name>
<value>/dev/development/rdixon/test/cgi-vars-for-flex.cfm</value>
</vars>
<vars>
<name>CGI.SERVER_NAME</name>
<value>fusionmx-dev1.e-dialog.com</value>
</vars>
</cgi> -
I builded a small application that retrieves data from an xml
file. It works perfectly in my local machine but in the server, I
get the following error:
[RPC Fault faultString="Security error accessing url"
faultCode="Channel.Security.Error" faultDetail="Destination:
DefaultHTTP"]
at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\project s\rpc\src\mx\rpc\AbstractInvoker.as:216
at
mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49 ]
at
mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
at
DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\sr c\mx\messaging\channels\DirectHTTPChannel.as:368]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()
What am I missing?
Thanks in advance,
JPHi Mab, thank you for your answer. The link you posted is not
available. Here is the code, it's just an adaptation of a sample:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="feedRequest.send()">
<mx:HTTPService
id="feedRequest"
url="flex/xml/Embajadas_es.xml"
useProxy="false"/>
<mx:Panel x="10" y="10" width="544" height="338"
layout="absolute"
title="{feedRequest.lastResult.rss.channel.titulo}">
<mx:DataGrid x="20" y="19" width="485" id="dgPosts"
dataProvider="{feedRequest.lastResult.rss.channel.embajada}"
height="228">
<mx:columns>
<mx:DataGridColumn headerText="Embajada"
dataField="nombre" width="20"/>
<mx:DataGridColumn headerText="Dirección"
dataField="direccion" width="60"/>
<mx:DataGridColumn headerText="Teléfono"
dataField="telefono" width="20"/>
</mx:columns>
</mx:DataGrid>
<mx:TextArea x="20" y="261" width="400"
htmlText="{dgPosts.selectedItem.direccion}" height="19"
borderStyle="none"/>
</mx:Panel>
</mx:Application>
I tried both with an absolute URL and with a relative one
(actual code) with the same result. Just in case, our server runs
Windows Server 2003 and it is behind a firewall.
Best regards,
JP -
Using replace(...) in XML
I have an XML document that looks like:
<Task name="myName" loaded="true" priority="1" >
<Preference>
<Element1>
value1
</Element1>
<Element2>
value2
</Element2>
</Preference>
</Task>
This is all contained in an XML variable called 'myXML'. No
problems so far.
Now I wish to change say the value of Element1 to
another value 'foo'.
I've tried all sorts of stuff and can't get this to work.
If the particular property is not found the XML remains
unchanged of course.
What's the secret sauce?Go with attributes instead of node texts, this will takes less xml-bytes + easy to access and modify from native Flex XML type.
<Task name="myName" loaded="true" priority="1" >
<Preference>
<Element1 value="value1" />
<Element2 value="value2" />
</Preference>
</Task>
change the value as easy as:
myXML..Element1[0].@value = 'foo';
Maybe you are looking for
-
How do you assign a value to the APEX field APP_USER
Application Express 4.0.2.00.07 Hi Is there a special function/procedure to assign a value to the APP_USER field or a simple APP_USER := :P1_LOGIN_NAME would do Z
-
Custom renderer on standard component
I try to implement a custom renderer to a standard component (<h:outputText>), but my Tomcat failed to start the webcontainer. here are my files: faces-config.xml <render-kit> <renderer> <renderer-type>MyRenderer</renderer-type> <renderer-class>rende
-
ORA-00333: redo log read error block 69855 count 8192
Hello Guys, where importing a dump to newly created database 10gR2 on Linux i got this error: ORA-00333: redo log read error block 69855 count 8192 By searching this error, i found that I need to do recovery, but i don't have any backup of this datab
-
Is it possible to use custom mount options for removable (usb) drives in kde4? I'm mostly interested in -o flush option. So the actual write on the disk ocurs when copying, but not when I unmout the device. P.S. editing fstab is not a solution! May b
-
Due date is not showing up in UWL
Hi , Due date is not showing up in UWL. Back end is ECC not GP Just regular work flow. I can see in workflow object end date kind. But the field is blank. For due date any additional configuration needed. I really appreciate your help. Regards Mark