Problem filling DataGrid with XML - Object or ArrayCollection?

Hi,
I am trying to fill a datagrid with an XML file, rendered
from a PHP
script.
The problem is that - first time there is only one entry in
the XML
file, so when I receive the data using
event.result.root.child, I get
an Object. But second time, when there are two entries in the
XML
file, the return type becomes an ArrayCollection of "child"
type
objects.
This causes a problem when setting dataprovider of a
DataGrid....
So is there a way I can know what is the return type from the
XML
file, i.e., whether it is an Object or an ArrayCollection, so
that I
can set the dataprovider accordingly?

In E4x
If you have an xml structure like so:
<parent prop1='someValue' >
<child prop1='someValue' />
</parent>
to reference the parent use event.result
to get the child use: event.result.child; to get the child
attr: event.result.child.@prop1;

Similar Messages

  • Oracle reports problem in distribution with xml file

    Hi ,
    I am having problem while I am trying to distribute the file with specifing the destination details in the xml. If I am giving the destination details in url then it is working.
    Ex.
    This is Working
    http://bryxh91:8889/reports/rwservlet?report=devlopersuit/reports/test.jsp&userid=anju/[email protected]&desformat=pdf&destype=file&desname=devlopersuit/reports/output_file.pdf
    Not working :
    http://bryxh91:8889/reports/rwservlet?report=devlopersuit/reports/test.jsp&userid=anju/[email protected]&DISTRIBUTE=YES&destination=devlopersuit/reports/dis_test.xml
    xml file
    <destinations>
    <file id="test" name="output_file.pdf" format="pdf">
    <include scr="mainSection"/>
    </file>
    </destinations>
    Error : REP-34304: Distribution failed to complete; review the distribution lists
    Its been week I tried many things , but not working.
    Right now I am trying to distribute to single file but my goal is to burst and distribute on basis of account number.
    This is the first stage of the project.
    Thanks a lot for the help
    Anju

    Hello
    see answer in Oracle reports problem in distribution with xml file
    Regards

  • Rotate gradient fills along with an object

    I created an object with gradient fills.  I grouped all of the elements in the object.
    When I try to rotate the object, the gradient fills do not rotate with the object.  An element that was transformed by: Effects->Warp->Arc also doesn't rotate as I would expect.
    Is there a way to tell Illustrator to rotate an object and keep it looking like it did before the rotate?
    (I'm using Illustrator CS5 on Windows XP.)
    Thanks!

    Regarding rotation of an ordianry grad fill applied to a single path:
    State EXACTLY and COMPLETELY, click-by-click, command-by-command, tool-by-tool, step-by-step, the minimum steps necessary to replicate the behavior you are seeing.
    Regarding a live effect like Warp:
    It is normal behavior for the Effect to not "rotate" with the object, because you are rotating the object to which the live effect is applied. The live effect is automatically re-applied after every edit you make to the object. That's what the "live" nature of "live effects" is all about; it gets re-applied automatically on-the-fly as you edit the original object. The fact that live effects do not "rotate with the object" can be used to great advantage.
    One way to cause the effect to "rotate with the object" is to store the object as a Symbol. Then, when you rotate Instances of that Symbol, the reference geometry of the effect is rotated also.
    JET

  • Problem in filling datagrid with a java service

    Hi i have a java service that returns an arrayList of TypeTicketVO ,in the side   of java when i tested my service it returns the correct result in the console but in the side of flex data grid is always empty and not filled with data (in fact this code recuperate 2 data field filled by the user and call the java service when the buttun is clicked
    this is my mxml :
    [Bindable]
                                  var startDate:Date;
                                  [Bindable]
                                  var endDate:Date;
      [Bindable]
                                  private var  FinalResult:ArrayCollection = new ArrayCollection();
    public function getTicketByStatus(evt:ResultEvent):void
    FinalResult= evt.result as ArrayCollection;
    protected function buttnSta_clickHandler(event:MouseEvent):void
    startDate=StartDateField.selectedDate;
    endDate=EndDateField.selectedDate;
    CountTicketsByStatusResult.addEventListener(ResultEvent.RESULT,getTicketByStatus);
    CountTicketsByStatusResult.token = ticketServiceImpl.CountTicketsByStatus(startDate,endDate);
    <mx:DataGrid id="dg" x="306" y="91" width="354" height="208" dataProvider="{FinalResult}">
    help please

    Hi.
    You can add extra path information by using the -extrapath option in your
    installNTservice.cmd script.
    Regards,
    Michael
    martin wang wrote:
    When I installed a weblogic server as a windows service using installNTservice.cmd,
    I found that the system path was not appended to the java.library.path. Here is
    the detail:
    step 1: went to ...\config\mydomain, run installNTservice.cmd, and the weblogic
    server "myServer" was installed as a NT service.
    step 2: went to Control Panel -> administrative tools -> services and started
    up the service "myserver".
    step 3: went to ...\config\mydomain\logs, open Weblogic.log and found that:
    java.library.path = C:\bea\wlserver6.0\bin;.;C:\WINNT\System32;C:\WINNT
    usually java.library.path should be the above paths plus the system path(which
    can be changed in control panel -> system ->advanced -> environment variables
    Does any one know why?--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Filling tables with XML data

    Hi!!
    I need help with this!! I don't know the right way to implement such a problem!
    Here is the scenario:
    I do have a number of tables (relations) created in MS Access and I do have an XML document now what I'm looking for is to fill these tables with data from the XML document!
    Here are the tables that I have (IDs are auto numbered fields)
    Table Name: datee
    Fields:
    1- datee_ID
    2- datee_day
    3- datee_month
    4- datee_year
    Table Name: paragraph
    Fields:
    1- paragraph_ID
    2- paragraph_String
    Table Name: month
    Fields:
    1- month_ID
    2- month_String
    Table Name: notee
    Fields:
    1- notee_ID
    2- notee_to
    3- notee_from
    4- notee_heading
    5- notee_datee_day
    6- notee_datee_month
    7- notee_datee_year
    Table Name: year
    Fields:
    1- year_ID
    2- year_String
    Table Name: day
    Fields:
    1- day_ID
    2- day_String
    Table Name: to
    Fields:
    1- to_ID
    2- to_String
    Table Name: from
    Fields:
    1- from_ID
    2- from_String
    Table Name: heading
    Fields:
    1- heading_ID
    2- heading_String
    Table Name: notee_paragraph
    Fields:
    1- notee_paragraph_ID
    2- notee_ParentID
    3- notee_paragraph_String
    Here is the XML document
    <notee>
    <to>Jane</to>
    <from>Tom</from>
    <heading>Reminder</heading>
    <paragraph>Hi</paragraph>
    <paragraph>Don�t be late!</paragraph>
    <datee>
    <day>13</day>
    <month>May</month>
    <year>2004</year>
    </datee>
    <to>Mark</to>
    <from>Ed</from>
    <heading>Invitation</heading>
    <paragraph>Hello</paragraph>
    <paragraph>Please come</paragraph>
    <paragraph>Take care</paragraph>
    <datee>
    <day>14</day>
    <month>March</month>
    <year>2004</year>
    </datee>
    </notee>
    I used DOM to parse the XML document but my only problem is in finding an algorithm that I should follow to fill in these tables!! so HOW!! I'm a bit confused??
    Any help or advice will be highly appreciated!

    For each of your elements, build a class representing the object. All your classes should have a method
    to create an instance of the class from an XML node (i.e. public static Object fromXML(Node)), and also
    a 'full constructor' (with parameters for all members of the class.
    Then, build utility classes to hold the table access.
    Short example for table DATEE:
    public class Datee {
       private int id;
       private byte day, month, year;
       public Datee(int id, byte day, byte month, byte year) {
          this.id = id;
          this.day = day;
          this.month = month;
          this.year = year;
       public static Object fromXML(Node node) {
          NamedNodeMap attributes = node.getAttributes();
          String strid = attributes.getNamedItem("id").getNodeValue();
          String strday = attributes.getNamedItem("day").getNodeValue();
          String strmonth = attributes.getNamedItem("month").getNodeValue();
          String stryear = attributes.getNamedItem("year").getNodeValue();
          try {
             id = Integer.parseInt(strid);
             day = Integer.parseInt(strday);
             month = Integer.parseInt(strmonth);
             year = Integer.parseInt(stryear);
          catch(Exception e) {
          return new Datee(id, day, month, year);
    }Its of course the simplest example. If instance contains other object instances, just use its fromXML() method to create it.
    Hope this helped,
    Regards.

  • Help with creating objects for ArrayCollection

    Hi all,
    I am trying to update an ArrayCollection with Objects created
    in ActionScript
    In the end the array collection will provide data to a chart
    I can add the objects to my arrayCollection and access the
    values of the properties via text field output but the data is not
    Bindable
    So my text field shows the values from my AC but my chart
    isn't getting the data

    AaffordableWeb:
    Wrapping the Object in an ObjectProxy seems to have worked in
    that the properties are bound but my Chart shows nothing.
    I have posted the code below (keep in mind its a work in
    progress)
    Any help would be appreciated.
    //////Code
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="handleResult(event);">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent;
    import mx.rpc.events.ResultEvent;
    import mx.utils.ObjectUtil;
    import mx.utils.ObjectProxy;
    //// set price change range for the four arrays
    [Bindable]
    public var nPchange:Array = new Array(-12, -11,
    -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0);
    [Bindable]
    public var pPchange:Array = new Array(12, 11,
    10,9,8,7,6,5,4,3,2,1,0);
    //// Set up temprary var
    [Bindable]
    public var tempval:*;
    [Bindable]
    public var tempval2:*;
    [Bindable]
    public var tempvaly:*;
    [Bindable]
    public var tempvalr:*;
    [Bindable]
    public var tempvalr2:*;
    [Bindable]
    public var tempvalry:*;
    [Bindable]
    public var ylovert:Array = new Array;
    [Bindable]
    public var rylovert:Array = new Array;
    [Bindable]
    public var ymin:*;
    [Bindable]
    public var testarray:Array;
    /// declare the lPrime ac
    // declare the rprime ac
    [Bindable]
    public var rPrime:ArrayCollection = new ArrayCollection();
    // declare rylover ac
    [Bindable]
    public var ryLover:ArrayCollection = new ArrayCollection();
    // declare ylover ac
    [Bindable]
    public var yLover:ArrayCollection = new ArrayCollection();
    /// declare default cMargin
    [Bindable]
    public var cMargin:* = 80;
    [Bindable]
    public var lPrime:ArrayCollection;
    public function handleResult(event:FlexEvent):void
    pedata();
    public function pedata():*{
    /// begin loop
    lPrime = new ArrayCollection();
    for(var n:int = 0; n < nPchange.length; n++){
    var value:* = nPchange[n];
    if(value == 0){value = .0001;}else{value = value;}
    tempval = -1 * value / (cMargin + value);
    tempval2 = (tempval / value);
    ylovert.push(tempval2);
    var o:Object = new Object;
    o.PriceChange= value;
    o.PriceElasticity= tempval2;
    lPrime.addItem(new ObjectProxy(o));
    } // end loop
    lprime.xField= "PriceChange";
    lprime.yField= "PriceElasticity";
    lprime.dataProvider = lPrime;
    ///last brkt
    ]]>
    </mx:Script>
    <mx:AreaChart id="myChart" showDataTips="true"
    mouseSensitivity="25" width="100%" >
    <mx:horizontalAxis>
    <mx:LinearAxis maximumLabelPrecision="1" title="Pricec2a"
    minimum="-12" maximum="12"/>
    </mx:horizontalAxis>
    <mx:verticalAxis>
    <mx:LinearAxis displayName="Price Elasticity to Break
    Even" minimum="-1.5" maximum="-1" />
    </mx:verticalAxis>
    <mx:series>
    <mx:AreaSeries id="lprime" form="curve" >
    <mx:areaFill>
    <mx:SolidColor color="red"/>
    </mx:areaFill></mx:AreaSeries>
    </mx:series>
    </mx:AreaChart>
    <mx:Text id="txt2"
    text="{lPrime.getItemAt(3).PriceElasticity}"/>
    </mx:Application>

  • Drag-n-Drop problem in DataGrid with custom ItemRenderer

    Hi,
    I am trying to use a DataGrid to set the ordering of a group
    of images.
    I want to do this with a DataGrid which will show me some
    properties of
    the images in different columns including a thumbnail of the
    image. The
    problem is when I use any custom renderer for any column, the
    draging is
    not working. It works fine when I don't use any ItemRenderer.
    My code looks something like this:
    <mx:DataGrid dragEnabled= "true" dropEnabled= "true"
    dragMoveEnabled= "true">
    <mx:columns>
    <mx:DataGridColumn headerText="Thumb" itemRenderer=
    "component. GridImageRenderer"/>
    <mx:DataGridColumn headerText="Current name" width="100"
    itemRenderer= "component. NameRenderer" />
    <mx:DataGridColumn headerText="New name" width="150"
    dataField="nameNew" />
    </mx:columns>
    </mx:DataGrid>
    Can anyone please give me any clue how to fix this?
    Regards,
    ~ Arif

    Hello again, BinaryDigit.
    I thought we need to apply Drag n drop API for this case.
    Without wasting too much time,
    I tried out as your source code from the previous reply,,,
    Instead of getting it clearly, I got another Confusion... (pardon me)
    Let me clarify this with the examples given,
    I try to adopt previous source code
    and it was this detail;
    1) Taking the X and Y coordinate (from the mouseEvent) Plus jLabel1 coordinate (both X and Y).
    2) Positioning a Coordinate taken to JLabel1
    3) Passing the Coordinate taken to jLabelX, and jLabelY.
    The problem found was;
    if we make 3rd become comments, now the jLabel1
    could works!
    I mean, jLabel1 could be dragged to another Coordinate (by dragging it to another location)
    But,
    if we un-comments the 3rd source code,
    The effect would be no movement of the jLabel1.
    BinaryDigit, is this related to the layout you mentioned before?
    Correct, DarrylBurke! :D
    I thought also the same thing,
    but setLocation() give me another Confusion....
    the coordinate seems taking its basement as a reference.
    I mean, the jLabel Coordinate's is referenced
    from the panel where the jLabel is attached to,
    rather than the Coordinate's of the base jFrame (main base -what should I call this?)
    Sorry, the Details number three (3) is my preference, Since I wanted to see the X, Y movements also.

  • Optimizing short code with XML objects

    Hi there!
    I'm trying to take into account the Garbage Collector (GC), so I decide to optimize this code:
    private function writeXMLtoModel(xmlData:XML):void{
    var listOne:XMLList = xmlData.node.children();
                for each(var xmlOne:XML in listOne){
                    var item: Object = new Object();  
                        item.one =  xmlOne.@one ;
                        item.two =  xmlOne.two ;
    For instance, is it useful to put "xmlOne = null" in every iteration?  I'm checking with the Flashdevelop's profiler, but I don't see the difference.
    maybe, I can also reuse the item object rather than creating it every time, right?
    Regards!

    everything you prefix with var inside a function body is local to the function during that function call.  ie, all those variables ( listOne and all the xmlOne and item) will be gc'd without you needing to do anything more.  (on the other hand, unless you have additional code, that function does nothing useful because no data can be obtained from it once it completes execution.)

  • Problem on refreshing with XML Data Connection

    Hi all,
    I have just created a Xcelcius 2008 interface which is consuming data from XML Data connection that I created using an ASPX web form (webservices). On Xcelsius 2008, I set to refresh the data on every 30 seconds.
    And I have found problem that the Xcelsius 2008 refresh XML Data intermittently. It doesn't want to refresh the latest data, and it still shows the previous data. But the strange thing is when I open the web services to check the validity of the data, the xcelsius is able to update and show the data exactly same with the opened data that I checked.
    And next, I repeatly refrehsed my browser (F5), oddly, the Xcelsius Flash reload data, and when I stop to refresh it. The Xcelsius stop to refresh the data also.
    So what happen to this Xcelsius? Any solutions?
    Regards,
    Devin Wood

    Hi Devin,
    I am also facing the same problem, what codes you exactly use to control the cache. I have used the following but getting same old data.
    Response.Cache.SetExpires(System.DateTime.Now);
                        Response.CacheControl = "no-cache";
                        Response.AddHeader("Pragma", "no-cache");
                        Response.AddHeader("Pragma", "no-store");
                        Response.AddHeader("cache-control", "no-cache");
                        Response.Cache.SetCacheability(HttpCacheability.NoCache);
                        Response.Cache.SetNoServerCaching();
    Hope to get help from you.
    Regards
    Bikram

  • Problems viewing PDFs with form objects

    I have a document I can't view correctly in Acrobat Reader XI. The document includes some form objects like radia buttons and check boxes. When I view the document in Adobe Reader, i only get square boxes. If I use Foxit Reader, I can se the objects normally. I have taken a screendump from the same PDF document, one using Acrobat Reader and the other using Foxit Reader. As you can see, there is a big difference.
    The screendump above is from Adobe Reader XI
    And this creendump is from Foxit Reader.
    Why cant Acrobat display the form objects? It looks like a font problem. I have tried to install asian font pack. Is there any other font packs that could solve this problem?
    Best regards
    René

    How were these forms created?  I have seen (in this forum) similar cases when forms were created in some none-standard ways.
    See if the attached test document shows correctly in Reader XI.

  • Can somebody solve a problem of jsp with xml

    I have written the following code to generate a web page.
    the application will get some data from a xml file and show it in the web page.
    The problem is it is showing null for all the xml properties.
    When i used the java scriplet as a seperate java file, it seems to be running fine.
    Can somebody help me:-
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <%@ page import="java.io.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="org.w3c.dom.*" %>
    <%@ page import="org.xml.sax.*" %>
    <%@ page import="javax.xml.transform.TransformerFactory" %>
    <%@ page import="javax.xml.transform.Transformer" %>
    <%@ page import="javax.xml.transform.TransformerException" %>
    <%@ page import="javax.xml.transform.dom.DOMSource" %>
    <%@ page import="javax.xml.transform.stream.StreamResult" %>
    <%@ page import="javax.xml.transform.*" %>
    <%@ page import="javax.xml.parsers.*" %>
    <%@ page import="javax.xml.*" %>
    <%@ page import="javax.xml.transform.stream.StreamSource" %>
    <%!
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    %>
    <html>
    <head>
    <title>Main Page</title>
    <link rel="stylesheet" href="Styles1.css" type="text/css">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body leftmargin="0" topmargin="0">
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                   <td>
                        <table width="100%" height="50" border="0" cellspacing="0" cellpadding="0">
                             <tr>
                                  <td>
                                  </td>
                             </tr>
                        </table>
                        <table width="100%" height="17" bgcolor="#FFCC00" border="0" cellspacing="0" cellpadding="6">
                             <tr>
                                  <td>
    <%
    try
    DocumentBuilder builder = factory.newDocumentBuilder();
    System.out.println("Builder: "+builder);
    Document document = builder.parse("config.xml");
    System.out.println("Document: What happened "+document);
    document.getDocumentElement().normalize();
    Node ParentNode = document.getDocumentElement();
    System.out.println("Node: "+ParentNode);
    //NodeList list = document.getElementsByTagName("TimeSheet");
    for(Node child= ParentNode.getFirstChild(); child != null; child = child.getNextSibling())
    try{
    if(child.getNodeType()==Node.ELEMENT_NODE)
    String Vals = child.getFirstChild().getNodeValue().toString();
    System.out.println("Hi: "+Vals);
    %>
                                  <%=Vals%> |
    <%
    catch (NullPointerException nex)
    System.out.println("Null Exception : "+nex);
    catch (Exception ex)
    System.out.println("Exception : "+ex);
    %> <a href="Log-out |
                                  </td>
                             </tr>
                        </table>
                        </td>
              </tr>
         </table>
    </body>
    </html>
    I wil be thankful for that
    Ottran

    Hi can anyone solve the above problem

  • Mapping problem:filling field with 0 (zeros) in material number

    I want to create a mapping like the ABAP function:
    CONVERSION_EXIT_MATN1_INPUT
    for example:
    1 => 000000000000000001(add zeros if input value is
    numeric)
    Z => Z(no change if input is not numeric)
    The standard function "formatnum" works well from 1 => 000000000000000001.But it causes a java exception from Z => Z.
    How to solve it?
    Must i develop a UDF?
    thanks

    if i understood your requirement, you need to do padding(left) for your input. In that case use this UDF to help you out;
    int len = 10 ; // the maximum length of the field in your target.
    StringBuffer sBuf= new StringBuffer(a);
    while (sBuf.length() < len) {
    sBuf.insert(0,'0');
    return(sBuf.toString());
    Message was edited by:
            Shabarish Vijayakumar

  • Problems with transparent objects InDesign CS5.5

    Hi, I have troubles with using transparent objects in InDesign CS5.5 (Win7):
    If there is a transparent object in the background, is problem to move with another objects over this area. The object moving over the area with transparency "erases" objects below: texts, boxes.... They are not in fact erased, this effect tooks  only for the moment of movement and little bit longer. I have to wait for a while and after it is ok, but the work is slower and software is not working fast as I was got used in older versions.
    This trouble is not a problem of my computer (I have a new one with 16GB RAM, i5 processor), the same trouble with the same InDesign is on my laptop.
    Updates of InDesign are automatically installed.
    Can you give me some advice?
    Thanks, Petra
    this is screenshot - I moved with blue object - below you can see trails of "erasing"

    Yes, exactly, looks like glitch in the video. After I stop moving with object, everything is ok again. But not immidiatelly, there is a little delay (1 or 2 seconds). It doesn´t demage my work, it´s only glitch effect. But it delay me in work, it´s not pleasant to work with this glitch effects

  • Problems Creating Mappings with Collections with tools or workbench

    Hi -
    I am a new kodo user for my company. And am having a few problems in genereal with mapping objects with collections
    in them.
    I followed the tutorial on how to use the kodo workbench
    using the Passenger example. Build the java code and then
    tried to creat a new set of metadata. After going through
    this process I expected to see TWO tables. Something like
    'PAssenger' and something like 'Luggage' where luggage
    would be joined to passenger. However what I am getting
    is ONE table passenger with a BLOB field 'Luggage'. This
    has been a contant problem with me with any composite
    java class containing collection. Obviously I am configuring something wrong. Any help would be great.
    Thanks
    Matt

    Answered by one of my fellow and unknown colleagues that suddenly entered the room

  • From String to Element with XML structure

    Hello.
    I have String with XML elements. Can i simple this transform in to XML format?
    I need Element which has XML structure.
    my string looks like that is:
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
    <ns1:id_name>Mario</ns1:id_name>
    <ns1:id_address>Newsburgh</ns1:id_address>
    </users>
    </payload>
    Edited by: Tony_Fabrizzio on Feb 11, 2009 5:57 AM

    Tony_Fabrizzio wrote:
    Hello.
    I have String with XML objects. No you don't. Get your terminology straight
    Can i simple this transform in to XML format?
    I need Element which has XML structure.
    my string looks like that is:
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
    <ns1:id_name>Mario</ns1:id_name>
    <ns1:id_address>Newsburgh</ns1:id_address>
    </users>
    </payload>The short answer is "yes". The long answer is "what are you planning on doing with the result, and 'process it' or 'parse it' isn't an answer"
    But really, you need to do some research

Maybe you are looking for