Mx:datagrid detect itemeditor change

I've got a datagrid with a checkbox renderer/editor like
this. I've tried several alternatives but I cannot get
click="myFunction()" to see myFunction even though it is
defined in the same file. I want to detect each change and send
that change to the server so I don't have to worry about the user
forgetting to save changes.
I've allso tried listening to the ArrayCollection, but my
listener only gets called on initial startup.
<mx:ArrayCollection id="AttendanceArray"
collectionChange="attendanceEventHandler(event)"/>
This can't be that hard, but I sure can figure it out.
Anyone?

Based on your description this code may get you
started:

Similar Messages

  • Detect Note Changes in MIDI Sequencer

    Hi all,
    I&rsquo;m trying to detect when the MIDI Sequencer changes notes using some kind of a listener to detect when the note changes occur. My example program is able to detect the end of the sequence and I&rsquo;d like to be able to detect note changes and print a message in a similar way. Here is my example code.
    import javax.swing.*;
    import javax.sound.midi.*;
    public class SequencerTestApplet extends JApplet
        public void init()
            SequencerTest seqTest = new SequencerTest();
            seqTest.play();
            System.out.println("Print from init()");
    class SequencerTest
        Sequencer sequencer=null;
        Sequence seq=null;
        Track track=null;
        public SequencerTest()
            try
            {   sequencer = MidiSystem.getSequencer();
                sequencer.open();
                // detect END OF SEQUENCE
                sequencer.addMetaEventListener(
                    new MetaEventListener()
                    {   public void meta(MetaMessage m)
                        {  if (m.getType() == 47) System.out.println("SEQUENCE FINISHED");
                sequencer.setTempoInBPM(40);
                seq = new Sequence(Sequence.PPQ, 16);
                track = seq.createTrack();
            catch (Exception e) { }
        public void play()
            try
            {    // NOTE 1
                ShortMessage noteOnMsg = new ShortMessage();
                noteOnMsg.setMessage(ShortMessage.NOTE_ON, 0, 60, 93);
                track.add(new MidiEvent(noteOnMsg, 0));
                ShortMessage noteOffMsg = new ShortMessage();
                noteOffMsg.setMessage(ShortMessage.NOTE_OFF, 0, 60, 93);
                track.add(new MidiEvent(noteOffMsg, 16));
                // NOTE 2
                ShortMessage noteOnMsg2 = new ShortMessage();
                noteOnMsg2.setMessage(ShortMessage.NOTE_ON, 0, 68, 93);
                track.add(new MidiEvent(noteOnMsg2, 16));
                ShortMessage noteOffMsg2 = new ShortMessage();
                noteOffMsg2.setMessage(ShortMessage.NOTE_OFF, 0, 68, 93);
                track.add(new MidiEvent(noteOffMsg2, 32));
                sequencer.setSequence(seq);
                sequencer.start();
            catch (Exception e) { }
    }In this program the init() method starts the sequencer through the play() method and then continues on so that the &ldquo;print from init()&rdquo; statement is printed from the init() method while the sequencer is still playing. Then after the sequencer is finished, it uses the MetaEventListener to detect the end of the sequence and print the &ldquo;sequence finished&rdquo; message. I&rsquo;d like to be able to make it also detect when the sequence changes notes in a similar way... Start the sequence and move on, but then be able to detect each time a note change occurs and print a message.
    Since I am putting the notes at specific midi ticks (multiples of 16, or &ldquo;quarter notes&rdquo;) I could poll the Sequencer using getTickPosition() to see if the Sequencer&rsquo;s tick position matches a particular multiple of 16. However, the problem with this is it would lock up the program since it would be constantly polling the sequencer and the program wouldn&rsquo;t be able to do anything else while the Sequencer is playing (and I also have a loop option for the Sequencer so that would lock up the program indefinitely).
    Here&rsquo;s what I&rsquo;ve found out and tried so far...
    I read in this [this tutorial|http://java.sun.com/docs/books/tutorial/sound/MIDI-seq-adv.html] on the java sun site (under &ldquo;Specifying Special Event Listeners&rdquo;) that The Java Sound API specifies listener interfaces for control change events (for pitch-bend wheel, data slider, etc.) and meta events (for tempo change commands, end-of-track, etc.) but it says nothing about detecting note changes (note on/off). Also in the [EventListener API|http://java.sun.com/j2se/1.3/docs/api/java/util/class-use/EventListener.html] (under javax.sound.midi) it only lists the ControllerEventListener and the MetaEvenListener.
    I also read here that MIDI event listeners listen for the end of the MIDI stream, so again no info about detecting note changes.
    It seems like the sequencer should have some way of sending out messages (in some fashion) when these note changes happen, but I&rsquo;m not sure how or even if it actually does. I&rsquo;ve looked and looked and everything seems to be coming back to just these two types of listeners for MIDI so maybe it doesn&rsquo;t.
    To be sure the MetaEventListener doesn&rsquo;t detect note changes I changed the MetaMessage from:
    public void meta(MetaMessage m)
    {    if (m.getType() == 47) System.out.println("SEQUENCER FINISHED");
    }to:
    public void meta(MetaMessage m)
    {    System.out.println("" + m.getType());
    }so that it would print out all of the MetaMessages it receives. The only message that printed was &ldquo;47&rdquo; which indicates the end of the sequence. So the MetaEventListener doesn&rsquo;t appear to do what I need it to do.
    I realize this is a rather odd problem and probably not many people have had the need to do something like this, but it never hurts to ask. If anyone has any suggestions on how to solve this problem it would be greatly appreciated.
    Thanks,
    -tkr

    Tekker wrote:
    As another idea, since I can't do it with a listener like I originally wanted to, would adding a separate thread to poll the sequencer and send an interrupt when it matches a particular midi tick be a good route to try? My thinking is this essentially act kind of like a listener by running in the background and reporting back when it changes notes.Yep, that worked! :)
    import javax.swing.*;
    import javax.sound.midi.*;
    public class ThreadTestApplet extends JApplet
         public void init()
              ThreadTest threadTest = new ThreadTest();
              threadTest.play();
              MIDIThread thread = new MIDIThread(threadTest.sequencer);
              thread.start();
              System.out.println("  Print from init() 1");
              try { Thread.sleep(1000); } catch (InterruptedException ie) {}
              System.out.println("  Print from init() 2");
              try { Thread.sleep(1000); } catch (InterruptedException ie) {}
              System.out.println("  Print from init() 3");
              try { Thread.sleep(1000); } catch (InterruptedException ie) {}
              System.out.println("  Print from init() 4");
    class ThreadTest
         Sequencer sequencer=null;
         Sequence seq=null;
         Track track=null;
         public ThreadTest()
              System.out.println("Sequencer Started");
              try
              {     sequencer = MidiSystem.getSequencer();
                   sequencer.open();
                   // detect END OF SEQUENCE
                   sequencer.addMetaEventListener(
                        new MetaEventListener()
                        {  public void meta(MetaMessage m)
                             {     if (m.getType() == 47) System.out.println("SEQUENCER FINISHED");
                   sequencer.setTempoInBPM(40);
                   seq = new Sequence(Sequence.PPQ, 16);
                   track = seq.createTrack();
              catch (Exception e) { }
         public void play()
              try
              {     // NOTE 1
                   ShortMessage noteOnMsg = new ShortMessage();
                   noteOnMsg.setMessage(ShortMessage.NOTE_ON, 0, 60, 93);
                   track.add(new MidiEvent(noteOnMsg, 0));
                   ShortMessage noteOffMsg = new ShortMessage();
                   noteOffMsg.setMessage(ShortMessage.NOTE_OFF, 0, 60, 93);
                   track.add(new MidiEvent(noteOffMsg, 16));
                   // NOTE 2
                   ShortMessage noteOnMsg2 = new ShortMessage();
                   noteOnMsg2.setMessage(ShortMessage.NOTE_ON, 0, 68, 93);
                   track.add(new MidiEvent(noteOnMsg2, 16));
                   ShortMessage noteOffMsg2 = new ShortMessage();
                   noteOffMsg2.setMessage(ShortMessage.NOTE_OFF, 0, 68, 93);
                   track.add(new MidiEvent(noteOffMsg2, 32));
                   sequencer.setSequence(seq);
                   sequencer.start();
              catch (Exception e) { }
    import javax.sound.midi.*;
    public class MIDIThread extends Thread
         Sequencer sequencer=null;
         long midiTick=0;
         long midi_progressionLastChord=32;
         boolean print = true;
         public MIDIThread(Sequencer sequencer)
              this.sequencer = sequencer;
         public void run()
              System.out.println("Thread Started");
              while (midiTick<midi_progressionLastChord)
              {     midiTick = sequencer.getTickPosition();
                   if (midiTick == 0 || midiTick == 16)
                   {     if (print)
                        {     System.out.println("NOTE CHANGE");
                             print = false;
                   else
                        print = true;
    }I put in several print statements (with pauses in the init method) and the init print statements continue to be printed while the sequencer is playing, so it's not locking up the system and the "note change" statements happen when the sequencer changes notes. So this part is working perfectly! :)
    Here's what I got for my output:
    Sequencer Started
    Print from init() 1
    Thread Started
    NOTE CHANGE
    Print from init() 2
    NOTE CHANGE
    Print from init() 3
    SEQUENCER FINISHED
    Print from init() 4
    The only problem I'm having is how to "throw" this action back up to the main init method and have it do the print statement instead of the thread class. Throwing an interrupt apparently won't work as you have to poll it to see if it has been interrupted (so it'd be no different than just polling the sequencer to see if it equals the specific midi tick). Maybe throw an ActionEvent? But how to attach it to my applet? Would I need to create an instance of my applet and then pass that into the thread class so it can catch the ActionEvent? And if I do that will it stop the thread or will it keep the thread running so can detect the other notes?... Or is there a better/simpler way to do this?
    Thanks again,
    -tkr

  • Datagrid scrolls on change or click event - why?

    Hi,
    How do I stop my datagrid scrolling one line when I click on the top row?
    This happens with change, itemClick, and itemDoubleClick.
    It does not scroll on rows other than the top row.
    private function columnClick(e.ListEvent):void
    if e.columnIndex==0)
    DataGrid id= "dg" change="columnClick(event)"
    Any help would be much appeciated.
    Ian.

    You can only accept invitations and send invitations from the Calendar app, with an MS Exchange account on the iPhone.

  • Vbscript - detect config changes

    not sure if this is the right community to post this kind of question but i am after some example of vbscripts to detect routing change for example like to know when someone add a new route entry, advertised in to our campus networks, would like to know the no of routing entries being added, now of routes in the routing table /etc including vlan changes, RPF failures within the environment and number of entries in our multicast table including new additions.
    any example you can provide will be useful. thanks in advance.

    Config Changes are Changes to Customizing Objects (e.g. through IMG). Config changes are usually settings that a functional user would do in comparison to technical changes that involve ABAP which would require a developer.
    In general you could say that config changes are usually done by functional consultants whereas anything that involves ABAP coding is not config related.
    E.g. You set up order types in IMG and transport those settings. If you would now make changes to your DEV config but didn't transport this you will have config differences between DEV and Q.
    Hope that helps,
    Michael

  • Vbscript - detecting configuration changes

    Hi,
    not sure if this is the right community to post this kind of question but i am after some example of vbscripts to detect routing change for example like to know when someone add a new route entry, advertised in to our campus networks, would like to know the no of routing entries being added, now of routes in the routing table /etc including vlan changes, RPF failures within the environment and number of entries in our multicast table including new additions.
    any example you can provide will be useful. thanks in advance.

    Configure your web application to use file-based persistence. See
    http://docs.sun.com/source/817-6251/pwasessn.html#wp31960 and
    http://docs.sun.com/source/817-6251/pwadeply.html#wp28498
    Something like the following in your WEB-INF/sun-web.xml should do the trick
    <sun-web-app>
            <session-config>
               <session-manager persistence-type=�file�>
                  <manager-properties>
                     <property name="reapIntervalSeconds" value="1" />
                  </manager-properties>
                  <store-properties>
                    <property name="reapIntervalSeconds" value="1" />
                  </store-properties>
               </session-manager>
            </session-config>
    </sun-web-app>

  • Detection of changes in the context prior saving a document

    Original thread title: IS_CHANGED_BY_CLIENT and RESET_CHANGED_BY_CLIENT methods / selection change
    Does anyone know, why is that the RESET method is recursive, but the IS method isn't?
    The problem is, I need to trigger a save of a document only when there is some change made by the user, but to do that i'm being forced to implement myself a recursive method which uses both IS_CHANGED_BY_CLIENT and GET_CHILD_NODES methods. While I simply call the RESET_CHANGED_BY_CLIENT method of the root node and it affects all subnodes.
    Another problem is that, the selection changes (e.g. in a dropdownbyindex) don't get accounted as changes by the IS_CHANGED_BY_CLIENT method.
    Is there any simpler way to implement this?
    Thanks

    Thanks for your comments Manish. I've already programmed the recursive method and it is working ok, seems to be the only way then.
    But how did you solve detection of selection changes? Currently i'm thinking of having an event handler for each dropdown, which will mark a flag to be evaluated additionally to the method's result. You did the same, or selection changes didn't matter in your case?
    Thank you
    Solved: The context change log seems to be a far better alternative, it also detects selection changes.
    Check DEMO_CONTEXT_CHANGES example. If you need only to detect changes, you can use just the enable_context_change_log and get_context_change_log methods.
    It may be a little bit taxing when the context is large though, I'd like if anyone which has had this experience could comment.

  • Detect value change in a wire

    Hi, this seems pretty trivial, but I cannot find a clean way to do it, and i couldn't find anything in the forums. I want to detect a change in the value in a wire coming out of a "Get timestring VI", from iteration to iteration, and I dont think event structures quite help, because they detect changes only in front panel controls. I prefer not to use shift registers because they bring in unnecessary clutter. Is there a cleaner way to do this?
    Thanks!

    A feedback node is a little less clutter because it is more localized.
    Here's the code to detect a change in a numeric, but it works with any datatype. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Changed.png ‏3 KB

  • JTabel, detecting data changes

    Hi,
    I am new to the JTable component... I have set up a JTabel which displays some sample information. I have to display results I get from one of my methods... There is the Swing/JTable tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#modelchange ("Detecting Data Changes"), however, the necessary code has been removed from the tutorial! I hope you can help me...
    I have set up the following table:
    public class InfoDialog extends JDialog {
         String[] columnNames = {"Type", "Value"};
         Object[][] data = {
                   {"Angle", "90"},
                   {"Speed", "50"},
         public InfoDialog() {
              Container cp = this.getContentPane();
              setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS));
              JTable table = new JTable(data, columnNames);
              table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              JPanel tablePanel = new JPanel();
              tablePanel.setLayout(new BorderLayout());
              tablePanel.add(table.getTableHeader(), BorderLayout.PAGE_START);
              tablePanel.add(table, BorderLayout.CENTER);
    (...)From one of my other classes, GameStart, one of the methods, calculateAngle, returns the measured angle. I would like to display this result in the appropriate cell.
    In the Swing tutorial I just can read "You can see the code for that method in [PENDING: The Bingo example has been removed.]"
    So I am a little bit confused. I think I have to first extend AbstractTableModel, then I have something to do with fireTableCellUpdated... Can you maybe show me a working example or is this "Bingo example" from the Swing available elsewhere?
    Thanks for your help!

    so I can't extend AbstractTableModel... Why are you trying to do this?I first followed the example given by Sunan.N (reply #6).
    Here is a complete working example:
    http://forum.java.sun.com/thread.jspa?forumID=57&threa
    dID=566133Thanks for this example. As a newbie I still have one problem: how can I set the a new value? I use the table.getModel().setValueAt(...) method... but which code goes into the tableChanged method and which into the setValueAt method?
    Here is my code:
    public class InfoDialog extends JDialog implements TableModelListener {
         private static final long serialVersionUID = 1L;
         public JTable table;
            String[] columnNames = {"Type", "Value"};
         Object[][] data = {
                   {"Angle", "90"},
                   {"Speed", "50"},
         public InfoDialog {
              Container cp = this.getContentPane();
              setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS));
              Dimension dim_topPanel = new Dimension(300, 150);
              JPanel topPanel = new JPanel();
              topPanel.setPreferredSize(dim_topPanel);
              topPanel.setBackground(Color.YELLOW);
              DefaultTableModel model = new DefaultTableModel(rowData, columnNames);
              model.addTableModelListener(this);
              table = new JTable(model);
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JPanel tablePanel = new JPanel();
              tablePanel.setLayout(new BorderLayout());
              tablePanel.add(table.getTableHeader(), BorderLayout.PAGE_START);
              tablePanel.add(table, BorderLayout.CENTER);
              cp.add(topPanel);
              cp.add(tablePanel);
              setDefaultLookAndFeelDecorated(false);
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch(Exception e) {
                   e.printStackTrace();
              setResizable(false);
              setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              pack();
              setLocationRelativeTo(null);
              setVisible(true);
         public void tableChanged(TableModelEvent e) {
              System.out.println("Table change");          
         public void setValueAt(Object aValue, int row, int column) {
    }What do I have to do to change, e.g., "Speed" from 50 to 60? I call the setValueAt method like this: table.getModel().setValueAt(60, 2, 2); but what do I have to write into my setValueAt method? I thought that my table will automatically change the value when calling the setValueAt method...?
    The tableChanged method is being called when a value in my table changes... OK, but what should I do with this method? I just would like to set a new value...
    :confused:

  • How to detect dataprovider change in spark List ?

    The problem is : when the dataprovider changes, the List unselects its items. I want the selected item of the List to stay selected, even if the dataprovider has a new item, for example.
    So I try to detect a change in the dataprovider, to be able to re-select the item that was selected before the change.
    I tried to listen several events but it didn't work :
    - change is dispatched by user, not by code.
    - updatecompleted is dispatched when the dataprovider changes but it is triggered also when the list is resized, and I don't want that.
    - collectionChange is not dispatched
    I don't understand why valueCommit is not dispatched when the dataprovider changes.
    Can you help me ???

    There is a dataProviderChange event fired whenever dataProvider is set,
    but it may not be listed in the metadata so you may not be able to access
    from MXML.
    Flex harUI,
    Why isn't this event exposed publicly through the metadata of the class?
    The easy fix I can come up with is to extend the List, by simply exposing the event, like:
              [Event(name="dataProviderChange", type="flash.events.Event")]
              public class ExtendedList extends List
    But I don't know if it's good practice...

  • Detecting a change in a system matrix - cnt'd

    Hello,
    This is from one of my previous questions:
    [quote]
    When an order or any other sales document is created, I want to detect if a change is made to the quantity, price, etc. of any of the lines of the document, and then change or add another line. For example, when the quantity of 'Item A' is changed from 1 to a value equal to or above 5, another item 'Item B' is required for the sale and should be added (or it's quantity increased).
    [/quote]
    My previous problem is solved now, but I directly encountered another. So when I detect a change in the matrix, I need to add a new document line, with item code 'Item B'. I have tried in various different ways but I don't seem to be able to add a line to the matrix. When I use oMatrix.AddRows(1), an empty line is added, but whenever I try to change the column values, an error occurs. Can anybody help me cracking this problem?
    Thanks

    Hello,
    If the problem still exists - what about "activating" menu item "1292" ("Add Row")?
    Did you try that + then move to this row?
    HTH

  • How to use event to detect the change of a array variable?

    I have a main application that includes a lot of sub
    components. the main app mxml file import a public class that
    includes an array variable. Each of the values in the array can be
    updated in the sub components.
    I would like to have the main mxml be able to detect the
    change of the values of the array. Is it possible to use event? And
    how? Is there a good example to follow?

    See this FB3 help topic, particularly watchers:
    Defining data bindings in ActionScript

  • Tomcat fails to detect jsp change

    I have a folder called myjsp in witch I have many jsp pages. I often make changes to these jsp pages and copy folder myjsp to many servers (Tomcat 5 and Tomcat 6).
    SOME of these Tomcat would fail to detect my changes.
    All tomcat are configured the same way. Reload is set to true.
    Any ideas?
    Thanks

    The files have a newer date compared to what?
    The date that the JSP file would be compared to would be the date of the generated servlet sitting in the work directory.
    Executing the unix "touch" command on all the JSPs you are updating will ensure that they get the current date/time and that they will be newer than the generated page.
    Alternatively you can delete Tomcat's work directory (where it stores all the generated/compiled servlets) and you can be absolutely certain that no old ones remain.
    cheers,
    evnafets

  • Datagrid itemRenderer/itemEditor trouble

    I have a datagrid in a Flex project, the data grid has an XML file as the source (contents below), now due to the way it is formatted (I cannot change this) some of the data I want to display is inside a tag that isnt at the initial array level. Here is the file:
    <?xml version="1.0" encoding="utf-8" ?>
    <Categories>
    <Category>
      <CategoryName>Cat 1</CategoryName>
      <CategoryLink>http://www.google.com</CategoryLink>
      <CategoryData>
       <CategoryDescription>This is the description of category 1</CategoryDescription>
       <CategoryHeader>My Category Title 1</CategoryHeader>
       <CategoryNumber>1</CategoryNumber>
      </CategoryData>
    </Category>
    </Categories>
    I need to display CategoryName, CategoryLink, CategoryData.CategoryDescription, CategoryData.CategoryNumber.
    Now I blindly dropped the datagrid into the project and bound it to the data source, I get the following returned for CategoryData:
    [object CategoryData_type]
    Not much use, but with what appears to be a hack I changed the code for the column to read dataField="CategoryData.CategoryDescription", and hooray it works. I didnt realise at the time that this was wrong, and when I dropped in an itemEditor things went wrong. When the datagrids load they display the correct data, but then when you try to edit any of the child property fields you get the following error:
    ReferenceError: Error #1069: Property CategoryData.CategoryDescription not found on valueObjects.Category_type and there is no default value.
    I have looked up the error and I realise that it means that there is no value for CategoryData.CategoryDescription, but if I can display it why can i not edit it! What do I have to do to make this work?
    Anyway, here is the code, it shows the default bound datagrid, a second datagrid with the hack applied, and a third hacked datagrid with an itemRenderer and itemEditor on the number columns
    Can you please take a look and tell me what I did wrong, well more to the point, if there is a doc that explains how to deal with XML like this then please point me at it.
    I did try changing the return type for ANY of the columns, but this fails, I also tried a labelFunction, but again I can get the [object CategoryData_type] to display, but I get the null reference exception as the datagrid loads if I try to get to the child props.
    Here is the Flex code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:categories="services.categories.*"
          minWidth="955" minHeight="600">
    <fx:Script>
      <![CDATA[
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
        getDataResult.token = categories.getData();
       protected function lftest(item:Object, column:GridColumn):String
        var t:String = item.CategoryData;
        return t;
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:CallResponder id="getDataResult"/>
      <categories:Categories id="categories"
              fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
              showBusyCursor="true"/>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:DataGrid id="dataGrid" x="10" y="10" width="684"
        creationComplete="dataGrid_creationCompleteHandler(event)" editable="true"
        requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn width="100" dataField="CategoryName" headerText="CategoryName"></s:GridColumn>
        <s:GridColumn width="100" dataField="CategoryLink" headerText="CategoryLink"></s:GridColumn>
        <s:GridColumn width="180" dataField="CategoryData" headerText="CategoryData"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object CategoryData="CategoryData1" CategoryLink="CategoryLink1"
            CategoryName="CategoryName1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{getDataResult.lastResult}"/>
    </s:DataGrid>
    <s:DataGrid id="dataGrid2" x="10" y="147" width="684" editable="true" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn width="100" dataField="CategoryName" headerText="CategoryName"></s:GridColumn>
        <s:GridColumn width="100" dataField="CategoryLink" headerText="CategoryLink"></s:GridColumn>
        <s:GridColumn width="180" dataField="CategoryData" headerText="CategoryData"></s:GridColumn>
        <s:GridColumn dataField="CategoryData.CategoryDescription" headerText="Desc"></s:GridColumn>
        <s:GridColumn dataField="CategoryData.CategoryHeader" headerText="Head"></s:GridColumn>
        <s:GridColumn dataField="CategoryData.CategoryNumber" headerText="Num"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object CategoryData="CategoryData1" CategoryLink="CategoryLink1"
            CategoryName="CategoryName1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{getDataResult.lastResult}"/>
    </s:DataGrid>
    <s:DataGrid id="dataGrid3" x="10" y="284" width="684" editable="true" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn width="100" dataField="CategoryName" headerText="CategoryName"></s:GridColumn>
        <s:GridColumn width="100" dataField="CategoryLink" headerText="CategoryLink"></s:GridColumn>
        <s:GridColumn width="180" dataField="CategoryData" headerText="CategoryData"></s:GridColumn>
        <s:GridColumn headerText="Number">
         <s:itemRenderer>
          <fx:Component>
           <s:GridItemRenderer>
            <s:NumericStepper value="{data.CategoryData.CategoryNumber}" />
           </s:GridItemRenderer>
          </fx:Component>
         </s:itemRenderer>
        </s:GridColumn>
        <s:GridColumn dataField="CategoryData.CategoryNumber" headerText="Number">
         <s:itemEditor>
          <fx:Component>
           <s:GridItemEditor>
            <s:NumericStepper value="{data.CategoryData.CategoryNumber}" />
           </s:GridItemEditor>
          </fx:Component>
         </s:itemEditor>
        </s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object CategoryData="CategoryData1" CategoryLink="CategoryLink1"
            CategoryName="CategoryName1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{getDataResult.lastResult}"/>
    </s:DataGrid>
    </s:Application>
    All and any advice welcome.
    Shaine

    One last try, I now know for sure that the data in the file is loading, I created a labelFunction on the CategoryDescription column that looks like this:
    protected function dispData(item:Object, column:GridColumn):String
        var t:Object = item.CategoryData;
        var s:String = item.CategoryData.CategoryDescription;
        return s;
    Because it returns s, which I now know is undefined (which is the problem!) I managed to get a debug output. As you can see the value of t is the categorydata, and it appears to have the 3 values I need to get access to, but I have no idea how to do this. I also changed the function to read:
    protected function dispData(item:Object, column:GridColumn):String
    var t:Object = item.CategoryData;
    var s:String = t.CategoryDescription;
    return s;
    But this undefines t and s! Very confused
    this test2 (@d2e10a1)
    item valueObjects.Category_type (@91f8a51)
    [inherited]
    column spark.components.gridClasses.GridColumn (@d61b239)
    t valueObjects.CategoryData_type (@91f8c11)
    [inherited]
      _cacheInitialized_isValid false
      CategoryDescription "This is the description of category 1"
      CategoryHeader "My Category Title 1"
      CategoryNumber "1"
      _changedObjects mx.collections.ArrayCollection (@d5d9e41)
      _changeWatcherArray [] (@cfab061)
      _dminternal_model _CategoryData_typeEntityMetadata (@d4286a1)
      _doValidationCacheOfCategoryDescription null
      _doValidationCacheOfCategoryHeader null
      _doValidationCacheOfCategoryNumber null
      _doValidationLastValOfCategoryDescription null
      _doValidationLastValOfCategoryHeader null
      _doValidationLastValOfCategoryNumber null
      _internal_CategoryDescription "This is the description of category 1"
      _internal_CategoryHeader "My Category Title 1"
      _internal_CategoryNumber "1"
      _invalidConstraints [] (@ca50fd9)
      invalidConstraints_der <setter>
      _isValid false
      isValid_der <setter>
      managingService <setter>
      _managingService null
      _model _CategoryData_typeEntityMetadata (@d4286a1)
      _validationFailureMessages [] (@cfab0b1)
    s undefined
    As always all help welcome.
    Shaine
    Message was edited after a oops moment by: ProcessEndNow

  • Datagrid combobox itemEditor event

    I have a datagrid populated by managed arraycollection by
    dataservice. One of the columns has an item Editor using a
    component ComboBox. Sofar all is fine but I have not been able to
    define an event that will be triggered when the combobox has
    changed and a new value is selected. I have tried itemEditEnd which
    will only trigger if one clicks outside the itemEditor which
    generates an "other" event. "Change" method of DG will trigger an
    event before any selection is made. Any ideas? I need the trigger
    to commit the change to database.
    Thx

    Hi,
    I'm sorry to bug you with a non-technical discussion, but I
    am a recruiter in San Diego. My client is in need of 3 Senior Flex
    Developers for their project. I have had an extremely rough time
    finding someone for this position. Would you be interested in this
    position, or do you know of anyone that might be? We do pay
    referral fees. This position may be open to telecommuting.
    Job Description:
    They are in the midst of a major re-architecting of their
    Corporate Management system utilizing many cutting edge
    technologies. As it relates to the position they are using Flex as
    their UI.
    This is either a contract, or a full-time position.
    Pay: Market Rate
    Thanks for your help!
    Natalie Fay
    Outsource Technical
    www.ostechnical.com
    [email protected]
    858.874.5637

  • DataGrid not reflecting changes after INSERT into Table. Delete from Table does.

    Wow, it's been a while.
    Hope you guys can help.
    This is my DataGrid:
    <DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="BorderThickness" Value="0"/>
    </Style>
    </DataGrid.CellStyle>
    <DataGrid.Columns>
    <DataGridTextColumn x:Name="NodeColumn" Binding="{Binding node}" Header="VS Number" Width="*"/>
    <DataGridTextColumn x:Name="SerialColumn" Binding="{Binding serial}" Header="Serial Number" Width="*"/>
    <DataGridTextColumn x:Name="NameColumn" Binding="{Binding name}" Header="Asset Name" Width="*"/>
    <DataGridTextColumn x:Name="TypeColumn" Binding="{Binding type}" Header="Asset Type" Width="*"/>
    <DataGridTextColumn x:Name="_dateColumn" Binding="{Binding date}" Header="Date Allocated" Width="*"/>
    <DataGridTextColumn x:Name="PoColumn" Binding="{Binding po}" Header="Purchase Order" Width="*"/>
    </DataGrid.Columns>
    </DataGrid>
    This is where I add a new Row to the Table:
    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
    Dim cbblocation As ComboBox = Me.FindName("LocationComboBox")
    Dim row As DataRowView = DirectCast(cbblocation.SelectedItem, DataRowView)
    Dim cbbtext As String = row.Item("node")
    Dim cbbtype As ComboBox = Me.FindName("comboBoxType")
    Dim cbbtext2 As String = cbbtype.Text
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.AddNewAsset(cbbtext, txbSerial.Text, txbName.Text, cbbtext2, Date.Today, txbPO.Text)
    node = cbbtext
    Dim mp As New MainPage
    mp.RefreshGrid(node)
    Me.Close()
    End Sub
    The RefreshGrid method:
    Public Sub RefreshGrid(node As String)
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.FillByNode(RETAILISOAMDDataSet.tableAssets, node)
    Dim TableAssetsViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("TableAssetsViewSource"), System.Windows.Data.CollectionViewSource)
    Dim be As BindingExpression = BindingOperations.GetBindingExpression(TableAssetsViewSource, CollectionViewSource.SourceProperty)
    be.UpdateTarget()
    End Sub
    And this is what I use to delete a row from the table (and without doing anything special, the DataGrid auto-updates with the changes):
    Private Sub Button_Click_4(sender As Object, e As RoutedEventArgs)
    If TableAssetsDataGrid.SelectedIndex = -1 Then
    MsgBox("You have selected nothing to Delete!", MsgBoxStyle.OkOnly, "Nothing Selected")
    Else
    Dim dgv As DataGridTextColumn = Me.FindName("NodeColumn")
    Dim row As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText As String = row.Item("node")
    Dim dgv2 As DataGridTextColumn = Me.FindName("SerialColumn")
    Dim row2 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText2 As String = row.Item("serial")
    Dim dgv3 As DataGridTextColumn = Me.FindName("NameColumn")
    Dim row3 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText3 As String = row.Item("name")
    Dim dgv4 As DataGridTextColumn = Me.FindName("TypeColumn")
    Dim row4 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText4 As String = row.Item("type")
    Dim dgv5 As DataGridTextColumn = Me.FindName("_dateColumn")
    Dim row5 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText5 As String = row.Item("date")
    Dim dgv6 As DataGridTextColumn = Me.FindName("POColumn")
    Dim row6 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText6 As String = row.Item("po")
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.RemoveAsset(dgvText, dgvText2, dgvText3, dgvText4, dgvText5, dgvText6)
    Dim cbb As ComboBox = Me.FindName("cbbLocation")
    Dim row7 As DataRowView = DirectCast(cbb.SelectedItem, DataRowView)
    Dim cbbtext As String = row.Item("node")
    RefreshGrid(cbbtext)
    End If
    End Sub
    --------- End of Edit
    It is bound to a Dataset which gets it's data from a SQL Database.
    Loading the Data and Filtering the data based on certain conditions work 100%. The problem I am having is as follows:
    I have a form on the Page that takes input and inserts a row into the Database. When this happens, the DataGrid won't automatically reflect the changes (even if I recall the Fill Method of the Dataset). No matter what I do, I have to refresh the entire page
    and THEN Fill the Dataset to see any changes.
    This is what strikes me as odd...
    When I do a delete row operation on the Database (Custom Method on the Dataset with conditions), and just Fill the Dataset again (without doing anything special), the row deletes and the changes is reflected IMMEDIATELY.
    What am I doing wrong here? Why would Delete Row reflect the changes on the DataGrid but no Insert Row?
    Thanks in Advance.
    (P.S. I am very rusty with my developing skills, I haven't done this in YEARS)

    >>And what about the the most important question, how exactly is TableAssetsViewSource defined in the XAML markup and what is
    its Source property set or bound to? And what about the reproducable sample...?
    Here is the Markup of the TableAssetsViewSource:
    <Page.Resources>
    <local:RETAILISOAMDDataSet x:Key="RETAILISOAMDDataSet"/>
    <CollectionViewSource x:Key="TableRegionsViewSource" Source="{Binding tableRegions, Source={StaticResource RETAILISOAMDDataSet}}"/>
    <CollectionViewSource x:Key="TableLocationsViewSource" Source="{Binding tableLocations, Source={StaticResource RETAILISOAMDDataSet}}"/>
    <CollectionViewSource x:Key="TableAssetsViewSource" Source="{Binding tableAssets, Source={StaticResource RETAILISOAMDDataSet}}"/>
    </Page.Resources>
    The ItemsSource of the DataGrid is bound to the TableAssetsViewSource:
    <DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
    Just remember, this code was auto-generated with the drag & drop onto the Page, so I did little in terms of setting the actual bindings.
    All in all, what I have done so far works as intended, except that when I want to add a row to the table it does not reflect, and that it only shows after refreshing/restarting the application.
    I will try and put together a reproducable sample.

Maybe you are looking for

  • HP envy Trackpad unresponsi​ve and glitchy.

    I have had this laptop for about 6 months now and the bug began almost a month after I bought my device.  I didn't think it was as important of an error initially because I tend to carry a mouse with me ususally. Now it has rendered my device unusabl

  • Embed player in SWF

    I am having trouble getting thru step 2. 1. Choose the Player you'd like to host in your PDF and select ActionScript from the 'Get Code' options in the Publishing Module. 2. Using Flash, Flex, or a comparable program - embed your player within a SWF.

  • Processing History for Services for Object

    Hello Together, I created documents attachment in CJ20N Transaction code using the button "services for the object ," for one WBS Element. Some one have deleted some documents from the list, I did not see who deleted this, it there a processing histo

  • Problem with Contrat for automatic approval

    Hi Folks, We are on SRM 7.0 We have activated BC set for Automatioc Approval for contracts. When the contract is created and released to erp, the status is still shown as awaiting approval. Can someone help to guide in troubleshooting this issue Than

  • Jdeveloper 11G and ADE integration

    Hi , I am planning to use , JDeveloper and ADE . Is it possible to use both in windows platform. I have a windows XP laptop and have already installed JDeveloper in that. Is it possible to integrate ADE with that ? . Or ADE is only possible to instal