Reading XML with Flex
Ok I've gone through Ed's awesome Flex tutorial in the wiki but for some reason I simply can't nail this one.
<mx:Label y="10" text="Craig's Movie List" id="lblTitle" enabled="true" horizontalCenter="0" fontSize="19" fontFamily="Arial" fontWeight="bold" fontStyle="italic"/>
<mx:HTTPService id="httpRSS" url="http://creator.zoho.com/ccmehil/rss/30/" resultFormat="e4x" />
<mx:DataGrid id="entries" verticalCenter="11" horizontalCenter="0" width="480" dataProvider="{httpRSS.lastResult.channel.item}" height="230">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="title" width="300"/>
<mx:DataGridColumn headerText="Rating" dataField="zc:Rating" width="50"/>
<mx:DataGridColumn headerText="Type" dataField="zc:Genre"/>
<mx:DataGridColumn headerText="Runtime" dataField="zc:Runtime"/>
</mx:columns>
</mx:DataGrid>
The RSS looks like
<item>
<title>Winnie the Pooh - A New friend for Winnie Pooh</title>
<link>http://creator.zoho.com/ccmehil/view/30/record/7987000000110023/</link>
<description><b>Title</b> : Winnie the Pooh - A New friend for Winnie Pooh<br/><b>Genre</b> : Zeichentrick<br/><b>Rating</b> : G<br/><b>Director</b> : <br/><b>Year</b> : <br/><b>Runtime</b> : 65<br/><b>Status</b> : Available</description>
<guid isPermaLink="true">http://creator.zoho.com/ccmehil/view/30/record/7987000000110023/</guid>
<zc:Title>Winnie the Pooh - A New friend for Winnie Pooh</zc:Title>
<zc:Genre>Zeichentrick</zc:Genre>
<zc:Rating>G</zc:Rating>
<zc:Director></zc:Director>
<zc:Year></zc:Year>
<zc:Runtime>65</zc:Runtime>
<zc:Status>Available</zc:Status>
</item>
So why can't I access the zc elements? What am I missing?
check this documentation on how to handle namespace
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=dataservices_099_17.html
Similar Messages
-
Can't read xml with a Reader?
hi,
is it correct that the java Reader classes for reading character streams can't be used for reading XML (in one-pass)?
ie you don't know what encoding to read the file as until you've read the encoding attribute of the top level tag - and by then its too late - you'd have to start again?
(i think this is how xml parsers must work?)
thanks,
asjfto be honest this was motivated by wanting a quick method to remove the DTD reference from an inputstream, without having to worry about whichever XML API was in use further down in the code (we've since settled on a particular API so this is no longer an issue)
I've been told there are 2 legitimate ways to do this (with the help of the parser)
A) configure the parser (parser-implementation-dependent)
B) in SAX, provide an EntityResolver
Last year I had opted for a gratuitous munge-around by manually reading the inputstream and removing the DTD reference
this year we've started working with chinese documents.. so the code doesn't work since I was using the platform-encoding rather than the xml-declared encoding
its pretty clear that (B) is the way to go but there are a few other technical hurdles to overcome first..
i'm beginning to think that /all/ quick-workarounds come back to bite you soon enough.. -
Reading xml with streamtokenizer
Does anyone know how to read xml tags (everthing in between < & >) with streamtokenizer, I can't find any tutorials.
I recommend xml packages. It's a bit more complex, IMO.
-
Using XML with Flex - Best Practice Question
Hi
I am using an XML file as a dataProvider for my Flex
application.
My application is quite large and is being fed a lot of data
– therefore the XML file that I am using is also quite large.
I have read some tutorials and looked thorough some online
examples and am just after a little advice. My application is
working, but I am not sure if I have gone about setting and using
my data provider in the best possible (most efficient) way.
I am basically after some advice as to weather I am going
about using (accessing) my XML and populating my Flex application
is the best / most efficient way???
My application consists of the main application (MXML) file
and also additional AS files / components.
I am setting up my connection to my XML file within my main
application file using HTTPService :
<mx:HTTPService
id="myResults"
url="
http://localhost/myFlexDataProvider.xml"
resultFormat="e4x"
result="myResultHandler(event)" />
and handling my results with the following function:
public function myResultHandler(event:ResultEvent):void
myDataFeed = event.result as XML;
within my application I am setting my variable values by
firstly delacring them:
public var fName:String;
public var lName:String;
public var postCode:string;
public var telNum:int;
And then, giving them a value by “drilling” into
the XML, E;g:
fName = myDataFeed.employeeDetails.contactDetails.firstName;
lName = myDataFeed.employeeDetails.contactDetails.lastName;
postCode =
myDataFeed.employeeDetails.contactDetails.address.postcode;
telNum = myDataFeed.employeeDetails.contactDetails.postcode;
etc…
Therefore, for any of my external (components in a different
AS file) components, I am therefore referencing there values using
Application:
import mx.core.Application;
And setting the values / variables within the AS components
as follows:
public var fName:String;
public var lName:String;
fName =
Application.application.myDataFeed.employeeDetails.contactDetails.firstName;
lName =
Application.application.myDataFeed.employeeDetails.contactDetails.lastName;
As mentioned this method seems to work, however, is it the
best way to do it??? :
- Connect to my XML file
- Set up my application variables
- Give my variables values from the XML file ……
Bearing in mind that in this particular application there are
many variable that need to be set and there for a lot of lines of
code just setting up and assigning variables values from my XML
file.
Could someone Please advise me on this one????
Thanks a lot,
Jon.I don't see any problem with that.
Your alternatives are to skip the instance variables and
query the XML directly. If you use the values in a lot of places,
then the Variables will be easier to use and maintain.
Also, instead of instance variables, you colld put the values
in an "associative array" (object/hashtable), or in a dictionary.
Tracy -
Read XML with different schema definitions
Hello,
I have an XML stored in a table as XMLTYPE and I have no problem to read the first part (ELMAHeader)
WITH t AS(
SELECT XMLTYPE(
q'[<?xml version = '1.0' encoding = 'UTF-8'?>
<ELMAKM xsi:noNamespaceSchemaLocation="./KM/01.00/ELMAKM_000001.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:km="http://www.zivit.de/KiStA/KiStAM/V1.0/KiStA-KiStAM-Anfrage">
<ELMAKOM>
<ELMAHeader ELMAKMVersion="1">
<AuthSteuernummer>BG</AuthSteuernummer>
<AccountID>11</AccountID>
<KundeneigeneID>1</KundeneigeneID>
<Verarbeitungslauf>PROD</Verarbeitungslauf>
<ErstellungsDatum>2014-09-16</ErstellungsDatum>
<ErstellungsZeit>11:00:27.7</ErstellungsZeit>
</ELMAHeader>
<ELMAVerfahren>
<KISTA_KM_ANTW UUID="0345" OrdBegriff="SLD"
xsi:schemaLocation="http://www.zivit.de/KiStA/KM/01.00-r000001 ./KM/01.00/ELMAKM_KISTA_000001.xsd"
xmlns="http://www.zivit.de/KiStA/KM/01.00-r000001"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:k="http://www.zivit.de/KiStA/Std/01.00-r000001">
<KiStAV_DL Zulassungsnummer="2"/>
<KiStAV Zulassungsnummer="2" Name="SLD"/>
<Antwort xsi:type="AntwortArt3" UUID="0f" KdOrdBegriff="4">
<ReturnCode>1</ReturnCode>
<Anlass Datum="2014-08-11" Grund="1"/>
<PersAngabe>
<Person>
<k:NName>B</k:NName>
<k:VName>Y</k:VName>
<k:GebDt>1944-10-11</k:GebDt>
</Person>
<Adresse xsi:type="k:InlandsAdresse">
<k:Str>A-Str.</k:Str>
<k:HausNr>5</k:HausNr>
<k:Ort>M</k:Ort>
<k:Plz>8</k:Plz>
</Adresse>
</PersAngabe>
</Antwort>
</KISTA_KM_ANTW>
</ELMAVerfahren>
</ELMAKOM>
</ELMAKM>]') x FROM dual
SELECT x
,elma.ELMAKMVersion
,elma.AuthSteuernummer
,elma.AccountID
,elma.KundeneigeneID
FROM t
,XMLTABLE(
'/ELMAKM/ELMAKOM/ELMAHeader'
PASSING t.x
COLUMNS ELMAKMVersion VARCHAR2(8) PATH '@ELMAKMVersion'
,AuthSteuernummer VARCHAR2(10) PATH 'AuthSteuernummer'
,AccountID VARCHAR2(10) PATH 'AccountID'
,KundeneigeneID VARCHAR2(10) PATH 'KundeneigeneID'
) elma
But how can I read the second part(ELMAVerfahren)? I tried many selects but I get no results, e.g.
WITH ...
SELECT x
,elma.UUID
FROM t
,XMLTABLE(
XMLNAMESPACES(
DEFAULT './KM/01.00/ELMAKM_KISTA_000001.xsd'
,'http://www.zivit.de/KiStA/KiStAM/V1.0/KiStA-KiStAM-Anfrage' AS "km"
,'http://www.zivit.de/KiStA/Std/01.00-r000001' AS "k"
'/ELMAKM/ELMAKOM/ELMAVerfahren/KISTA_KM_ANTW'
PASSING t.x
COLUMNS UUID VARCHAR2(8) PATH '@UUID'
) elma
DB version
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
Regards
MarcusHi Marcus,
If you declare a default namespace using the XMLNamespaces clause, it'll apply to all unqualified elements referenced by the XQuery expression.
In your attempt, ELMAKM, ELMAKOM and ELMAVerfahren are treated as being part of the default namespace, which is wrong since those nodes are in no namespace.
To handle this kind of situations, where there are default namespace redefinitions down the tree, you have to declare a prefix :
SELECT x
,elma.UUID
FROM t
,XMLTABLE(
XMLNamespaces('http://www.zivit.de/KiStA/KM/01.00-r000001' as "ns0")
, '/ELMAKM/ELMAKOM/ELMAVerfahren/ns0:KISTA_KM_ANTW'
PASSING t.x
COLUMNS UUID VARCHAR2(8) PATH '@UUID'
) elma -
How to read xml with deep structure into intarnal table.
Hi,
Could you pls any body provide xslt code for deep structure convert into internal table.
sample xml file:
- <ns0:CREATIONOFCONTRACT xmlns:ns0="http://BPCreationXSD.CreationOfContract">
- <CREATIONOFCONTRACTDATA>
<RequestType>L0011</RequestType>
<ApplicationId>AN-12</ApplicationId>
<LoanId>QO-22</LoanId>
- <Borrowerguarantorinfo>
<Borrowerbpno>101020</Borrowerbpno>
<Co-borrower1BPNo>101021</Co-borrower1BPNo>
<Co-borrower2BPNo>101022</Co-borrower2BPNo>
<Guarantor1BPNo>101023</Guarantor1BPNo>
<Guarantor2BPNo>101024</Guarantor2BPNo>
<Branch>New Delhi</Branch>
</Borrowerguarantorinfo>
- <Loaninfo>
<Applicationtype>Fresh</Applicationtype>
<Purposeofloan>Home Purchase</Purposeofloan>
<Securedunsecuredflag>Secured</Securedunsecuredflag>
<Loantype>HL with MRTA</Loantype>
<Loancurrency>INR</Loancurrency>
<Loanproduct>MaxiHome Loan Package</Loanproduct>
<Loanscheme>MaxiHome ZEC</Loanscheme>
<Loanamount>1500000.00</Loanamount>
<Loantenure>60</Loantenure>
<Tiered>No</Tiered>
</Loaninfo>
<Periodfrom>01/07/2009</Periodfrom>
<Periodto>16/09/2019</Periodto>
<RateType>Fixed</RateType>
<Ratecode>10.25</Ratecode>
</CREATIONOFCONTRACTDATA>
</ns0:CREATIONOFCONTRACT>Hi Ramesh,
Thanks for the info,but I found lot of tables unfortunately I am not getting the value for radio buttons. Also I found a FM FIELD_SELECTION_CUSTOMIZE , IMPORT_DYNPRO etc which will call that screen based on profile but it will not store data any where. I found several tables like TCATS, TFAWC, TFAWF, TFAWT etc.But I am not getting the value for raduio buttons.
Thanks & Regards,
Nagaraj Kalbavi -
Dear Friends,
iam doing my first project in flex. trying to connect a xml
generated by php connected to mysql. i took an example from the
following link:
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showDetails&postId=5561&produ ctId=2&loc=en_US
my xml is generated. working fine. when i run my Flex, it is
not working. it is giving the following error
Process terminated without establishing connection to
debugger.
Command:
"C:\Program Files\Adobe\Flex Builder
3\sdks\3.2.0\bin\adl.exe"
C:\Rahim\TestApplications\Flexapplication\xmltest\bin-debug\xmltest-app.xml
C:\Rahim\TestApplications\Flexapplication\xmltest\bin-debug
Output from command:
invocation forwarded to primary instance
my flex file is :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
initialize="doSend()"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var datalist:ArrayCollection;
private function resultHandler(event:ResultEvent):void{
datalist = event.result.data.row;
public function doSend():void {
xmlFromDatabase.url = "
http://localhost/flex/flexdb.php";
xmlFromDatabase.send();
]]>
</mx:Script>
<mx:HTTPService url="
http://localhost/flex/flexdb.php"
id="xmlFromDatabase"
showBusyCursor="true"
result="resultHandler(event)"
method="GET" />
<mx:DataGrid x="10" y="10" dataProvider="{datalist}"
id="dg">
<mx:columns>
<mx:DataGridColumn headerText="Col1" dataField="id"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
Thanks and Regards,
Syed Abdul Rahimhi _funkyboy ,
thks for ur msg. i tried using run also.. still not
running... can u pls advice me wt to do. i got struct up.. i have
to do this.
tell me how to connect xml which was generated by php and
fetch the data and display in Flex.
thanks and regards,
Syed Abdul Rahim -
Dear Friends,
i am doing a ticker in Flex, i want to connect the xml
generated by php and fetch the data and display in data grid. iam
new to Flex. Kindly help me to do this assignment..
Thanks and Regards,
Syed Abdul RahimIn Flex Builder help take a look at HTTPService class. You
use this class to hit a URL on a server, and listen in the result
event for the data sent by the URL.
ATTA -
Hi
accrording to my knowledge there are two type of push registry:
static registration and dynamic registration!!I don't know when we should use static registration,and when we should use dynamic registration!!And disadvantage of advantage of each type!!
THanks a lotsHi
I belive that you should use static push registry when you know the number of the connections (for example 40 connections max). When you don't know the number of connections you should use the dynamic push registry.
Hope I could help -
Help with Flex Ant build.xml error
So I've started on a new project and I'm new to Flex. A lot of learning curve here. Anyway, I'm trying to deploy a project that uses flex and is built with Ant. We've moving up from a version of Flex 2 to Flex 3. The build file works fine in the Flex 2 app but for some reason does not seem to be working with Flex 3. I'm hoping someone can give me some insight on what might be wrong or where to start.
The error is Command not found: compc
The part of the build file it has a problem with is:
<compc include-classes="${classes}"
ouput="${flex.dist.dir}/${flex.app.name}.swc"
keep-generated-actionscript="false"
headless-server="${headless.server}"
incremental="true">
<load_config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${FLEX_HOME}/frameworks" />
<source-path path-element="${flex.app.root}" />
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="../bundles/{local}" />
</compiler.library-path>
<compiler.library-path dir="${flex.app.root}" appent="true">
<include name="libs" />
</compiler.library-path>
</compc>
Any help at all would be greatly appreciated, thank you.Sorry, I meant to address that. Yes, since we've moved up to the Flex 3 sdk, we are pointing at a new directory. The old directory was flex_sdk and the new directory is flex_sdk_340.
FLEX_HOME is being set in the build.properties file for local building and then overidden in the build.xml file with this code:
<target name="build">
<available property="FLEX_HOME" value="/apps/flex_sdk_340" file="/apps/flex_sdk_340" />
<echo>FLEX_HOME = ${FLEX_HOME}</echo>
<antcall target="compile" />
</target>
I did notice a warning about not using the available property, so I removed it and just changed what FLEX_HOME was set to in the build.properties file to the server directory. Would mess up local building but regardless it didn't matter because it had no effect on the error being generated. I alos looked a little into the file property of the available tag trying to figure out if that was somehow an issue but I wasn't able to come to any conclusion.
Before the program errors out, it does displayt he echo statement and the value of FLEX_HOME appears to be correct in that it does show /apps/flex_sdk_340.
Thank you so much for your continued help. This is truly frustrating because nothing but a directory name has really changed and yet it stopped working. I can't find any information anywhere on what could be wrong and this is really my last resort. -
Flex tree displaying raw XML with tags
For some reason, after I setup a tree control and set its
dataprovider to an XML that a coldfusion component is returning,
the tree will display the raw XML in one node (including tags and
everything) instead of formatting it into folders and files. At
first I thought the coldfusion component was formatting the XML
incorrectly but after I used one of the example XML's in the adobe
docs, it will still display the RAW xml. This is the code where I
define the tree control:
<mx:Tree x="0" y="10" width="266" height="223"
id="courseTree" dataProvider="{myxml}"/>
and even using this example XML from the livedocs it still
doesnt format it and display folders and entries, it will display
the raw XML with tags:
<mx:XML id="myxml">
<Company label="Macromedia">
<Branch label="Newton">
<Department label="Flex Doc">
<Title label="Intern">
<Name label="Kapil Virdi"></Name>
</Title>
</Department>
</Branch>
</Company>
</mx:XML>I also tried the following format for the XML as the
datasource, and it still only displays the raw XML and not format
it into folders
<node>
<node label="Finance" dept="200">
<node label="John H" />
<node label="Sam K" />
</node>
<node label="Engineering" dept="300">
<node label="Erin M" />
<node label="Ann B" />
</node>
<node label="Operations" dept="400" isBranch="true" />
</node> -
http://www.adobe.com/devnet/flex/pdfs/getting_started_with_Flex3.pdf
what is prereq for reading above, and for start develop/reading with flex and cf(level?) ?The Flex Quickstarts will be a place for starters, if you want to know
about Flex/CF integration the first to know would be some basics of CF.
Sincerely,
Michael
Sent from my iPhone -
I have a question, but I posted it on the wrong forum. This is the link:
https://social.msdn.microsoft.com/Forums/en-US/899c8291-70f5-4c1b-abf2-a1a1242e017a/read-xml-file-with-counter?forum=visualstudiogeneral&prof=requiredHi,
I have created a program that read an xml file like this:
<xas>
<information>
<list>"12345"</list>
<version>1.0.0.1</version>
</information>
<word><n>0</n><v>test123v</v><a>test123a</a></word>
<word><n>1</n><v>testv</v><a>testa</a></word>
</xas>
I read it to a listview called listview1:
The MainWindow.xaml:
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="" Height="1220" Width="1017" WindowStartupLocation="Manual" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True" UseLayoutRounding="False" WindowState="Maximized">
<Grid>
<ListView x:Name="ListView1" HorizontalAlignment="Left" Height="1220" VerticalAlignment="Top" Width="1017">
<ListView.View>
<GridView x:Name="Lijst">
<GridViewColumn x:Name="Vraag" Header="Vraag" DisplayMemberBinding="{Binding Vraag}">
</GridViewColumn>
<GridViewColumn x:Name="Antwoord" Header="Antwoord" DisplayMemberBinding="{Binding Antwoord}">
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Window>
And this is MainWindow.xaml.vb:
Imports System.IO
Imports System.Reflection.Assembly
Imports System.Xml
Imports System.Data
Class MainWindow
Dim VraagListBox As New ListBox
Dim AntwoordListBox As New ListBox
Dim Hoofdmap As String = GetExecutingAssembly().Location
Dim Bestand As String
Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
'RUNNEN MAAR!!!!
'Het bestand vinden in de commandline argumenten
Dim args() As String = System.Environment.GetCommandLineArgs()
Dim Teller As Integer = "0"
For Each arg As String In args
If Teller = "1" Then
Bestand = arg
Else
Teller = Teller + "1"
End If
Next
Bestand = "D:\Alles voor school!\Alles voor school!\Vakken\Stepping Stones\DATA1\Hoofdstuk 1\Leerlijsten\Hoofdstuk 1 Grammer 1.xas"
'Welk bestand? Set de title
Me.Title = Path.GetFileName(Bestand) & " - ListViewer (V.1.0.0.6)"
If Bestand <> "" Then
'Vragen en antwoorden toevoegen in de kolommen
If Path.GetExtension(Bestand) = ".xas" Then
Dim orderInfo = XElement.Load(Bestand)
For Each entry As XElement In orderInfo...<word>
Dim thisOrder As New Order
With thisOrder
.Vraag = entry...<v>.Value
.Antwoord = entry...<a>.Value
End With
ListView1.Items.Add(thisOrder)
Next
'Virtuele vraaglistbox toevoegen = kolom Vraag van LisView1
Dim orderInfoVraag = XElement.Load(Bestand)
For Each entry As XElement In orderInfoVraag...<word>
Dim thisOrderVraag As New VraagClass
With thisOrderVraag
.Vraag = entry...<v>.Value
End With
VraagListBox.Items.Add(thisOrderVraag)
Next
'Virtuele antwoordlistbox toevoegen = kolom Antwoord van LisView1
Dim orderInfoAntwoord = XElement.Load(Bestand)
For Each entry As XElement In orderInfoAntwoord...<word>
Dim thisOrderAntwoord As New AntwoordClass
With thisOrderAntwoord
.Antwoord = entry...<a>.Value
End With
AntwoordListBox.Items.Add(thisOrderAntwoord)
Next
'Check wat er fout is aan het bestand, en geef een melding
Else
MessageBox.Show("Er is een verkeerde extentie geselecteerd, namelijk: " & Path.GetExtension(Bestand) & ".", "Verkeerde extentie - ListViewer", MessageBoxButton.OK, MessageBoxImage.Error)
Me.Close()
End If
Else
If Bestand = "" Then
MessageBox.Show("Je hebt geen bestand geselecteerd", "Geen bestand geselecteerd - ListViewer", MessageBoxButton.OK, MessageBoxImage.Error)
Me.Close()
Else
MessageBox.Show("Er is iets misgegaan met het laden van het bestand, probeer het later opnieuw", "Onbekende error - ListViewer", MessageBoxButton.OK, MessageBoxImage.Error)
Me.Close()
End If
End If
End Sub
Private Sub ListView1_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles ListView1.MouseDoubleClick
Directory.CreateDirectory(Path.GetTempPath & "110% Soft\ListViewer 1.0.0.6\" & Path.GetFileName(Bestand))
Dim SchrijfVraag As New StreamWriter(Path.GetTempPath & "110% Soft\ListViewer 1.0.0.6\Word.txt")
Dim SchrijfFile As New StreamWriter(Path.GetTempPath & "110% Soft\ListViewer 1.0.0.6\File.txt")
SchrijfVraag.WriteLine(ListView1.SelectedIndex)
SchrijfFile.WriteLine(Bestand)
SchrijfVraag.Close()
SchrijfFile.Close()
Dim WoordenScherm As ViewWord
WoordenScherm = New ViewWord()
WoordenScherm.ShowDialog()
End Sub
End Class
ViewWord.xaml is:
<Window x:Class="ViewWord"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="ViewWord" Height="155" Width="1017" ResizeMode="NoResize" SizeToContent="WidthAndHeight" Topmost="True" WindowStartupLocation="CenterScreen">
<Grid>
<Label x:Name="VraagLabel" Content="Vraag:" HorizontalAlignment="Left" Margin="23,11,0,0" VerticalAlignment="Top" Width="106"/>
<TextBox x:Name="VraagTextBox" HorizontalAlignment="Left" Height="24" Margin="134,13,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="743" />
<Label x:Name="AntwoordLabel" Content="Antwoord:" HorizontalAlignment="Left" Margin="23,42,0,0" VerticalAlignment="Top" Width="106"/>
<TextBox x:Name="AntwoordTextBox" HorizontalAlignment="Left" Height="24" Margin="134,44,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="743"/>
<Button x:Name="VraagAanpassenButton" Content="Aanpassen" HorizontalAlignment="Left" Margin="882,15,0,0" VerticalAlignment="Top" Width="107"/>
<Button x:Name="AntwoordAanpassenButton" Content="Aanpassen" HorizontalAlignment="Left" Margin="882,44,0,0" VerticalAlignment="Top" Width="107"/>
<Label x:Name="VraagNummerLabel" Content="Vraagnummer:" HorizontalAlignment="Left" Margin="23,72,0,0" VerticalAlignment="Top" Width="106"/>
<TextBox x:Name="VraagNummerTextBox" HorizontalAlignment="Left" Height="24" Margin="134,74,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="743"/>
<Button x:Name="VraagNummerAanpassenButton" Content="Aanpassen" HorizontalAlignment="Left" Margin="882,74,0,0" VerticalAlignment="Top" Width="107"/>
</Grid>
</Window>
In VraagTextBox must come the entry <word><v>test123v</v></word>, in AntwoordTextBox must come the entry <word><a>test123a</a></word>, and in VraagNummerTextBox must come the entry <word><n>0</n></word>
This is the code to fix that (ViewWord.xaml.vb):
Imports System.IO
Public Class ViewWord
Private Structure AntwoordVraag
Public Vraag As String
Public Antwoord As String
End Structure
Private Sub ViewWord_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
End Sub
Private Sub AntwoordAanpassenButton_Click(sender As Object, e As RoutedEventArgs) Handles AntwoordAanpassenButton.Click
Dim Vraagnummer As String
Dim Bestandsnaam As String
Dim LeesVraag As New StreamReader(Path.GetTempPath & "110% Soft\ListViewer 1.0.0.6\Word.txt")
Dim LeesFile As New StreamReader(Path.GetTempPath & "110% Soft\ListViewer 1.0.0.6\File.txt")
Vraagnummer = LeesVraag.ReadLine()
Bestandsnaam = LeesFile.ReadLine()
LeesVraag.Close()
LeesFile.Close()
MessageBox.Show(Vraagnummer)
Dim teller As Integer = 0
Dim orderInfo = XElement.Load(Bestandsnaam)
If teller = Vraagnummer Then
VraagNummerTextBox.Text = orderInfo...<word>...<n>.Value
VraagTextBox.Text = orderInfo...<word>...<v>.Value
AntwoordTextBox.Text = orderInfo...<word>...<a>.Value
Else
teller = teller + 1
End If
End Sub
End Class
But the result isn't:
VraagTextBox.Text = testv
AntwoordTextBox.Text = testa
NummerTextBox.Text = 1
if i click on the number 2 of the listview (index = 1)
How can i fix it? -
How to send data one row at a time from xml to flex
I want to setTimerEvent while sending data from xml to flex, one row at a time.
I have attached the xml.
Thanks in advance.Hi Greg,
Thanks for the reply. You must have seen the xml which i have attached.Here is the .mxml code which i have written:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="accountData.send()">
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
[Bindable]
private var AccountInformation:ArrayCollection;
private function AccountHandler(evt:ResultEvent):void
AccountInformation = evt.result.xml.AccInfo;
private function faultHandler(evt:FaultEvent):void
var faultMessage:String = "Could not connect with XML file";
Alert.show(faultMessage, "Error opening file");
]]>
</mx:Script>
<mx:HTTPService id="accountData" url="pgm1.xml" result="AccountHandler(event)" fault="faultHandler(event)" />
<mx:DataGrid x="20" y="24" width="950" dataProvider="{AccountInformation}" />
</mx:Application>
This reads and displays all the rows. But I want to display single row at a time with sometime time gap between the display of two consecutive rows.I am new to flex and this is my first code, so need your help on this.
I hope i have made myself clear. If there is anything else please let me know.
Looking forward to some solution.
Thanks in advance.
Regards,
praj58 -
AIR application with Flex 4.5 will not render content. What gives?
OK,
So I've upgraded to Flash Builder 4.5 Premium and I am unable to develop desktop AIR applications with the 4.5 Flex SDK. I start by simply creating a brand new AIR application using the default SDK (Flex 4.5). I set the title property on WindowedApplication and include a simple Label component. The project compiles fine but when I run the application all I see is the adl window in the dock but that's it. If I modify the Main-app.xml file to set the visible attribute to true, I will get a small window but there is no content although the output window shows the application swf being loaded. Checking the release version of the Main-app.xml file shows the correct path location to the swf.
Here is what I've tried so far:
Install/reinstall Flash Builder, 4+ times
Downloaded the trial installation twice
Downloaded the SDK's for 3.6, 4.1 and 4.5.0. I then copied each SDK folder and merged the AIR 2.6 SDK with each copy. So now I have 6 SDK versions; one pristine and the other with the AIR 2.6 SDK merged. I then added each SDK individually and created an AIR desktop application for each. Each and every one works fine with the exception of the two 4.5 SDK's. They will not render content.
I created a simple creation complete handler for the application that declares a simple variable and assigns a value to it. I then put a break point on the assignment and it never gets caught. More evidence that the swf isn't getting loaded.
The computer I'm running on is a Mac Book Pro with Snow Leopard 10.6.7. If I create a web project in each of the 6 SDK's, those will work just fine. What the heck is it with Flex 4.5 and the AIR 2.6 SDK on this machine? I have the AIR 2.6 runtime installed as well as a number of AIR applications that work just fine. I also tried my 4.5 test on my windows machine and that worked like a champ.
I am completely out of ideas. Finding information has been difficult because everyone is all about mobile so searching for desktop issues is a losing battle. I realize this is a long email but I'm desperate for help. There must be someone out there that knows more about the low level interaction between Flex 4.5/AIR 2.6 and the OS.Well, I finally found the issue, a corrupted mm.cfg file in /Library/Application Support/Macromedia. I deleted the file and then adl ran just fine.
Maybe you are looking for
-
Unable to create attribute dimension in Essbase Studio
Hi All, As per the process,I am create an Attribute for an dimension as below Hierarchy Family(gen1) SKU(gen2) Attribute1(gen1) SKU(gen2) Attribute2(gen2) SKU(gen3) Here the issue i am unable to create an 2nd attribute parallel to first on i mean att
-
Hello Experts, the record set of an IDoc contains a recipient and a sender information. As far as I know the recipient information is taken from the respective partner profile. But what is the source for the sender information? How are these fields f
-
hi, i configured the bubble chart(in a review) to have Prob. of Comm. success on X-axis and Risk Assessed on Y- Axis. Also the same parameters are mentioned against Series and Size as well(Prob.Comm. Success on Series and Risk assessed on Size). No
-
# frequencies in STFT spectrogram
The help file info for STFT Spectrogram says, in part: STFT Spectrogram {X} is a 2D array that describes the time waveform energy distribution in the joint time-frequency domain. The number of rows (time axis) in STFT Spectrogram {X} is given by the
-
Hi - I need to interface with a DLL. I can communicate fine with most of the functions, but I can't figure out how to configure Call Library Function for "GPIO_Init". Can anyone with more experience help me out? I've attached the header, and also the