How to create ArrayColletion in mx:Script from mx:Model id="results" source="/data/data.xml" /

How to create ArrayColletion in mx:Script from <mx:Model
id="results" source="/data/data.xml" />
Please see my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Model id="results" source="/data/data.xml" />
<mx:Script>
import mx.collections.ArrayCollection;
import mx.utils.ArrayUtil;
import mx.controls.Alert;
</mx:Script>
<mx:ArrayCollection id ="dt1"
source="{ArrayUtil.toArray(results.result)}"/>
<mx:Script><![CDATA[
[Bindable]
public var expenses:ArrayCollection = dt1;
[Bindable]
public var expenses2:ArrayCollection = dt1;
[Bindable]
public var dp:ArrayCollection=expenses;
public function changeDataProvider():void{
Alert.show(expenses.toString());
if (dp==expenses){
dp=expenses2;
}else{
dp=expenses;
]]></mx:Script>
<mx:Panel x="10" y="10" width="100%" height="378"
layout="absolute">
<mx:ColumnChart dataProvider="{dt1}" x="10" y="10"
id="myChart" height="318" width="100%">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="month"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries displayName="apple" yField="apple"/>
<mx:ColumnSeries displayName="orange"
yField="orange"/>
<mx:ColumnSeries displayName="banana"
yField="banana"/>
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{myChart}" x="481" y="10"/>
</mx:Panel>
<mx:Button x="284" y="416" label="Change Data" id="bt"
click="changeDataProvider()" />
</mx:Application>

Tracy,
Thanks. That worked. However I have another related question:
I convert the xml feed to a XMLListCollection by doing:
<mx:XMLListCollection id="mission"
source="{xmlFeed.lastResult.day}"/>
and
<mx:XMLListCollection id="mission1"
source="{xmlFeed.lastResult.day.tBlock}"/>
On the chart I have
<mx:ColumnChart id="missionReadiness" height="150%"
width="100%"
paddingLeft="2" paddingRight="2"
showDataTips="true" dataProvider="{mission1}">
<mx:series>
<mx:ColumnSeries xField="" yField="@today"
displayName="Today"/>
<mx:ColumnSeries xField="" yField="@tomorrow"
displayName="Tomorrow"/>
<mx:ColumnSeries xField="" yField="@afterT"
displayName="After Tomorrow"/>
</mx:series>
</mx:ColumnChart>
the yField works, but for the xField I want to have the @date
but refers to the parent node, so I am clueless on how to refer to
it.
Also, I would like to display on the chart only the values to
a specific date (like @date="05/17/2007").
Any suggestions on how to do that?
Gilbert

Similar Messages

  • How to create a group of contact from a multi-selection of mails in a mailbox to answer to all senders?

    How to create a group of contact from a multi-selection of mails in a mailbox to answer to all senders?

    Use Mail Scripts. Its Add Addresses function will collect all the addresses from all selected messages and allow you to select the ones you want to add and allow you to create groups as you go.

  • How to create a barcode in scripts and smartforms

    hi
    how to create a barcode in scripts and smartforms

    Hi,
    For Script:
    A barcode solution consists of the following:
    - a barcode printer
    - a barcode reader
    - a mobile data collection application/program
    A barcode label is a special symbology to represent human readable information such as a material number or batch number
    in machine readable format.
    There are different symbologies for different applications and different industries. Luckily, you need not worry to much about that as the logistics supply chain has mostly standardized on 3 of 9 and 128 barcode symbologies - which all barcode readers support and which SAP support natively in it's printing protocols.
    You can print barcodes from SAP by modifying an existing output form.
    Behind every output form is a print program that collects all the data and then pass it to the form. The form contains the layout as well as the font, line and paragraph formats. These forms are designed using SAPScript (a very easy but frustratingly simplistic form format language) or SmartForms that is more of a graphical form design tool. 
    Barcodes are nothing more than a font definition and is part of the style sheet associated with a particular SAPScript form. The most important aspect is to place a parameter in the line of the form that points to the data element that you want to represent as barcode on the form, i.e. material number. Next you need to set the font for that parameter value to one of the supported barcode symbologies.
    The next part of the equation can be a bit tricky as you will need to get a printer to print that barcode font. Regular laser printers does not normally print barcode fonts, only specialized industrial printers that is specifically designed to support that protocol and that uses specialized label media and heat transfer (resin) ribbon to create the sharp image required for barcodes.
    Not to fear though, there are two ways to get around this:
    - You can have your IT department do some research - 
    most laser printers can accept a font cartridge/dimm chip (similar to computer memory), called a BarDIMM that will allow a laser printer to support the printing of barcodes.
    - Secondly, you can buy software that you can upload in your SAP print Server that will convert the barcode symbology as an image that will print on a regular laser printer. I found that this option results in less sharper barcodes. This option is really if you need to convert a large quantity of printers (>10) to support barcodes. 
    - Thirdly, you can buy a third party software like Barcode.dll and install on your frontend PC connected to the laser printer.
    Now you have a barcode printed - what next?
    Well there are two options, depending on your business requirements:
    - You can use an existing SAP transaction on a regular workstation and get a barcode wedge reader to hook up between the keyboard and the PC. These wedge readers comes in a wand or scanner format. There are even wireless wedge scanners available that allows you to roam a few yards from the workstation to scan a label. This approach is mostly used where you want to prevent human errors in typing in long material, batch or serial numbers in receiving or issuing of material. The problem is that it's just replacing the keyboard input and you are basically locked down in one location and have to bring all the material to that location to process.
    - Another solution is to use SAPConsole transactions
    or write your own ABAP Dialog programs that will fit onto a barcode enabled wireless handheld terminal and that will follow the business logic as executed on the shop floor. 
    These programs are highly complex exercises in industrial engineering and ergonomics because of the limited screen sizes and limited ability to accept keyboard input. The user is instructed step-by-step and only scan and push F-keys to interact with the SAP system. Scan, scan, beep, beep, enter - highly automated.
    For SmartForm:
    http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
    Regards,
    Bhaskar

  • How to prevent a text in script from displaying if its value is zero

    Dear all,
    How to prevent a text in script from displaying if its value is zero
    for eg   Price  = 0.00
    if price is 0 it should'nt appear in output.
    I tried with    if price ne 0.
                       price = &price&
                        endif.
    but it's not working.
    Regards
    Raj
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jan 20, 2009 8:59 AM

    Hello Nagaraju,
                           What you were doing is partially right.
    The correct format to write in the script is as follows :
    /:  if &PRICE& ne 0.
      &PRICE&
    /:  endif.
    This should work. Let me know how it goes.
    Nayan

  • Can any one tell me how can i call a shell script from pl/sql

    i like to call shell script from pl/sql procedure.
    can any one suggest how can i do this

    Have you not mastered in asking the same kind of question ?
    First do write a script...
    no one will spoon feed you.
    How can i call a shell script from procedure
    How to call Shell Script from pl/sql block
    -Sk

  • How can i call a shell script from procedure

    I have a shell script.now i am i a situation to call that shell script from one of my procedures and need to get a value from that script.
    can u suggest me that how can a call the shell script from pl/sql?

    Is the same question you asked here
    How to call Shell Script from pl/sql block
    -SK

  • How to create automatic creation of BP from customer and vendor master data

    Hi gurus,
    can any one tell how to create automatic creation of BP from customer and vendor master data.
    Please give me the steps.
    Thanks
    Sasikanth.

    HI,
    Goto SPRO\ Cross application components \ Master data synchronization \ Synchronization control.
    Assign account groups of customer and vendors to respective BP grouping. This setting is enough to create BP in background while creating customer / vendor. But the fields groups are very much important, ensure mandatory fields should be sync.
    rgds,
    Srini

  • How to create a interface with NTR from SAP XI?

    How to create a interface with NTR from SAP XI?

    Hi,
        What do you mean by NTR ?...
    What are the details you needed...Please be clear and more elaborative as far as possible..so that you will get straight forward answers...
    HTH
    Rajesh

  • How to create a Group in AD from OIM

    Hi all,
    I am using AD connector in OIM 11g R1, According to the documentation (About the Connector) I should able to create group in AD from OIM. Can any bady help me how to do that.
    Thanks
    Tamim Khan

    Hello,
    I heard back from Oracle and this is what they suggested.
    One of the option is to use VB script to create contact in AD. We will have to install remote manager to invoke the VB script from OIM.
    The Remote manager is part of OIM and is often used to invoke scripts such as vbscripts and or powershell scripts.
    An example of using OIM remote manager is to via scripts, create users in a non domain machine - for example NT machines.
    Thanks
    Khanh

  • Create a New Calc Script from VB.

    Does anyone know how to create a calc script using the VB Essbase API? We are going thru a large modification. Most of our calc scripts are stored on an oracle database. The idea is to send the stored scripts to a text file and then using the essbase api to create new calc scripts based on the the text files. Any help or ideas would be appreciated.Thanks

    This shouldn't be too difficult. You should be able to either read your existing script straight from your Oracle database using ODBC & ADO Recordset or from a test file using a scripting.filesystemobject and then make any changes using the VB code. Then use either the EsbBeginCalc/EsbSendString/EsbEndCalc or EsbCalc functions in the VB API to run them. I've used this sort of approach in the past to allow users to substitute specific members into 'template' calc scripts at runtime. Hope this helps.Mark Rixon www.analitica.co.uk

  • How to create a table in script

    hi gurus
    can any one suggest me
    how to create a table format in script output
    i want the output be in table format
    thank you
    regards
    kals.

    Hi Kalyan,
    There is option for creation of table in Scripts .
    We can make the output to b displayed in table format by using BOX command .
    see this
    Setting default parameters for a box:
    You can use the POSITION and SIZE commands to set default parmeters for a box.
    Instead of: 
    /: BOX XPOS '11.21' MM  YPOS '5.31' MM  HEIGHT '10' MM WIDTH '20' MM INTENSITY 10 FRAME 0 TW
    You can write:
    /: POSITION XORIGIN '11.21' YORIGIN '5.31' MM
    /: SIZE HEIGHT '2' MM WIDTH '76' MM
    /: BOX  FRAME 10 TW INTENSITY 10
    This can be usefull if you gave several boxes that share the same parameters.
    If you want to set the position realtively to the window use POSITION WINDOW
    to set the position to the top/left start of the window. Then use POSITION 
    to set the current position relatively to the start of the Window. 
    Note that you uses "+" or "-" in the ORIGIN position to the set the position relatively.
    /: POSITION WINDOW
    /: POSITION XORIGIN '5' MM  YORIGIN '10' MM
    the position is now 5 MM from the left and 10 MM from the top of the window
    NOTE: After using the position command you can move the current position
    realtively to the last used position
    /: POSITION XORIGIN '10' MM  YORIGIN '20' MM
    Now the position will be X = 15 and Y = 30
    Drawing a line. You can draw a line by setting the Height or Weidth to 0
    and add a frane. E.g. a horizontal line:
    /: SIZE HEIGHT '0' MM WIDTH '200' MM
    /: BOX FRAME 10 TW XPOS '11.21' MM YPOS '14.81' MM INTENSITY 100
    thnx
    Sravani
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 5:59 PM

  • How to create channel mixer by script

    How I can create channel mixer by JavaScript?

    If you create a channel Mixer script you will most likely be using Action Manager Coder you modify from Adobe Scriptlitener Plug-in.  There  is a Photoshop scripting forum and scripting documentation you can download. Adobe DOM does not cover all Photoshop function.  Adobe Photoshop Scripting | Adobe Developer Connection  and Photoshop Scripting

  • How to create thousands of sql scripts easily?

    Hello,
    I would like to create thousand of scripts as following:
    insert into table tb_test('aaa');   update table tb_class( set nm = 'aaa');
    insert into table tb_test('basd'); update table tb_class( set nm = 'basd');
    insert into table tb_test('asdfa');update table tb_class( set nm = 'asdfs');
    insert into table tb_test('xxxyy');update table tb_class( set nm = 'xxxyy');
    Is there any simple way to generated those scripts automatically? I am thinking of :
        define var_str = ('aaa', 'bbb', 'asdfd',...'xxxyy');
        select 'insert into table tb_test(' || var_str || '); update table tb_class( set nm =' || var_str || ');'
        from dual;
    Then how do I generate those scripts from the var_str?
    Thanks,

    942572 wrote:
    I have more than 5000 parameters in a text file as followings, which can be opened by notepad or excel:
    'aaa',
    'basd',
    'asdfs',
    'xxxyy'
    Ok, so assuming this is a 1-off event, use Excel.
    Setup a quick formula to turn each into a proc call:
    [edit] if the values are in column "A", then in column "B", you could do:   =concatenate("p_proc('", a1, "');")
    then copy that formula down.
    [/edit]
    p_proc('aaa');
    p_proc('basd');
    etc.
    Then setup a little p_proc as Frank described. (and please, use a WHERE clause on that update ... or you're going to destroy some data )
    Then copy past those commands into a routine that ends up looking like:
    declare
    procedure p_proc ( in_value )
      is
      begin
          -- Frank's code goes here
      end;
    begin
       -- proc list goes here
      p_proc('aaa');
    ..... etc.
    end;
    That's 1 very primitive way to do it.
    If you need to reproduce this in future, you may want to consider loading that list of parameter values into a table, then you can do some more funky things. *shrug*

  • How to Create a LiveTrace Options Script

    Hello everyone!
    I am using Illustrator CS3 on WinXP Pro.
    Let me begin by saying that this is my first attempt at scripting anything and any help would be truly appreciated. I have written a script:
    var myDocument = app.activeDocument;
    var mySelection = myDocument.rasterItems[0];
    mySelection.selected = true;
    app.selection[0].trace();
    app.selection[0].cornerAngle = 180;
    app.selection[0].fills = true;
    app.selection[0].ignoreWhite = true;
    app.selection[0].minArea = 0;
    app.selection[0].pathFitting = 0;
    app.selection[0].threshold = 256;
    app.selection[0].tracingModeType = 'TRACINGMODEBLACKANDWHITE';
    app.redraw();
    This script is tracing the raster image (barcode). However, it doesn't appear that it is using any of the tracing options.
    Does anyone know how to properly script this in order to utilize the tracing options and then expand at the end?
    Any help would be truly appreciated.
    Many Thanks!

    I didn't hack this out, so I may be off - but from what i gathered from the JS guide :
    the trace() method returns an object.
    -- From the Guide --
    A tracing object, which associates source raster art item with a vector-art plugin group created by tracing.
    Scripts can initiate tracing using PlacedItem.trace or RasterItem.trace. The resulting PluginItem object represents the vector art group, and has this object in its tracing property.
    ie:
    myTrace = app.selection[0].trace();
    myTrace.cornerAngle = 180;
    myTrace.fills = true;
    app.redraw();
    myTrace.expandTracing();

  • How to create a flash automatization script?

    Here's the situation. I have a font support library, however for each font I have to manually create a new swf file, such as Tahoma_14_bold.swf - which is a lot of work.
    I need to create a Flash automatization script (extension or command, NOT AS3 code) that automatically opens up a file, changes the font of a pre-existing textfield on the stage to, for example, Tahoma Regular 10 with bitmap font setting, saves it as Tahoma_Regular_10.fla in a destination directory, compile, then change the font size to 11, save it as Tahoma_Regular_11.fla, compile and so on and so forth, up until all fonts are created.
    The end result would be 30 or so swf and fla files for each possible variation of the font.
    How would I go around doing this? Is this at all possible?

    1. Efficiency:
    Application has a fontStyle manager. The application never (outside of debugging purposes) creates textfields by itself. All textfields used to display text are created by a call to the fonts manager, like "fontsStyleManager.createFont("header1");"
    As such, each fontStyle has an associated font SWF and other textField parameters. The website owner can specify which particular font SWFs are to be loaded at start, and all unused font SWFs are highlighted, to be deleted of the list.
    2. Flash font embedding sucks
    Flash embedding sucks. I've had whole projects refuse to compile and not even display any messages. I had fonts that changes sizes and font faces. I've had fonts not embed at all, even though I specified explicitly for them to be included. Embeding by code and at runtime is cleaner, and it works
    3. Neccesity
    Embedding fonts from Flex embeds all European characters including German, Greek, Norwegian and so on.. except Polish. In here I can specify my own precise character set using the flash IDE.
    4. Fonts in Flash are complicated
    Normal, vector fonts are embedded easy. Size doesn't matter, as the font can clearly scale to any size and remain nicely anti-aliased. Embeding a Bold style doesn't mean yhou embed a Regular. Bitmap fonts are embeded by font size, that is, embeding a 14px bitmap won't make it possible to use a 16px. In addition, embedding a Bold doesn't embed a Regular bitmap font. What's interesting is that you can take a 12px embed font and set the TextFormat to, say, 22px, and get a very interesting-looking pixel effect, as the font gets scaled up.
    5. Flexibility - the ability to see a completely different set of fonts in your project without having to recompile - priceless.

Maybe you are looking for

  • Report painter performance problem...

    I have a client which runs a report group consists of 14 reports... When we  run this program... It takes about 20 minutes to get results... I was assigned to optimize this report... This is what I've done so far (this is a SAP generated program)...

  • Why no support for element factories?

    The XML parser should support user supplied element factories. That is, I should be able to instruct the parser to use my class when creating elements and attributes it encounters. Among other things, this would allow me to exclude certain elements/a

  • [JS][CS3] Import ai into another ai

    Hi, My goal is to import [rather than place] another ai into the target ai, with all attributes of the objects + layering preserved. There are two shortcut methods available: a) groupItems.createFromFile(srcFile) - but this creates over-complicated l

  • My bulleted list displays correctly in IE 8 and Firefox, but not in IE 7

    I have a simple bulleted list in a right floated sidebar for a website. If views fine in IE 8 and Firefox, but not in IE 7 (and perhaps earlier, though I only have access to machines with IE 7 and 8. Because the default indent for the bulleted list m

  • Non cumulative key figure and fiscal period 13

    Hi, We have defined a non cumulative key figure. In the cube, the non cumulative characteristic is the fiscal period (0FISCPER). This non cumulative key figure works fine from period 1 to 12, but displays nothing for period 13 (and 14, 15, 16). We wa