Spry select with xml data
Can this be done with Spry and if so, how please?
I would like to have a dropdown select on my page that is
populated by the lastname field in my database. Once selected I
would like to display a table of the data I selected from the
dropdown. I am to connect to an XML datasource and able to connect
the dropdown to that last name field. I just don't know how to get
the selected last name from the drop down to display. Any help is
greatly appreciated.
<%@ Page Language="VB" ContentType="text/html"
ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
<script src="../../../SpryAssets/xpath.js"
type="text/javascript"></script>
<script src="../../../SpryAssets/SpryData.js"
type="text/javascript"></script>
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("so.xml",
"RESULTS/ROW",{distinctOnLoad:true});
-->
</script>
</head>
<body>
<p></p>
<div spry:region="ds1">
<select name="selectLastName"
spry:repeatchildren="ds1">
<option
value="{GlobalSubjectLastName}";>{GlobalSubjectLastName}</option>
</select>
</div>
<p></p>
<p></p>
<p> </p>
<p></p>
<p></p>
<div spry:region="ds1">
<table>
<tr>
<th spry:sort="GlobalSubjectFirstName">First
Name</th>
<th>Middle Name</th>
<th spry:sort="GlobalSubjectLastName">Last
Name</th>
<th> Address</th>
<th> City</th>
<th> State</th>
<th> Age</th>
<th>Charge Description</th>
</tr>
<tr spry:repeat="ds1" spry:setrow="ds1">
<td>{GlobalSubjectFirstName}</td>
<td>{GlobalSubjectMiddleName}</td>
<td>{GlobalSubjectLastName}</td>
<td>{GlobalSubjectAddress}</td>
<td>{GlobalSubjectAddressCity}</td>
<td>{GlobalSubjectAddressState}</td>
<td>{GlobalSubjectAge}</td>
<td>{ChargeStatuteDescription}</td>
</tr>
</table>
</div>
</body>
</html>
<span spry:region="dsCities dsStates dsStates" id="citySelector">
<select spry:repeatchildren="dsCities" id="citySelect" name="citySelect" tabindex="5" >
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{name}" selected="selected" tabindex="5" >{name}</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{name}" tabindex="5" >{name}</option>
</select>
that should be a spry:detailregion, and you have a double dsStates
And when you are using multiple datasets inside a region, it might wise to prefix you template tags with the correct dataset
{ds_RowNumber} => {dsStates::ds_RowNumber}
Similar Messages
-
Spry Tables and Xml Data Sets viewed in IE7
Has anyone ever run into a problem with Spry Tables and Xml
Data Sets viewed in IE7? Work fine in IE6 and Firefox, but get the
error "exception caught while loading feed.xml: [object Error]" in
IE 7. Any ideas?
Attached is the xml I'm using.
ThanksI came looking for the answer to this question. I could not
find an answer. Eventually I found it the answer that worked for
me, a graphic designer with not much experience in xml.
The following url provided an errata file in PDF format:
www.peachpit.com/dwcs3cib
which includes the following addendum to the incomplete
instructions in the book i was using to learn about spry:
"If Internet Explorer 7 is your primary browser, you'll nee
to take some extra steps to view spry dynamic content locally.
First, your site must be within the local server webroot; be sure
your Lessons folder is stored within the Inetpub>wwwroot folder.
Next, double-click the site name in the files panel to open the
Site Definition dialogue. Click the Testing Server category; from
the Access List choose Local/Network. Click Okay to close the Site
Definition dialogue. Now, when you preview your page with Internet
Explorer, your local Web server (localhost) serves the page as
designed."
Horray for me! Now i can move on from here and actually get
some work done! -
Populating a PDF form with XML data
Hi folks,
I would like to create some pdf form template, populate it with xml data and output from it a pdf file.
Can I do such thing using LiveCycle?
YairWith the recent release Adobe changed the name to Adobe Digitial Enterprise Platform (ADEP)..
http://www.adobe.com/solutions/customer-experience/enterprise-platform.html
ADEP server software comes with lot of services to help with many solutions for the enterprises, so it would be better to call the Adobe Sales team and discuss your needs and they will be best people to suggest what suits your company requirements.
Thanks
Srini -
I followed a procedure described in a book.
1. insert "Inventory.xml" file to a project "WpfXmlDataBinding" .
2. add the XML data source through the data panel of "blend for 2013", named it "InventoryXmlDataStore" and store it in the current document.
3. dragged and droppped the nodes from the Data panel onto the artboard.
Then I checked my Xaml file against the one provided by the book
Xaml file by the book:
<Window.Resources>
<!-- This part is missing in my xaml file --><XmlDataProvider x:Key="InventoryDataSource"
Source="\Inventory.xml"
d:IsDataSource="True"/>
<!-- This part is missing in my xaml file -->
<DataTemplate x:Key="ProductTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@ProductID}"/>
<TextBlock Text="{Binding XPath=Cost}"/>
<TextBlock Text="{Binding XPath=Description}"/>
<CheckBox IsChecked="{Binding XPath=HotItem}"/>
<TextBlock Text="{Binding XPath=Name}"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid>
<ListBox HorizontalAlignment="Left"
ItemTemplate="{DynamicResource ProductTemplate}"
ItemsSource="{Binding XPath=/Inventory/Product}"
Margin="89,65,0,77" Width="200"/>
</Grid>
my Xaml file:
<Window x:Class="WpfXmlDataBinding.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="922" Width="874">
<Window.Resources>
<DataTemplate x:Key="ProductTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@ProductID}"/>
<TextBlock Text="{Binding XPath=Cost}"/>
<TextBlock Text="{Binding XPath=Description}"/>
<CheckBox IsChecked="{Binding XPath=HotItem}"/>
<TextBlock Text="{Binding XPath=Name}"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid DataContext="{Binding Source={StaticResource InventoryXmlDataStore}}">
<ListBox HorizontalAlignment="Left" Height="370"
ItemTemplate="{DynamicResource ProductTemplate}"
ItemsSource="{Binding XPath=/Inventory/Product}"
Margin="65,55,0,0" VerticalAlignment="Top" Width="270"/>
</Grid>
</Window>
All looks quite the same except the <XmlDataProvider ....> part under <Window.Resources>, which is gone completely in my Xaml file.
1, Why?
2, How many different ways to deal with xml data source through WPF?
Thanks, guys.
(ps My "WpfXmlDataBinding" runs without problem through.)Never do yourself down Richard.
Leave that to other people.
It's quite common for smart developers to think they're not as good as they are.
I coach a fair bit and it's a surprisingly common feeling.
And to repeat.
Never use anything ends .. provider. They're for trivial demo apps. Transform xml into objects and use them. Write it back as xml. Preferably, use a database.
You want to read a little mvvm theory first.
http://en.wikipedia.org/wiki/Model_View_ViewModel
Whatever you do, don't read Josh Smiths explanation. I used to recommend it but it confuses the heck out newbies. Leave that until later.
Laurent Bugnion did a great presentation at mix10. Unfortunately that doesn't seem to be working on the MS site, but I have a copy. Download and watch:
http://1drv.ms/1IYxl3z
I'm writing an article at the moment which is aimed at beginners.
http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
The sample is just a collection of techniques really.
I have a sample which involves no real data but is intended to illustrate some aspects of how viewmodels "do stuff" and how you use datatemplates to generate UI.
I can't remember if I recommended it previously to you:
https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
And I have working samples which are aimed at illustrating line of business architecture. This is an incomplete step by step series but I think more than enough to chew on once you've done the previous stuff.
http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
The write up for step2 is work in progress.
https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
How to populate BusinessObjects metadata repository with .xml data?
Can we populate BusinessObjects metadata Repository with .xml data? If yes can you please share some document or link on how to do that?
Can we populate BusinessObjects metadata Repository with .xml data? If yes can you please share some document or link on how to do that?
-
Populating ComboBox with XML data
Hi there,
Probably the most basic question, but I'm having a hard time with this...
Trying to populate the ComboBox with XML data as a dataProvider.
Here is the code snippet:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
creationComplete="baseDataRequest.send()">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var baseDataXML:XML;
private function baseResultHandler(event:ResultEvent):void
baseDataXML = event.result.node.child as XML;
]]>
</mx:Script>
<mx:HTTPService id="baseDataRequest"
useProxy="false"
resultFormat="e4x"
result="baseResultHandler(event)"
url="XML_URL"/>
<mx:ComboBox id="comboDemo"
width="390"
dataProvider="{baseDataXML}"
labelField="NodeName"/>
</mx:Application>
And that returns nothing, basically. I know the XML is being pulled, because if I do this:
baseDataXML = event.result as XML;
then I just see a single item in my ComboBox, with full XML content.
How do I populate the ComboBox with XML contents?
XML example:
<root>
<node> <child>Child1</child>
<child>Child2</child>
</node>
</root>
Question: how do I populate the ComboBox with XML data nodes? I need <child> content to be the labelField of each combo box item...
Thanks!
K<mx:Script>
<![CDATA[
var baseDataXML:XML = <root><node><child>Child1</child><child>Child2</child></node></root>;
]]>
</mx:Script>
<mx:ComboBox id="comboDemo"
width="390"
dataProvider="{baseDataXML.node.child}"
labelField="NodeName"/>
Don't do:
baseDataXML = event.result.node.child as XML;
Instead just do:
baseDataXML = XML(event.result);
And in your combo:
dataProvider="{baseDataXML.node.child}" -
Selecting the XML data from a drop-down menu or links
Hi, I have this page:
http://www.georgeglazer.com/prints/nathist/botanical/volckinv/volckinv.html
There are prints of lemons/limes and prints of oranges. I
want to have the visitor select which kind of fruit from either a
drop-menu or from two links that look something like this:
Lemons/Limes | Oranges. Looking at other help docs I found the
region/state mapping demo at
http://labs.adobe.com/technologies/spry/samples/data_region/StateMappingSample.html,
and copied the code and tried to modify it. But I don't really
understand the technical shorthand of the help docs (an ongoing
problem I have with the Spry documentation) and I couldn't find the
XML docs that the region/state mapping demos are based on so I
couldn't see how they were set up.
I got as far as this: nothing loads initially when you open
the page (I'd like the lemons to load), but if you select Oranges
from the drop-down menu you see the oranges, and THEN once you've
done that, you can select Lemons/Limes in the drop-down menu and
see those. I have three XML files I've been playing around with to
get this to work: lemons.xml, oranges.xml and inventory.xml, which
combines the two.
I also suspect region/state mapping might not even be exactly
what I'm trying to do here, but I can't figure out from the
documentation exactly what this thing I'm trying to do is called. I
know the photo album demo accomplishes something similar, and I
could do that, but it seems way more complicated than what I need
here (right?). Help will be appreciated!
Thanks,
HelenI made a different test using the file
http://www.georgeglazer.com/prints/nathist/botanical/volckinv/inventory.xml
and
http://www.georgeglazer.com/prints/nathist/botanical/volckinv/volcktest.html
where I sent up the inventory xml form like one I found in the
Nested XML Data documentation where you have item ids and types, so
all the oranges and lemons are in one XML document (which I'd
prefer).
Here's an abbreviated version of the inventory.xml:
<inv_items>
<inv_item id="1" type="lemon">
<name>Lemons and Limes</name>
<title>Cedro Ordinario</title>
<plate>116a</plate>
<fullimage>pl116a.jpg</fullimage>
<tn>pl116a-2.jpg</tn>
</inv_item>
[and more lemons follow]
<inv_item id="19" type="orange">
<name>Oranges and Others</name>
<title>La Zucchetta Imperiale</title>
<plate>138a</plate>
<fullimage>pl138a.jpg</fullimage>
<tn>pl138a-2.jpg</tn>
</inv_item>
[and more oranges follow]
</inv_items>
What I'd like to do is display the names "Lemons and Limes"
and "Oranges and Others" and when you click on "Lemons and Limes"
you see only the thumbnails for lemons and limes, and when you
click on "Oranges and Others" you see the thumbnails for only
those. I'd like the Lemons and Limes to be selected when the page
is opened.
Help greatly appreciated! -
PDF form with XML data connection comes up blank at run time
Hello All,
I am a newbie to ADOBE Livecycle 9, but am very proficient in C#. I would like to request for your guidance on the following issue.
We have a desktop application in C#, WPF, Sqlserver. The requirement is to launch a Livecycle form from the application for the user to read/edit/save data
I have done this much so far -
Downloaded trial version of Livecycle 9
Developed a interactive PDf form
Created an XML based data connection. Generated fields on the form using the fields from this connection.
Set the .XML file as preview source for the form
the controls on the form are boumd to the xml data source
In design mode, the form works fine, it displays my data correctly
I have created a WPF form with a button. On click of this button, I call the Process.Start(pdf-file-path). My pdf is launched properly
I have added a combo box to my WPF form. I select a parameter from this, then call a stored procedure which returns me a datatable depending on parameter passed
Using the returned datatable, I have used the datatable.writexml and datatable.writexmlschema to create my XML and XSD files. as mentioned above, this xsd is used to create the data connection for the PDF and the XML for the preview source
This is what I want to do -
Launch the PDF from my WPF form, pre-populated with the newly created XML data from my WPF form.
So basically, as the user changes the selection criteria from the combo box, the XML file data will change and the PDF file will be launched each time with new data.
The XSD format will always be constant
Problem -
My XML and XSD get created properly, my PDF launches, but it is empty
If I change my selection criteria and run the WPF application, and then open the PDF in design mode, it asks me whether it should refresh the XML source. This means that the PDF form is connecting correctly to the XML source
So why then, does the form come up empty at run time?
What link am I missing?
I have found some sites that help using Web applications, but nothing for desktop applications. It would be fantastic if you could point me to some help for developing Livecycle forms with C# / SQLServer
Your help in this case will be highly appreciated.
Thanks and RegardsOops, something happended with the above post. I will try again... I have tried your suggestion but I still get the same garbled XML (with data repeated and some values "cut in half".<br /><br />Here is what I get after decode-service and extract-to-XML-service. This is just the first barcode, the others are similar, sorry for the poor formatting, but I get a CDATA tage infront of the "istensen" value.<br /> <br />CDATA:istensen</fld_ForMellemEfterNavn<br />><fld_VejNRpostByEnLinie<br />>Superroad 99, 1330 Supertown</fld_VejNRpostByEnLinie<br />><fld_PrivatTelefonnummer<br />>20724283</fld_PrivatTelefonnummer<br />></sub_Person<br />></sub_PktA<br />><fld_BlanketNr<br />>kb0371ff</fld_BlanketNr<br />><fld_BarcodeCount<br />/></form1<br />>/sub_Adresse<br />><sub_Person<br />><fld_ForMellemEfterNavn>Kim Christensen</fld_ForMellemEfterNavn<br />><fld_VejNRpostByEnLinie<br />> Superroad 99, 1330 Supertown </fld_VejNRpostByEnLinie<br />><fld_PrivatTelefonnummer<br />>20724283</fld_PrivatTelefonnummer<br />></sub_Person<br />></sub_PktA<br />><fld_BlanketNr<br />>kb0371ff</fld_BlanketNr<br />><fld_BarcodeCount<br />/></form1<br /><br />Obviously this is not a legal xml-string, so I can do nothing about it.<br /><br />I have tried using a custom .NET component (ClearImage) for reading the same form (with the barcode) I get the correct data out from the barcodes. So I guess something is wrong with the decode-service in Barcoded Forms ES when I use compressed XML. But I can conclude since the ClearImage component can read the barcodes that they are compressed correctly.<br /><br />Can you help me with getting further with this problem?<br /><br />Sincerely<br />Kim
-
CollapsiblePanel with XML data source
I've been working with the CollapsiblePanel for the past two
nights. I can't make the panel collapse at runtime when I have XML
data attached.
I validated by downloading one of the Adobe Lab
CollapsiblePanel samples. I validated that I could make the sample
work from my Dreamweaver CS3 environment. Then, I added an XML data
source and retested. The panel would not collapse. Then, I took out
the XML dataset and retested the CollapsiblePanel. It worked.
Is this a design feature? I can't imagine this was designed
to work this way. I'm trying to create a scrollable div that can
collapse. I have everything working except the collapse feature.
(BTW: I tried defining a spry:region and spry:detailregion, it
didn't seem to matter.)
CODE SNIPIT
<div id="CollapsiblePanel1" class="CollapsiblePanel"
spry:region="dsWeek">
<div class="CollapsiblePanelTab">Standard Collapsible
Panel</div>
<div class="CollapsiblePanelContent">
<p>{feature}</p>
</div>
</div>How does the xml data look like? in GML?
If the xml data set is not too large, maybe you can add them (after your application has parsed them) as additional MapViewer GeoFeatures in a map request.
Currently MapViewer (preview or production release of 9.0.4) does not support xml-only datasource.
We will look into incorporating GML or other standard-based xml datasource for a future release of MapViewer. -
Working with xml data collections (sequences)
Dear all,
a database adapter in my BPEL process returns the following xml data structure:
Schema:
<xs:element name="MGroupsCollection" type="MGroupsCollection"/>
<xs:complexType name="MGroupsCollection">
<xs:sequence>
<xs:element name="MGroups" type="MGroups" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MGroups">
<xs:sequence>
<xs:element name="id" type="xs:int"/>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Instance (example, namespaces deleted):
<MGroupsCollection>
<MGroups>
<id>23</id>
<name>group2</name>
</MGroups>
<!-- more MGroups -->
</MGroupsCollection>
Now, I want to transform this structure into the following one:
Schema:
<xs:element name="Groups">
<xs:complexType>
<xs:sequence>
<xs:element name="Group" type="Group" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Group">
<xs:sequence>
<xs:element name="id" type="xs:int"/>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Instance (example, namespaces deleted):
<Groups>
<Group>
<id>23</id>
<name>group2</name>
</Group>
<!-- more Group elements -->
</Groups>
Implementing an XSLT transform activity, I faced no problems:
<xsl:template match="db:MGroupsCollection">
<sedd:Groups>
<xsl:for-each select="db:MGroups">
<sedd:Group>
<sedd:id>
<xsl:value-of select="db:id"/>
</sedd:id>
<sedd:name>
<xsl:value-of select="db:name"/>
</sedd:name>
</sedd:Group>
</xsl:for-each>
</sedd:Groups>
</xsl:template>
Now, I thought I can use an assign activity instead of the transform activity above to transform the structure. Here's the code:
<assign name="AssignSelectedGroups">
<copy>
<from variable="InvokeSelectGroups_SelectGroupsAdapterSelect_OutputVariable"
part="MGroupsCollection"
query="/ns3:MGroupsCollection"/>
<to variable="Groups" query="/client:Groups"/>
</copy>
</assign>
Using this assign activity (see above) the BPEL process runs without errors too. But the process produced the following structure (namespaces deleted):
<Groups>
<MGroups>
<id>23</id>
<name>group2</name>
</MGroups>
<!-- more MGroups -->
</Groups>
My questions is: As you can see in the schema definition of "Groups" (see above) this element contains one or more "Group" elements, but not one or "MGroups" elements. But "MGroups" are copied into "Groups" using the assign activity which is not valid according to the schema definition. Nevertheless, my BPEL process does not throw an exception.
Can somebody explain this issue?
Thanks in advance!
Lars Geldnerhttp://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/manipdoc.htm#CIHBBFEC
3.14 Validating XML Data with bpelx:validate
Does that one work for you ?
Yes it's possible to reconstruct your xml by the assing options. If you create the assign activity you will see besides the copy also options like insert-before insert-after append etc
With those you can construct your own variable like the way you want it..resort elements etc -
I have posted this over on the Spry forum but wonder if someone else has had a similar issue and found a solution as I am trying to find the answer to this quickly if possible; I want to use a tooltip with an xml data set.
I have an xml data set of events and within it there is a tooltip element. How can I get another element to act as a trigger so my tooltip appears when I mouseover the element?
My data set is displaying correctly. I'm trying to get the event title element to act as the trigger and the code that I have so far:
<div spry:region="eventsDS">
<table width="533">
<tr>
<th width="108" spry:sort="date">Date</th>
<th width="105" spry:sort="title">Title</th>
<th width="98" spry:sort="location">Location</th>
<th width="202" spry:sort="price">Price</th>
</tr>
<tr spry:repeat="eventsDS">
<td>{date}</td>
<td><a href="#tooltiptrigger">{title}</a></td>
<td>{location}</td>
<td>{price}</td>
</tr>
</table>
</div>
<div class="tooltipContent" id="sprytooltip" spry:detailregion="eventsDS">{tooltip}</div>
<p><a href="#top">back to top</a></p>
<script type="text/javascript">
var sprytooltip = new Spry.Widget.Tooltip("sprytooltip", "#tooltiptrigger");
</script>I see & chars in your xml, try wrapping it in <[CDATA[
]> tags like this:
<description> <[CDATA[Beer (B), Beer & Wine (BW)
or Beer, Wine & Liquor (BWL)<br />
Off sale only, no consumption on the licensed
premises]]></description>
Also if check out your xml in firefox, you will see that it
shows a parsing error, most likely caused by the issue i addressed
above. -
I have a table with
Column1 = trid VARCHAR2 (5)
Column2 = amount VARCHAR2(3000)
In the column 2 I am storing the XML data using the normal Insert statement.
Let me give you example
Let us take an example
trid amount
1 <DATA> <F1>1000 </F1><F2>5000 </F2></DATA>
1 <DATA> <F1>5000 </F1><F2>8000 </F2></DATA>
2 <DATA> <F1>4300 </F1><F3>3300 </F3><F4>43400 </F4></DATA>
2 <DATA> <F1>4340 </F1><F3>34500 </F3> <F4>400 </F4></DATA>
I would like the out put in the following format.
for trid 1 as
trid F1 F2
1 1000 5000
1 5000 8000
for trid 2 as
trid F1 F3 F4
2 1000 5000 43400
2 4340 34500 400
I would like the result to be displayed by using SQL (SELECT) statement against the above table.
basically I want a parsed output. I know now oracle supporting xml also.
any help with code is appreciated.
I know we can do it using some of fuctions but is there any xml data parser in oracle?
thanks
nullYou will have to have all fragments on your design ...then wrap them in a subformset. Once the subformset appears then on the Object/SubformSet palette you can choose the type as "Select One Subform from Alternatives". Then Edit alternatives - the Edit Data Nominated Subforms panel appears. You willl want the choose Subform using Expression option. Then you can add an expression to evaluate (note the language selector) that indicates when you want the subform to appear. The Bindings will point to the datadom so you can point to specifoc field elements in your case or if you have a schema then you can drill down to the specific node.
Let me know how it works for you. -
As I'm learning, I also am experiencing some difficulties.
I've tried to combine some XML data with an accordion. Since
the <div> solutions gave me errors, I found some inspiration
in the following
thread.
Can somebody help me and explain why this isn't working? (PS
I'm a newbie).
Some explanation what you might see in the code below:
- List view => ok = list generated from XML
- Manual Accordion => ok = HTML for the accordion
- Accordion from XML data => NOK = attempt to combine List
view and Manual Accordion =
Final goal
----------------------------------------Beginning of the
code----------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
<title>00r05</title>
<!--Link the Spry libraries-->
<script type="text/javascript"
src="../Spry_1_6_1_022408/includes/xpath.js"></script>
<script type="text/javascript"
src="../Spry_1_6_1_022408/includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript"
src="../Spry_1_6_1_022408/includes/SpryNestedXMLDataSet.js"></script>
<script type="text/javascript">
var dsSubjects = new
Spry.Data.XMLDataSet("00r03_content.xml", "subjects/subject");
var dsSubSubjects = new
Spry.Data.NestedXMLDataSet(dsSubjects, "subsubject");
</script>
<!--Accordion-->
<script language="JavaScript" type="text/javascript"
src="../Spry_1_6_1_022408/widgets/accordion/SpryAccordion.js"></script>
<link
href="../Spry_1_6_1_022408/widgets/accordion/SpryAccordion.css"
rel="stylesheet" type="text/css" />
</head>
<body>
<!--
<div spry:region="dsSubjects">
<ol>
<li
spry:repeat="dsSubjects">{dsSubjects::name}</li>
</ol>
</div>
-->
<p>---------List View---------</p>
<div spry:region="dsSubjects dsSubSubjects">
<ul>
<li spry:repeat="dsSubjects">{name}
<ul>
<li
spry:repeat="dsSubSubjects">{dsSubSubjects::name}</li>
</ul>
</li>
</ul>
</div>
<p>---------Manual Accordion---------</p>
<div id="testAccordionManual" class="Accordion">
<ul class="AccordionPanel">
<li class="AccordionPanelTab">home</li>
<ul class="AccordionPanelContent">
</ul>
</ul>
<ul class="AccordionPanel">
<li class="AccordionPanelTab">Products</li>
<ul class="AccordionPanelContent">
<li>Product 1</li>
<li>Product 2</li>
</ul>
</ul>
<ul class="AccordionPanel">
<li class="AccordionPanelTab">Contact</li>
<ul class="AccordionPanelContent">
</ul>
</ul>
</div>
<p>---------Accordion from XML data---------</p>
<div id="testAccordionAuto" class="Accordion"
spry:region="dsSubjects dsSubSubjects">
<ul class="AccordionPanel">
<li class="AccordionPanelTab"
spry:repeat="dsSubjects">{dsSubjects::name}</li>
<ul class="AccordionPanelContent">
<li
spry:repeat="dsSubSubjects">{dsSubSubjects::name}</li>
</ul>
</ul>
</div>
<script>
var acc1 = new Spry.Widget.Accordion("testAccordionManual");
var acc2 = new Spry.Widget.Accordion("testAccordionAuto");
</script>
</body>
</html>
----------------------------------------Ending of the
code----------------------------------------quote:
Originally posted by:
V1 Fusion
Your missing a </li>
<li spry:repeat="dsSubjects">{name}
Many thanks. That seams the be the issue.
However, I'm not able to resolve it. After experimenting I've
noticed that either:
- I can get the </li> correct, but then the script
generates only the three panel tabs without the content
- or I have the issue with the </Li> as you explained
So the issue must be with the way I define my list. But I'm
missing something to get it right.
Help is more then welcome.
quote:
Originally posted by:
V1 Fusion
and uhm:
Did u check this example for your accordion data issues?
http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample2.html
Yes I did. I even managed to reconstruct it with my own data.
But what if you would like to see the 5 addresses of "Edward
Smith"? While working with this example I experienced a counter
issue. The example was not elaborative enough to be useful too me
(and a lot of others if you read trough this forum).
quote:
Originally posted by:
Idriel
Here you can se Accordation from XML and Nested DataSet. I
have all created.
http://zagreb-rugby.hr/igraci.html?id=seniori
Wow, impressive! I'll hope I manage to get as smart as you
are and built something just like that.
It took me a while before I got the concept. And you
explained it very well. The concept contains 2 kind of data sets,
one external and the other embedded.
I also tested it and it is a workaround. Unfortunately, as
I'm studying the AJAX and SPRY concepts, I want to see how far I
can go ... with as little as help and workarounds as possible.
That said, I of course welcome all help when needed, but I
need the challenge as well.
PS I'll hope you have a great rugby season with your team ;-) -
Hi,
I have to update Table by reading Xml data.
I have written a procedure which is given below.
PROCEDURE Sp_Set_File_Permission
p_i_v_xml_data IN VARCHAR2,
Cur_Out_Col_Nm OUT Typ_Icon_Out
IS
XmlDataset XMLTYPE;
BEGIN
/* This is my xml
<xmldata>
<newdataset>
<fileid>99</fileid>
<add>TRUE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
<newdataset>
<fileid>100</fileid>
<add>FALSE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
</xmldata>*/
xmldataset := Xmltype.Createxml(p_i_v_Xml_Data);
--error occured on this line while executing procedure
FOR i IN (SELECT
Dt.Extract('//newdataset/fileid/text()').Getstringval() AS Fileid,
Dt.Extract('//newdataset/add/text()').Getstringval() AS Add,
Dt.Extract('//newdataset/edit/text()').Getstringval() AS Edit,
Dt.Extract('//newdataset/del/text()').Getstringval() AS d,
Dt.Extract('//newdataset/ex/text()').Getstringval() AS e,
Dt.Extract('//newdataset/im/text()').Getstringval() AS I
FROM TABLE(Xmlsequence( xmldataset.Extract('//xmldata/newdataset'))) Dt)
LOOP
UPDATE t_object_master
SET add_view=i.Add
,edit_view=i.Edit,
delete_view=i.D,
export_view=i.E,
import_view=i.I
WHERE objct_id=i.Fileid;
COMMIT;
END LOOP;
END Sp_Set_File_Permission;
When I am trying to exceute this procedure with the above mentioned xml ,getting error ORA-00923 ,FROM keyword not found where expected.
Please help me out in this.
Thanks,Something like this (no commit inside loop, no row per row)
create table t_object_master as
with myxml as (
select xmltype(
'<xmldata>
<newdataset>
<fileid>99</fileid>
<add>TRUE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
<newdataset>
<fileid>100</fileid>
<add>FALSE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
</xmldata>') doc from dual
select
fileid
,add_view
from
myxml
,xmltable('//newdataset'
passing myxml.doc
columns
Fileid number path 'fileid'
,add_view varchar2(5) path 'add'
table created
select
from t_object_master
FILEID
ADD_VIEW
99
TRUE
100
FALSE
update t_object_master t
set add_view = (
with myxml as (
select xmltype(
'<xmldata>
<newdataset>
<fileid>99</fileid>
<add>FALSE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
<newdataset>
<fileid>100</fileid>
<add>TRUE</add>
<edit>TRUE</edit>
<del>FALSE</del>
<ex>FALSE</ex>
<im>TRUE</im>
</newdataset>
</xmldata>') doc from dual
, myextract as (
select
fileid
,add_view
from
myxml
,xmltable('//newdataset'
passing myxml.doc
columns
Fileid number path 'fileid'
,add_view varchar2(5) path 'add'
select
add_view
from myextract
where
fileid = t.fileid
select *
from t_object_master
FILEID
ADD_VIEW
99
FALSE
100
TRUE -
How to Create a Table in Oracle with XML data type.
Dear ALL,
What are the requirements for creating a table with xml datatype in Oracle: The steps would help very much to know the scripting of the table and how to query and either insert/update and remove data from that table.
Any help, direction, advise would be highly appreciated.
Thanks.Reffer to this Note.243554.1.
In a nut shell you will need to run catqm.sql
Maybe you are looking for
-
PC Exchange has stopped working
The PC exchange function of my iMac (9.2.2) has stopped working. I can open PC files directly from the appropriate application, but double clicking on the PC file results in an error message that the application that created it is not on this compute
-
JDBC:KPRB string size limits-NEED HELP!
Hello All. Please, I need your help. I have the problems in Oracle 9.2.0.6 with stored java and jdbc:kprb internal driver. I try to put string(more than 32K) into LONG-type field using following java class: import oracle.sql.CLOB; import java.sql.Con
-
Hi i would like you ask you if there is another way how to open .exe files without using boot camp or paralels ?
-
Asynchrono​us Call - collect values without waiting for sub VI to finish executing
Hi All, I'm relatively new to LabVIEW and for the first time I'm attempting to make use of Asynchronous calls in a program. What I would like to accomplish, generally, is this: At the beginning of the main vi, begin running a sub-vi in the background
-
well i have designed a scenario .. msg split .. i could not get out put i designed and configured correctly.. but when i was into RWB for monitoring .. i was first message monitoring.. i got status as SYSTEM ERROR. what is this error. when i was int