Control xml data dynamically suing actionscript
i want to load a xml file very dynamically in flash. i have a
xml file as blow:
<?xml version="1.0"?>
<cbs>
<employee>
<number>1</number>
<name>Shi Chuan</name>
<comment>intern</comment>
</employee>
<employee>
<number>1</number>
<name>Shang</name>
<comment>flasher</comment>
</employee>
<employee>
<number>2</number>
<name>Jakson</name>
<comment>rapist</comment>
</employee>
<employee>
<number>2</number>
<name>Charles</name>
<comment>director</comment>
</employee>
</cbs>
when i load it in flash, i hope flash can recognize the value
between the <number> tag. and put them into two groups(number
1 one group, number 2 another group) according to their number. in
this case, it should display:
1st group:
Shi Chuan
intern;
Shang
flasher
2nd group:
Jakson
rapist;
Charles
director
if i add one more node in xml like below:
<employee>
<number>1</number>
<name>John</name>
<comment>healer</comment>
</employee>
i hope flash can auto-update the info and display:
1st group:
Shi Chuan
intern;
Shang
flasher;
john
healer
2nd group:
Jakson
rapist;
Charles
director;
john
healer
don't know if you guys have any idea how to make it.
pls help me! thank you.
hi,
yes it can be done in flash through actionscripting. what i
would suggest to you is that go through some tutorial on it at
www.kirupa.com or www.gotoandlearn.com.
gaurav
Similar Messages
-
How to export XML data dynamicly by OAF?
Hi
I have tried to export some data by XML Template, using TemplateHelper.processTemplate.
Here is a trouble that the columns are dynamic: Vendor A, Vendor B, Vendor C......
The record in VO will be as below:
Requirement Supplier Score
Requirement1 SupplierA score1
Requirement2 SupplierA score2
Requirement1 SupplierB score3
Requirement2 SupplierB score4
Requirement1 SupplierC score5
Requirement2 SupplierC score6
And the export format will be:
Requirement SupplierA SupplierB SupplierC
Requirement1 score1 score3 score5
Requirement2 score2 score4 score6
In XML Publisher Report we can easily setup the template with grammar: "for-each-group@column:" and "for-each-group@cell:current-group();", to show a report with dynamic columns.
Is there similar method to setup the template for OAF to show dynamic columns? Would anyone please show some experiences? thanks.
Best Rgds
JamesHi Gyan
Actually the requirement will show score for each supplier and each requirement.
The record in VO will be as below:
Requirement Supplier Score
Requirement1 SupplierA score1
Requirement2 SupplierA score2
Requirement1 SupplierB score3
Requirement2 SupplierB score4
Requirement1 SupplierC score5
Requirement2 SupplierC score6
And the export format will be:
Requirement SupplierA SupplierB SupplierC
Requirement1 score1 score3 score5
Requirement2 score2 score4 score6
In XML Publisher Report, it is easy to set in XML template. Is there similar way to set in XML template for VORow?
Rgds
James -
URGENT ! Is it possible to create a xml data control description file
We are encountering serious problem when generating data control against java bean build from java classes generated with xml top link mapping.
As workaround we have created a new xml schema that generate the java classes in a way data control may be generated correctly but we have to declare manually each class for java.util.list attribute that are not types by top link.
Unfortunately some classes seem not to described by a data control xml files for a reason we cannot understand because others similar classes are correctly described.
To gain time - we have to finish our development -we would force de data control structure by manually adding class data control definition file that are missing.
Just adding the file in the pasckage is not sufficient.
What do we have to update to make this file active ?Solved my problem by referencing the parent class correctly so the child class xml definition was created by the data control wizard and editable in the structure window.
-
XSLT dynamic XML data serverSide. NO External XML file
I am developing a web application currently using Tomcat 3.2.4, latest Xereces and Xalan.
I have a JSP page that 1st includes a HTML menu, I then wish to include a JSP page that will produce XML data. I would like to apply an XSLT to this XML data serverSide.. All of the solutions I have seen to date refer to a static XML file.. whereas the data in my XML structure is dynamic..
If anyone could please lend a hand it would be greatly appretiated.
Evan.Sample code for transforming xmlstring
public String transformXML(String xmlString, String screenName) {
Document document;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
StringWriter stw = new StringWriter();
try {
//File stylesheet = new File(uc.getXSLName(screenName));
File stylesheet = null;
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(new InputSource(new StringReader(xmlString)));
StreamSource stylesource = new StreamSource(stylesheet);
StreamResult result = new StreamResult(stw);
result.setWriter(stw);
DOMSource source = new DOMSource(document);
// Use a Transformer for output
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(stylesource);
transformer.transform(source, result);
return stw.toString();
catch (Exception e) {
System.out.println(e);
return null;
} -
Spry XML data set and dynamic post variables
Hi,
I am trying to create an XML data set that has dynamic post
variables.
Everytime something is pressed on the page a variable changes
and I then want to reload the XML data set using the new variable.
I know I can just pull in an XML with all possible variables
and filter client side but this would make it way too large.
Does anyone know what I may need to do.
I tried this:
var myVar = 0;
var dss = new Spry.Data.XMLDataSet (
'../../cgi-bin/server_details.pl' , 'top' , { method: 'POST' ,
postData: sid=ajaja21&ip=127.0.0.1&cid=' . myVar ,
subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
"true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
"descending", useCache: false, loadInterval: 10000 } );
onclick="myVar=1";
But the script doesn't understand the post variables sent (it
does when I remove the . myVar part and put in a static value). I
think it isn't sending that dynamic variable with the post
variables.
Any ideas anyone?
ThanksWell I had it working when I stripped back everything and
just had the dss data set and a single onclick function, but now
that I put it back together it hash foobared again.
Here are the relevant bits of code that I've changed.
The function to change server id:
//function to run when changing the server id
function changeServer ( sid ) {
//set the url to use the current server id
dss.setURL = ( '../../cgi-bin/server_details.pl' , { method:
'POST' , postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid='+sid
//force a reload of the server data
dss.loadData();
The inital load of the data set
var dss = new Spry.Data.XMLDataSet (
'../../cgi-bin/server_details.pl' , 'yams' , { method: 'POST' ,
postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid=0' ,
subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
"true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
"descending", useCache: false, loadInterval: 10000 } );
And the part that changes the server id
<td align="left" style="cursor:default; width:174px;"
onclick="changeServer({dsv::servers/server/@id})">{dsv::servers/server/name}</td>
I checked that the function is receiving the correct server
id and I even tried hard coding the cid variable to 2 in the change
function but it still wasn't changing on the server side.
Any ideas?
Thanks -
Import/Export xml data from subtree of dynamic XFA form
Hi
We would like to import/export xml data (subtree) of a dynamic xfa form. The following script does only work with static AcroForms:
formular.content.subformDaten.Button1[1]::click - (JavaScript, client)
event.target.exportAsXFDF({aFields:["formular[0].content[0].subformDaten[0]"]});
With dynamic forms the script does export an empty xml file (no data is included, only xml root tag):
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"
><f href="ExportTest_frei.pdf"
/><ids original="EA43F92A6B6EA34F9C4DBBC2DA0B1840" modified="6A7C6282A167594F91240B773AA979A7"
/></xfdf
>
Any ideas? Many thanks.
Best regards,
DanielHi Paul
The Problem that Daniel posted was originally mine. Now after subscribing to this forum myself, I try to describe the aim of using exportAsXFDF/importAnXFDF.
exportData("", false) and exportXFAData works, in my opinion, only with a DataConnection. In my form I have indeed such a connection for sending the whole form. But in addition I need the possibility to export and import only part of the data without overwriting the rest of the filled form.
exportAsXFDF works with static forms. So there MUST be a possibility that works with dynamic forms, right?
I hope anyone has a solution.
Beat -
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 -
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. -
Displaying XML data in dynamic text box
I'm attempting to display external XML data in a dynamic text box. When I test preview my code, the information that I want to display shows up in the Output window, so I know that its linked and works. My trouble is creating the code that will link to my (txtBox) and displaying when previewed. Please take a look at the files below if you have any time to offer suggestions.
Thank you!
AndyThat's not an error, it's just a warning and flash is suggesting that if you use appendText vs. +=, that your results may display faster
if you don't want to see the warning, you can take the suggestion and use:
txtBox.appendText(bldg.S11[i].SF.text());
txtBox.appendText(bldg.S11[i].Tenant.text());
txtBox.appendText(bldg.S11[i].Status.text());
~chipleh -
I am trying to display XML data from a HTTPReqeust in a list
control. Here's my mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="aircrafts.send()">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var aircraftDp:XMLList;
private function aircraftXMLHandler(event:ResultEvent):void
aircraftDp = event.result.aircraft;
]]>
</mx:Script>
<mx:HTTPService id="aircrafts"
url="
http://localhost:8080/flysafe/aircrafts"
result="aircraftXMLHandler(event)"
resultFormat="e4x"/>
<mx:List x="10" y="53"
dataProvider="{aircraftDp}"></mx:List>
</mx:Application>
The REST service returns the following XML document:
<aircrafts>
<aircraft id='0' label='Cessna' href='
http://localhost:8080/flysafe/aircrafts/0'/>
<aircraft id='1' label='Piper' href='
http://localhost:8080/flysafe/aircrafts/1'/>
</aircrafts>
The List control is empty. I cannot figure out how to get the
right connection between the data provider and the xml returned by
the HTTPRequest.I figured it out. The data provider was set up correctly, but
I wasn't telling the listbox what to use for the label. Adding the
following attribute to the listbox fixed the problem.
labelField="@id" -
Problems handling xml data for tree control.
Hi,
I have tried using tree control for displaying my xml data
but I had a problem that i did not have labels in my xml data. A
sample xml data is attached. So it displays the whole data at each
level in the tree. The root label will be the entire the xml data
and then one level down the remaining xml data and so on...
How do i solve this issue i,e get the tags names itself as
labels..
Thanks in advance....An update after some efforts..
Could get the folders perfectly i.e until the level of
CPUTime perfectly but could not get the leaf: 32 since i used the
following to set the label.
I would like to know if there is a way to find out if a node
is a leaf or folder and according set the label -
Xml publisher enterprise!!! create rtf file dynamically with load xml data
i am new to xml publisher enterprise , i want a solution for this question ...
i want create rtf file dynamically with loading xml data....means i wrote a program in jsp where the the output in xml file simultaneously create rtf file..but i enable load the xml data in rtf file but when i goto rtf file from where data in that load xml then it genrate the columns..but i want in dynamiclly to load the data will you please guide me ......Hi Atiq
Im not quite clear on the requirement here:
1. Do you just want to be able to extract the data and apply a template to the XML data from your jdp and render output?
If so then you can use the XMLP APIs ... the are in the user guide. Particularly:
RTFProcessor - converts RTF template to XSLFO stylesheet
FOProcessor - takes, XML data, XSLFO stylesheet and output format and generates the required output.
2. Do you want a template that will accept any data and just format it into rows and columns ? This can be written but your XML structure is going to have to be static, the data of course can be dynamic.
Regards, Tim -
Loading data dynamically to XML file
Hi ,
1) in my project i need an xml file that loads data
dynamically,i will get data using HttpService,
How to do this ?Please Help me its urgent.
2)Can i create an xml file that loads data dynamically using
Flex???Just need to clarify if you mean to load your data FROM an
XML file, which is relatively straightforward, or if you're saying
you want to WRITE an XML file based on something that's happened in
your application and store it on a server somewhere. -
Xml data into dynamic texttield
Hello there
I was trying to get xml data into a listBox and textArea. Then when I try to get it into a dyamic textField it gets the first one and not changing as i select different item in the listbox. sure there is a way. also i want to make it clickable so it go to a web page. can you help me please.
Appreciate your time and help
Krishhi
here is the flahttp://www.naturecareasia.com/test/learnCS4.flv.fla
Thank you -
Using importdata to import xml data into dynamic PDF form
Hi again,
Me and my colleagues have a problem using the importData service to import some xml data into an empty PDF form (represented as an XFA input variable).
In the server log I get the error that Only XDP data is supported for XFA forms, however I only have the xml data and not the entire xdp available.
Is this really not possible to to (like importing xml data to a form is possible in the Designer when creating forms).
I hope the scenario is understandable
Sincerely
Kim Christensen
Dafolo A/S
Denmark
PS: During the various projects I am working on I keep running into problems...however I am totally new to LiveCycle so I consider this very informative learning steps and appreciate all your help :-)Hi again,<br /><br />I have been experimenting a little with both the renderPDFForm and importData services. However I don't seem to be ble to make them work as I need them to.<br /><br />My scenario is simple, I have one (call it a template xdp/PDF form) and lots of data in xml files (around 1000), that I need to import into the template. Therefore I have set up a "Watched Folder" to take the xml as a document (I guess this is a requirement) and then I need either the renderPDF or importData services to import the xml data into the template.<br /><br />I would like to know how I should setup the services to make this work.<br /><br />When I try to use importdata I setup the following:<br /><br />PDF document: set to be the template i need to import the xml to)<br /><br />Input data: the document variable (an xml file) that is passed to the Watched Folder<br /><br />Data merged PDF: set to an out xfaform<br /><br />When I do this I get an Coercion error in the server log:<br /><br />2007-11-15 13:27:05,324 ERROR [com.adobe.workflow.AWS] stalling action-instance: 1506 with message: ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.<br /> at com.adobe.idp.dsc.util.CoercionUtil.toDOMDocument(CoercionUtil.java:656)<br /> at com.adobe.idp.dsc.util.CoercionUtil.toType(CoercionUtil.java:878)<br /> at com.adobe.idp.dsc.util.CoercionUtil.toType(CoercionUtil.java:803)<br /> at com.adobe.workflow.datatype.runtime.support.AbstractDataTypeRuntimeHandler.coerceFrom(Abs tractDataTypeRuntimeHandler.java:64)<br /> at com.adobe.workflow.datatype.runtime.support.AbstractComplexDataTypeRuntimeHandler.getNode (AbstractComplexDataTypeRuntimeHandler.java:47)<br /> at com.adobe.workflow.dom.VariableElement.setBoundValue(VariableElement.java:93)<br /> at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionCo ntextImpl.java:729)<br /> at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataWithExpression(PATEx ecutionContextImpl.java:335)<br /> at com.adobe.idp.workflow.dsc.service.SetValueService.execute(SetValueService.java:46)<br />...<br />Caused by: ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: <document state="passive" senderVersion="3" persistent="false" senderPersistent="true" passivated="true" senderPassivated="true" deserialized="true" senderHostId="127.0.0.1/172.16.10.125" callbackId="0" senderCallbackId="7" callbackRef="null" isLocalizable="true" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="8039" contentType="application/xml" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGl obalBackendId/><inline><?xml version="1.0" encoding="UTF-8"?><br /><form1><br /> <sub_BlanketTop /><br /> <sub_SubjectTop><br /> <f...</inline><senderPullServantJndiName>adobe/idp/DocumentPullServant/adobejb_server1</s enderPullServantJndiName><attributes file="c:\NCRConvert\ProcessForm\stage\Wx450d4b32843a0b0bcb8ef99e\NCR-00564_dXAE3soH.xml"/ ></document> of type: com.adobe.idp.Document to type: interface org.w3c.dom.Document<br /> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)<br /> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)<br /><br />However it is possible to manually import the xml data in Acrobat Professional without any problems.<br /><br />When I use the renderPDFForm with the following settings:<br /><br />Form to render: literal value that points to the template<br /><br />Form data: document variable from watched folder (xml)<br /><br />Content Root URI: repository://<br /><br />With these settings I also get a coercion error, however it does not seem to be exactly the same.<br /><br />Sincerely<br />Kim
Maybe you are looking for
-
MS Word Reports-how to use bookmarks
I am using the labview report writing tools to produce an MS Word report. I have produced several headings, information strings, tables etc. I need to use "Word Insert Object.vi" to place certain objects such as excel charts at certain places in the
-
DELL XPS 6000 with Audigy2ZS..No so
<font face="Baskerville Old Face" size="5">?I have a Dell XPS 6000 Dimension desktop. Win XP. The sound card is a (Soundblaster 2ZS.) The integrated audio onboard is?(RealtekAC 97 Audio.)?I heard the Windows Startup theme,but when I play a song in Wi
-
Loss of people picker column data during import/export of a list in SharePoint 2010
Hi Even we are facing the same issue. i a have meeting minutes(ootb) list, there are totally 100 items with multiple participant in Participant column, when i try to import export that list to some other site. participant column loosing the data, fo
-
Can it be simpler and not work?
I'm trying to create a simple webservice using the sample code distributed with the JDKEE. HelloIF.java package hellosvc; import java.rmi.Remote; import java.rmi.RemoteException; public interface HelloIF extends Remote { public String sayHello(St
-
Need help on remote connection to mysql
Hi all, I am trying to make a remote JDBC connection from a servlet running on one linux server to mySql running on another Linux Server. I get the following error : java.sql.SQLException: Cannot connect to MySQL server on <Linux_server2_IP>:3306. Is