Problem: Array to datagrid

Hey Guys,
I got a problem getting an array into a Datagrid.
My XML
quote:
<uitvoering>
<naam>Hocker</naam>
<hoogte>40</hoogte>
<breedte>61</breedte>
<diepte>57</diepte>
<stof>
<naam>Nevada</naam>
<prijs>169</prijs>
</stof>
<stof>
<naam>Sirius</naam>
<prijs>169</prijs>
</stof>
.. (more)
If i put this into a Datgrid it comes out as the following
[Key-naam] ---- [Key-hoogte] ---- [Key-breette] ...
Value-naam---- Value-hoogte----Value-breette...
Value-naam---- Value-hoogte----Value-breette...
... lots more :P
Wich is good for one of the views i have to make but for the
second one i have to do something quite difficult, in my eyes at
least . I want the second view to look like this.
[Key-naam] ---- [
Value-stof.naam 1] ---- [
Value-stof.naam 2] ...
Value-naam----Value-stof.prijs
1-----------------Value-stof.prijs 2-----------...
..lots more
I kept the original key names altho there in Dutch but the
structure is in the quote above, I hope you get the idea, its
rather hard to make a nice grid :)
But is this even possible in flex? if it is can somebody
please give me an example or a link to a page with a tutorial or
something like that!
Thanks in advance!

sue no problem:
I load my xml like this :
<mx:HTTPService id="modelSpecs" url="modellen.xml"
useProxy="false" />
then i open a datagrid an give it a provider
<mx:DataGrid x="10" y="10" id="dgPosts" width="562"
height="473"
dataProvider="{modelSpecs.lastResult.model.uitvoering}">
</mx:DataGrid>
And this works fine for the first method!, but i truely have
no idea how to get it like the second example i posted.
ideas anyone?

Similar Messages

  • Array to DataGrid not working. Please help before I lose my mind (and my hair) completely.

    Hi,
    I'm new to the whole flex/as/flash builder, but I'm trying to do a seemingly simple thing and it's not working.
    Flex Mobile project has a button and data grid. When I press the button a 2 dimensional array is build with random numbers. Then I want to show the array on datagrid.
    The array does get build but it's not showing up on data grid.
    Any help would be appreciated as I've spent lots of time on this without any solution.
    Thanks,
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import flash.events.Event;
       import mx.collections.ArrayList;  
       import mx.collections.ArrayCollection;
       import spark.events.ViewNavigatorEvent;
       protected function cmdStart1_clickHandler(event:MouseEvent):void
        DataGridTest1();
       protected function DataGridTest1():void
        var board:Array = [];
        var arrList:ArrayList = new ArrayList();
        var i:int = 1;
        var j:int;
        text.text = "";
        for(i; i<=5; i++)
         board[i] = [];
         j = 1;
         for(j; j<=6; j++)
          board[i][j] = Math.round(Math.random() * 10);
        arrList.source = board;
        grid.dataProvider = arrList; 
      ]]>
    </fx:Script>
    <s:Button id="cmdStart1" x="53" y="100" width="394" height="62" label="DataGridTest1 (ArrayList to Grid)"
         click="cmdStart1_clickHandler(event)"/>
    <s:TextArea id="text" x="53" y="240" width="394" height="162"/>
    </s:View>

    Sorry, the <s:TextArea shouldn't be there, I was using it to debug the array. I removed the  <s:DataGrid> instead of <s:TextArea> by mistake.
    Also, I tried to move arrList out of the function but that didn't work.
    Here's the entire code again:
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import flash.events.Event;
       import mx.collections.ArrayList;  
       import mx.collections.ArrayCollection;
       import spark.events.ViewNavigatorEvent;
       protected function cmdStart1_clickHandler(event:MouseEvent):void
        DataGridTest1();
       protected function DataGridTest1():void
        var board:Array = [];
        var arrList:ArrayList = new ArrayList();
        var i:int = 1;
        var j:int;
        text.text = "";
        for(i; i<=5; i++)
         board[i] = [];
         j = 1;
         for(j; j<=6; j++)
          board[i][j] = Math.round(Math.random() * 10);
        arrList.source = board;
        grid.dataProvider = arrList; 
      ]]>
    </fx:Script>
    <s:Button id="cmdStart1" x="53" y="100" width="394" height="62" label="DataGridTest1 (ArrayList to Grid)"
         click="cmdStart1_clickHandler(event)"/>
    <s:DataGrid id="grid" x="500" y="100" width="236" height="226" />
    </s:View>

  • Brick Wall Problem: Array of Clusters, Size of array from reference

    Good Morning Forums,
    I have hit a brick wall with my application and I am hoping somebody can help!
    I have an array of clusters of indeterminate size (the cluster is generic, data contained not relevant.).
    Inputs to the VI are: a reference to the array, and a variant containing the data.
    My problem is I need to determine the array size from these two inputs and I cannot find a way to do it!
    If the array contained a standard data type I can use the class name property to determine data type, and the size of the array returned from "select size" property to determine dimension size.  With this information i can cast the variant into the correct data type and use this to determine the size of the array.  If the data is a cluster the class name simply returns "cluster" so I cannot cast the variant and therefore am unable to determine the size.
    I am not worried about casting the data (once i determine the size this bit is no issue), I just need to determine the size (and preferably number of dimensions) of the array. Can this be done?
    Cheers for any help
    J
    John.P | Certified LabVIEW Architect | NI Alliance Member
    Solved!
    Go to Solution.

    John.P wrote:
    Good Morning Forums,
    I am not worried about casting the data (once i determine the size this bit is no issue), I just need to determine the size (and preferably number of dimensions) of the array. Can this be done?
    Cheers for any help
    J
    There seem to be a couple of potential solutions.:
    #1 if the varient is created within LabVIEW you can wite size(s) to a varient attribute.  This would be pretty straightforward and easy to implement- I imagine you would have thought of that so you may not have access to the code writing cluster to varient and it gets a bit trickier.
    #2 cast the varient to string and return string length-  this should give you a measure of total size and you would need to know the size per element of cluster (just cast one instance of cluster array to varient and then to string with size and size++) but this only returns the total size of the array since nDim arrays are actually stored sequentially. 
    Hope this helped
    Jeff

  • Xcelsius component output problem (array)

    ok so basically i'm developing a non visual component ..... I have written the code and property sheet .... The problem is when i work it in excel , the destination cells don't show ..... However i checked my code with an alert command and i could see my output array that is bound to the destination property ..... i'm not using arraycollection....i could provide the code if necessary ..... also if my source cells are changed dynamically my destination cells don't change .... i tried commitprops .... pls help

    i mean work it in xcelsius*

  • Mx_internal_uid problem with advanced datagrid

    I have a XML structure like this:
    <Projekti ...attributes>
    <Tehtava ....attributes />
    <Tehtava ...attributes />
    </Projekti>
    <Projekti...>
    ...etc
    And I'm populating advanced datagrid with this hierarchial
    data, so I can get a tree view in datagrid where there is Projekti
    -nodes and inside them is the Tehtava-nodes.
    Problem:
    When I bind the XML, and the hierarchialdata (that is created
    from the XML) flex automatically adds
    <mx_internal_uid>a324235351514......</mx_internal_uid>
    -nodes inside of the Projekti-nodes. And this causes empty folders
    added in a tree view when user clicks them.
    Is there a simple way to:
    a) prevent thos uid-nodes being created?
    b) filter thos <mx_internal_uid>-nodes out from the
    dataprovider of the advanced datagrid?

    I know this is way after-the-fact, but I just ran into this problem myself today. I found that it generated the mx_internal_uid if the node I was selecting was an XMLList instead of XML. A simple cast fixed the problem.
    P.S. "And this causes empty folders added into a tree view when user clicks on them." makes perfect sense when you're using the XML inside a <mx:Tree>. As soon as you select the item (whether by clicking or programmatically), you get extra nodes in the tree.

  • (URGENT) Skining problem of components (datagrid & combobox)

    Hi,
    I m using FLASH CS3, I used Datagrid and Combobox component from components panel, and simply add some data inside in that.
    setupComboBox();
    function setupComboBox():void
        cb.setSize(200, 22);
        cb.prompt = "Select a Credit Card";
        cb.addItem( { label: "MasterCard", data:1 } );
        cb.addItem( { label: "Visa", data:2 } );
        cb.addItem( { label: "American Express", data:3 } );
    import fl.controls.DataGrid;
    import fl.controls.dataGridClasses.DataGridColumn;
    import fl.data.DataProvider;
    import fl.events.DataGridEvent
    var dp:DataProvider = new DataProvider();
    dp.addItem({col1:"item 1.A", col2:"item 1.B", col3:"item 1.C"});
    dp.addItem({col1:"item 2.A", col2:"item 2.B", col3:"item 2.C"});
    dp.addItem({col1:"item 3.A", col2:"item 3.B", col3:"item 3.C"});
    dp.addItem({col1:"item 4.A", col2:"item 4.B", col3:"item 4.C"});
    myDataGrid.addColumn("col1");
    myDataGrid.addColumn("col2");
    myDataGrid.addColumn("col3");
    myDataGrid.dataProvider = dp;
    myDataGrid.setSize(300, 200);
    myDataGrid.move(10, 10);
    It seems working fine.
    My problem is , I want two different type of skining of two different component(DataGrid & Combobox). in the same fla.
    .. e.g if datagrid have gray color skin type and combobox have black color skin type.
    Can any one have any Idea?

    Thanks for reply..
    @kennethkawamoto2
    I already implemented that thing , that u suggest, The Main problem of this component is CellRenderer,  what's the solution of it ?
    If i apply this
    cb.setStyle("upSkin", ComboBox_upSkin2);
    cb.setStyle("overSkin", ComboBox_overSkin2);
    cb.setStyle("downSkin", ComboBox_downSkin2);
    Its change the header of Comobo box pattern, but the rest part e.g cell  is remaining  the same.
    I  tried like this also
    cb.setStyle("upSkin",CellRenderer_upSkin2)
    cb.setStyle("downSkin",CellRenderer_downSkin2)
    cb.setStyle("overSkin",CellRenderer_overSkin2)
    cb.setStyle("disabledSkin",CellRenderer_disabledSkin2)
    cb.setStyle("selectedDisabledSkin",CellRenderer_selectedDisabledSkin2)
    cb.setStyle("selectedUpSkin",CellRenderer_selectedUpSkin2)
    cb.setStyle("selectedDownSkin",CellRenderer_selectedDownSkin2)
    cb.setStyle("selectedOverSkin",CellRenderer_selectedOverSkin2)
    but it gives error........
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/addChildAt()
        at fl.controls::BaseButton/drawBackground()
        at fl.controls::LabelButton/draw()
        at fl.core::UIComponent/drawNow()
        at fl.controls::List/drawList()
        at fl.controls::List/draw()
        at fl.core::UIComponent/drawNow()
        at fl.controls::List/scrollToIndex()
        at fl.controls::SelectableList/scrollToSelected()
        at fl.controls::ComboBox/open()
        at fl.controls::ComboBox/onToggleListVisibility()
    When u click on combobox to open it up. The Component Assets  of datagrid and combobox are the same so I am not able to apply different skin pattern of this two different component ..
    Still is there any way pls let me ..

  • Problem with selectedItem (DataGrid) when dataProvider is XML

    I have a problem.
    I want to load my DataGrid with data from XML returned via
    Struts. I have set up a test environment for the time being and I
    can LOAD the data into the grid just fine, but when I want to refer
    to it after it is loaded (with selectedItem) I am having all sorts
    of problems. Namely, I can't access any of the data in
    selectedItem. I can't even seem to make it show up in a string...
    the only way I can access values is individually using :
    selectedItem["@attribute"] which is NOT what I want to do...
    can anyone tell me what I am doing wrong? Is there no way I
    can convert the xml to an object (or is that even the problem)?
    Here is code to show exactly what I mean:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical" creationComplete="doDummySearch()">
    <mx:Script>
    <![CDATA[
    import mx.utils.ArrayUtil;
    import mx.controls.Alert;
    //this dummyXML is in place of the response from the server
    for now...
    private var dummyXML:XML =
    <root>
    <dummyData priority='0' dealerCode='A00-1023'
    phoneNo='0343442323' />
    <dummyData priority='1' dealerCode='B00-1033'
    phoneNo='0343442323' />
    <dummyData priority='0' dealerCode='DER-0666'
    phoneNo='0343442323' />
    </root>
    private function doDummySearch():void {
    search_dg.dataProvider = dummyXML.children();
    private function select():void {
    var s:String = "";
    s+=search_dg.selectedItem["@dealerCode"]+"\n";
    s+="all data: \n";
    for each (var entry:* in search_dg.selectedItem) {
    s+=entry+"\n";
    s+="^-why is this blank?\n";
    s+="selectedItem.toString():
    "+search_dg.selectedItem.toString()+" <-why is this blank?";
    mx.controls.Alert.show(s, "selected data:");
    ]]>
    </mx:Script>
    <mx:DataGrid id="search_dg" />
    <mx:Button label="select item" click="select()" />
    </mx:Application>

    Or even better, you can use the new E4X support in Flex, to
    directly read from the XML
    See this example
    main.xml
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns="*" layout="vertical" >
    <mx:Script>
    <![CDATA[
    private function select():void {
    var s:String = "";
    s+="Symbol = "+search_dg.selectedItem.Symbol+"\n";
    s+="Quantity = "+search_dg.selectedItem.Quantity+"\n";
    s+="Price = "+search_dg.selectedItem.Price+"\n";
    s+="Value = "+search_dg.selectedItem.Value+"\n";
    mx.controls.Alert.show(s, "selected data:");
    ]]>
    </mx:Script>
    <mx:XML format="e4x" id="portfolioModel"
    source="portfolio.xml" />
    <mx:DataGrid id="search_dg"
    dataProvider="{portfolioModel.security}">
    <mx:columns>
    <mx:DataGridColumn dataField="Symbol"
    headerText="Symbol"/>
    <mx:DataGridColumn dataField="Quantity"
    headerText="Quantity"/>
    <mx:DataGridColumn dataField="Price"
    headerText="Price"/>
    <mx:DataGridColumn dataField="Value"
    headerText="Value"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Button label="select item" click="select()" />
    </mx:Application>
    portfolio.xml
    <portfolio>
    <security>
    <Symbol>MSFT</Symbol>
    <Quantity>10000</Quantity>
    <Price>20.56</Price>
    <Value>1</Value>
    </security>
    <security>
    <Symbol>IBM</Symbol>
    <Quantity>3000</Quantity>
    <Price>80.21</Price>
    <Value>1</Value>
    </security>
    <security>
    <Symbol>ADBE</Symbol>
    <Quantity>10000</Quantity>
    <Price>32.56</Price>
    <Value>1</Value>
    </security>
    <security>
    <Symbol>GOOG</Symbol>
    <Quantity>3000</Quantity>
    <Price>380.21</Price>
    <Value>1</Value>
    </security>
    </portfolio>

  • Problem Array size in Windows 7

    Hello All,
    I have a VI that by opening in a new Laptop, it show some Arrays controls misfits (with a diferent array size), however i can´t put it right.
    But when i make a EXE of this VI and if i run the EXE in another Computer, the front panel appears aligned and Ok.
    I´m using the labview 2009 Sp1 with Windows 7, this vi have been created in another laptop in a older version and always with the Windows Xp, and whenever i was updated the version of labview it always appeared correct on those Laptop, until now when i changed the laptop and the Operating System to Win7.
    Any help/advice is much apreciated
    Thanks,
    Solved!
    Go to Solution.

    Make sure you use the same font settings for all the controls that you want to be aligned. You might have some controls set to a specific font name and others left to the default Application font. LabVIEW substitutes the Application font for whatever the system default font is on a particular computer.
    Different fonts are default and available on different Windows versions so you can certainly get into trouble here if you mix font families and names in the same UI.
    If you request a specific font name and it is not available on a certain machine Windows will substitute it with a different font that it thinks looks similar but the heuristics of that substitution can sometimes  go really way south of the equator and simply give crazy results.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • 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

  • Urgent problem : array of linked list

    In order to save memory I am trying to build an array of linkedlist with the following program. It compiles well but when I execute it, error occurs as follows,
    Exception in thread "main" java.lang.NullPointerException
    at testLL2.main(testLL2.java:10)
    My program:
    import java.net.*;
    import java.io.*;
    import java.util.LinkedList;
    public class testLL2 {
    public static void main(String[] args) throws IOException {
    int myLLLength;
    LinkedList myLL2 [] = new LinkedList[10];
    for (int i = 0; i < 10; i++) {
    for (int j=0; j < 5; j++) {
    myLL2.add(" "+j);
    for (int i = 0; i < 10; i++) {
    myLLLength = myLL2[i].size();
    for (int j=0; j<myLLLength; j++) {
    System.out.println(myLL2[i].get(j));
    Since I tried many alternatives to solve it but one of them succeed. Please kindly help me! Thanks in advance!

    [snip]
    2. Where you have 'myLL2.add(" "+j);' it should read
    myLL2. The is probably a typo. If not, make sure
    you understand why you need to change your code.
    The forum posting code will muck up your code if you don't surround it in [ code] [code ] (no spaces) tags.  Even if you do use the code tags, it preprocesses [ i] into <i> to avoid turning your code into italics.

  • Multi-part form problem (array & session help needed)

    I have a multi-part form that consists of 3 pages(forms) which each save data to the session. When the final form is complete, I insert the session variables to the DB via a FINISH button.
    I now want to take another step. Page 2 of this multi-part form allows users to add "items". Presently, they can add only 1 item, and move the page 3 by hitting a next button. I would like to add a "Add another item" button that goes to the page 2 form again, allowing more items to be entered. I believe I need an array/table to do this, but don't know how I might do this in the session.
    Is it possible to create an array in the session? If so, how? If not, how might I approach this?
    I am trying to avoid inserting to the database (a remote db) until after a "preview" page following the form.
    Any ideas? Thx in advance.

    Hi,
    This forum thread may help you:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50623
    Thanks,
    Creator Team.

  • The fluke 2625A I am still having problems arraying the channels and temperatures.

    In the example program I canot array the channels and temperatures. All I can read is one channel at a time.

    Joey,
    I took a look at this instrument driver, and it appears that there is not a built-in function that allows you to read multiple channels at the same time. You will need to have multiple subVIs read channels individually, then build those values into an array of all the temperatures. This is the only way I could find to get an array of your temperatures after my cursory glance of the driver.
    Good luck with your application, and have a pleasant day.
    Sincerely,
    Darren Nattinger
    Applications Engineer
    National Instruments
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • New modification problem(Array)

    OK I had a previous code here a while back and it worked,.then i had to modify it to hold data,so i hit the books hard trying to figure it out.The program, Netbeans is wanting the Merch constructor to have a class of its own and i know that it is incorrect. I have switched the data entered to all double except the string and still error comes up. Please help me understand whats going on thanks.
    package inventory2;
    public class Merch
    public static void main(String args [])
        double total;
        Merch prodArray[];
    prodArray = new Merch[4];
    prodArray[0] = new Merch("Computer",(double)8.0,(double)86.0,(double)79.95);
    prodArray[1] = new Merch("Printer",(double)9.0,(double)68.0,(double)355.00);
    prodArray[2] = new Merch("Apple",(double)1234.0,(double)10.0,(double)32.32);
    prodArray[3] = new Merch("Baseball",(double)12345.0,(double)11.0,(double)20.32);
          for (int counter = 0; counter < 4; counter++)
             System.out.printf(Merch[counter].toString());
          total = (Merch[ 0 ].getTValue() +
                   Merch[ 1 ].getTValue() +
                   Merch[ 2 ].getTValue() +
                   Merch[ 3 ].getTValue());
          System.out.printf( "The total value of the inventory is: $%.2f\n\n", total );
    package inventory2;
    public class Inventory2 {
        public class inventory2
              private String name;
              private double cost;
              private double amount;
              private double id;
              public double total;
              public inventory2(String name, double cost,double amount, double id)
                        this.name = name;
                        this.cost = cost;
                        this.amount = amount;
                        this.id = id;
              public String getName()
                        return this.name;
              public double getCost()
                         return this.cost;                 
              public double getAmount()
                         return this.amount;
              public double getId()
                         return this.id;
              public double getTValue()
                  total = cost * amount;
                  return amount;
       @Override
       public String toString ()   
            String formatString    = "Product Name : %s\n";
            formatString          += "ID Number : %d\n";
            formatString          += "Amount of units on hand : %d\n";
            formatString          += "Price per unit : $%.2f\n";
            formatString          += "Total value of  : $%.2f\n\n";
            return (String.format ( formatString, name, id, amount, cost, getTValue()) );
    }

    Error
    Compiling 2 source files to C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\build\classes
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:15: cannot find symbol
    symbol  : constructor Merch(java.lang.String,double,double,double)
    location: class inventory2.Merch
    prodArray[0] = new Merch("Computer",8.0,86.0,79.95);
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:16: cannot find symbol
    symbol  : constructor Merch(java.lang.String,double,double,double)
    location: class inventory2.Merch
    prodArray[1] = new Merch("Printer",9.0,68.0,355.00);
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:17: cannot find symbol
    symbol  : constructor Merch(java.lang.String,double,double,double)
    location: class inventory2.Merch
    prodArray[2] = new Merch("Apple",1234.0,10.0,32.32);
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:18: cannot find symbol
    symbol  : constructor Merch(java.lang.String,double,double,double)
    location: class inventory2.Merch
    prodArray[3] = new Merch("Baseball",12345.0,11.0,20.32);
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:22: cannot find symbol
    symbol  : variable Merch
    location: class inventory2.Merch
             System.out.printf(Merch[counter].toString());
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:25: cannot find symbol
    symbol  : variable Merch
    location: class inventory2.Merch
          total = (Merch[ 0 ].getTValue() +
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:26: cannot find symbol
    symbol  : variable Merch
    location: class inventory2.Merch
                   Merch[ 1 ].getTValue() +
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:27: cannot find symbol
    symbol  : variable Merch
    location: class inventory2.Merch
                   Merch[ 2 ].getTValue() +
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:28: cannot find symbol
    symbol  : variable Merch
    location: class inventory2.Merch
                   Merch[ 3 ].getTValue());
    C:\Documents and Settings\\My Documents\NetBeansProjects\Inventory2\src\inventory2\Merch.java:27: incompatible types
    found   : java.lang.String
    required: double
                   Merch[ 2 ].getTValue() +
    10 errors
    BUILD FAILED (total time: 0 seconds)

  • DataGrid Header Problem

    Dear All,
    I have some problem with accessing DataGrid HeaderText, When one column is visable false.
    "Click on column content and the code will show col # and header name. Do the same After Hide Colun  is clicked"
    Please check the following code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.controls.listClasses.BaseListData;
            import mx.controls.dataGridClasses.DataGridListData;
            import mx.controls.dataGridClasses.DataGridItemRenderer;
            import mx.events.ListEvent;
            import mx.controls.*;
            function grd_click(e:ListEvent):void{
                    var icol:int = e.columnIndex;
                    var column:DataGridColumn = DataGridColumn(grid1.columns[icol]);
                    var headerTxt:String = column.headerText;
                    Alert.show("Header text = " + headerTxt)
            function hideCol(index:int):void{
                  var c:DataGridColumn = DataGridColumn(grid1.columns[index]);
                  c.visible = false;  
            var items:Array = [
                {name:"vlad",lname:"collak"},
        ]]>
    </mx:Script>
        <!--<mx:DataGrid x="90" y="99" itemClick="test(event)" id="grid1" dataProvider="{items}">-->
        <mx:DataGrid x="90" y="99" itemClick="grd_click(event)" id="grid1" dataProvider="{items}">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="name"/>
                <mx:DataGridColumn headerText="Column 2" dataField="lname"/>          
            </mx:columns>
        </mx:DataGrid>
        <mx:Button x="90" y="262" label="Hide Column" click="hideCol(0)"/>
        <mx:Label x="90" y="56" text="Click on column content and the code will show col # and header name. Do the same After Hide Colun  is clicked" width="642" height="35"/>
    </mx:Application>
    Regards,
    Sri

    I think the column still exists even if you set its visibility to false. You could try something like this
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
        <mx:Script>
        <![CDATA[
            import mx.controls.listClasses.BaseListData;
            import mx.controls.dataGridClasses.DataGridListData;
            import mx.controls.dataGridClasses.DataGridItemRenderer;
            import mx.events.ListEvent;
            import mx.controls.*;
            private function grd_click(e:ListEvent):void{
                    var icol:int = e.columnIndex;
                    var column:DataGridColumn = DataGridColumn(grid1.columns[icol]);
                    var headerTxt:String = column.headerText;
                    Alert.show("Header text = " + headerTxt)
            private function hideCol(index:int):void{
              if(index == 0)
                  grid1.columns = [column1];
              else
                  grid1.columns = [column2];
            [Bindable]private var items:Array = [
                {name:"vlad",lname:"collak"},
        ]]>
    </mx:Script>
        <mx:DataGrid x="90" y="99" itemClick="grd_click(event)" id="grid1" dataProvider="{items}">
            <mx:columns>
                <mx:DataGridColumn id="column1" headerText="Column 1" dataField="name" />
                <mx:DataGridColumn id="column2" headerText="Column 2" dataField="lname"/>         
            </mx:columns>
        </mx:DataGrid>
        <mx:Button x="90" y="262" label="Hide Column" click="hideCol(0)"/>
        <mx:Label x="90" y="56" text="Click on column content and the code will show col # and header name. Do the same After Hide Colun  is clicked" width="642" height="35"/>
    </mx:Application>

  • DataGrid Refreshing Problem

    Hi All,
    First let me explain my problem clearly.I am facing the
    problem with refreshing datagrid for add,update,delete operations.
    For adding task(todo app) i am using another mxml
    component(PopUpwindow).when i do add,delete or update, changes are
    happening
    in database pakka and fine.There is no error in that.Only
    problem is when i add or delete or update a task, datagrid has to
    get refresh with the updated or new data.Then only from ui
    user will know that he added a task or deleted a task etc right.
    sometimes it's refreshing fine and sometimes not.If it
    doesn't refresh at all times i can think of my logic.But if it's
    happening sometimes and sometimes not.
    after add or delete or update am using below 5 lines of code
    to refresh datagrid.
    getList.send(); //sending request again to load new data
    using httpservice.
    datagrid.dataProvider = resultList; //resultList is
    bindabale ArrayCollection variable.
    resultList.refresh(); //this line not all giving any
    changes.i think it's not working
    datagrid.validateDisplayList();
    datagrid.validateNow();
    Thnaks & Regards,
    premadas.

    Hey harsha,
    the following code i'm using for deleting a task.
    <mx:HTTPService id="getTodo" url="
    http://dev.edinc.in:8080/poc/ToDo/GetToDo.jsp"
    result="resultHandler(event)"/>
    private function delTask():void
    delTodo.cancel();
    delTodo.send(delData);
    getTodo.send();
    deltaskname.text = "";
    deltaskdate.selectedDate = new Date();
    deltaskcategory.selectedIndex = -1;
    deltaskpriority.selectedIndex = -1;
    deltaskstatus.selectedIndex = -1;
    Anything i need to apply here.
    Thanks & Regards,
    Premdas.

Maybe you are looking for

  • Can I use my Tiger install disc on more than one computer

    I have a Powermac G4 15" and an imac G4 17". The p-mac has Tiger and the Imac has Panther. Can I use the install disc that came with the p-mac to install Tiger on the imac? Thanks for a great forum! G4   Mac OS X (10.4.5)  

  • Inserting SOH and EOT into stream

    Hi all, I have a problem , I need to my socket client to bind and establish a socket connection to a remote server. Once the port has bounded the server expects a start of header, some text and end of text. The networking code work fine but I cant in

  • Looking for a pricing plugin

    we have a plugin for quark that we use for our catalog that automatically changes the price as we make new catalogs. now we are making an online catalog, i am using flash for parts of it in places that are to be interactive. but i dont want to go thr

  • Does jsp in OAS 4.0.8.1 supports Multiple Language?

    Hi, I've tried using encoding=Big5 for chinese rendering but it throws an UnsupportedEncodingException. Any idea if jsp in OAS supports this? Thanks. regards, Hong Seng

  • This is becoming a big pain, ADOBE

    You would have thought Adobe could at least do something about providing a link to the full installer to Flash when the newest update won't install, but not bloody @#$%^& likely. It is becoming evident that they don't really care if people install it