How to access the datagrid in one mxml in another component

I have a datagrid in a.mxml. when click on the add button, it comes to a b.as file (not a class) to do some things and then, b.as call a popupwindow (c.mxml) to add a row into table (call backend). After I added the row to database table successfully, I want to add the row into datagrid to display, but I could not access the datagrid in a.mxml from c.mxml. How can I do this?
Thank you in advance.

If this post answers your question or helps, please mark it as such.
To add a row to the DataGrid you really need to just add data to the dataProvider collection object.
You can access components by going through the main app:
mx.core.Application.application.myA.myVar = myC.cVar;
But you should really be using custom events to communicate between components, though it is more complex. Here is my Flex 3 Cookbook post of the topic of custom events:
http://cookbooks.adobe.com/post_Building_a_wizard_using_a_simplified_MVC_architect-11246.h tml
Here are some sample apps on custom events on my web site (right click to View Source):
http://www.chikaradev.com/learning/flex3/customevents/CustomEventSimple/CustomEventSimple. html
http://www.chikaradev.com/learning/flex3/customevents/CustomEvents1/index.html
http://www.chikaradev.com/learning/flex3/customevents/CustomEvents2/CustomEvents2.html
http://www.chikaradev.com/learning/flex3/customevents/CustomEvents3/CustomEvents3.html
Here is my tutorial on custom events:
http://www.chikaradev.com/learning/flex3/customevents/StudentsTutoringCustomEvents1.pdf

Similar Messages

  • How to access the element of one mxml to another mxml?

    Hi,
    I have a component named storylist as below in StoryList.mxml
    <mx:List id="storyList" width="100%" dataProvider="{this.currentDoc.stories}" height="100%" variableRowHeight="true" selectable="false" borderStyle="none"
    itemRenderer="com.xxx.yyy.core.views.renderers.StoryRenderer">
    </mx:List>
    I want to access the storylist in another mxml CoreCanvas.mxml
    private function onOpenFile (doc:IdmlDocument):void {
    logger.info("onOpenFile");
    this.editor.currentDoc = doc;
    this.editor.storyList.dataProvider = this.editor.currentDoc.stories;
    but when  i declared as a bindable variable in StoryList.mxml --> [Bindable] public varstoryList:IdmlStory = null;
    it gives an error
    Description Resource Path Location Type
    1151: A conflict exists with definition storyList in namespace internal. StoryList.mxml/WebEditorCore/src/com/xxx/yyy/core/views/editor line 10 Flex Problem
    how can i access storylist in the other mxml file?
    Message was edited by: Jochem van Dieten

    I'm a bit confused about this design approach.
    [Bindable] public var storyList:IdmlStory = null; 
    The reason why the above line fails to compile in StoryList.mxml is that a variable of the same name already exists. You have specified a List with an id of storyList. The translation process will yield:
    var storyList:List = new List();
    and then fill in the properties.

  • How to access a variable from one mxml to another mxml?

    I have Vbox having Hbox in turn hbox has some components ...TextInput...
    I m adding this Vbox in another mxml file....iteratively ....
    I need the sum of all the enetered values in the text boxes to be displayed on the textbox in another Mxml ...
    I am taking sum in a variable and want to show tha some in another file...
    How can I get that variable in my resultant mxml??
    TIA

    In this case it is best to use custom events to pass data. Here are some resources:
    http://chikaradev.com/learning/flex3/customevents/StudentsTutoringCustomEvents1.pdf
    http://chikaradev.com/learning/flex3/customevents/CustomEvents3/CustomEvents3.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • How to transfer the logins from one instance to another instance in sql2008r2

    how to transfer the logins from one instance to another instance in sql2008r2

    Hi Ganesh,
    According to your description, you want to know how to transfer the logins from one instance to another instance for SQL Server 2008 R2. To do this, besides dave’s post, you could also use
    'Copy Database Wizard' in SQL Server Management Studio, or the component
    'transfer Login task' in SQL Server Integration Services.
    Regards,
    Michelle Li

  • How to mirror the screen from one ipad2 to another ipad2?

    How to mirror the screen from one ipad2 to another ipad2?
    When writing in f.ex. Pages on one iPad i wish to see it in realtime on the other ipad.
    How is that done???

    That functionality is not built into the iPad, so you'd need a third-party app of some sort. I'm not aware of any app that allows mirroring from one iPad to another iPad, but perhaps someone else will know of something I've missed.
    Regards.

  • OpenScript: 1.     How to move the scripts from one location to another location. in OpenScript; Copy, paste or Import, export

    How to move the scripts from one location to another location. Copy, paste or Import, export

    Both way you can do.. Difference is - if you copy paste to another folder script dependencies will not move with the same( ie Assets added), whereas if you export and import the script all dependencies will be correlated automatically

  • How do I can link from one MXML to another in the same project?

    I planned to create a login page separated in my new Flex
    application. Maybe I am too attached to the WEB philosophy but I
    prefer to do it in that way. The login page will simply validate
    the login through a call to a CFC. While the CFC will also create
    the session variables I will need over the navigation of the user
    (once the login is validated), the variables (or more specifically
    the values of those variables) will serve as reference during the
    user's navigation. And those values are contains in the ColdFusion
    Session and can be accessed through CFCs.
    If the login is a success, I need to redirect the user to the
    appropriate page (in my case, the application is a help desk system
    so if the user is identified as a technician will go to the
    technician.mxml or if the user is identified as a sysadmin, will go
    to the sysadmin.mxml - simple as that). Now, I know it is possible
    to redirect using ExternalInterface.call function but is there
    anything more specific to Flex redirection from one MXML to
    another? Just like classes (where you can create dependency of a
    child classe to is parent)?
    Thank you

    I finally decided to use simply the method
    ExternalInterface.call to do this and it works fine! I passed
    parameters through the URL and I actually created CFM page that
    contains a copy of the HTML code generated by FlexBuilder (the CFM
    page give me the possibility to deal with the parameters).
    But I though that Flex can actually call another Flex and
    passing parameters directly without passing by the HTML page
    itself. A kind of memory scope but I guess I wish too much!!!
    ;-))

  • How to access the screen from one function group to other function group

    Hi Experts,
    How to access the the screen from one function group to other function group.
    Please help me on this , Bcoz it is client requirement i need to finish this urgently.
    Please
    Thanks
    Basu

    HI ,
    You can do a call transaction or submit and return
    Regards,
    Sooness.

  • How to Transfer the iPhone from one computer to another Win XP

    All
    I got my wife a new macbook pro, running Windows XP prof. She has an iphone 3G with 16 GB memory running 3.0.1. So..she wanted to transfer the sync function from her PC to her macbook. Of course, Apple was of NO help at all (but did want to charge us $69.95 since her iphone is out of warranty, and this was an iphone not a mac problem, hmmm..). Took me lots of digging, but here is how you transfer you iphone from one computer to another:
    1. Move you itunes library from the old computer to the new one. To do this, you do NOT just copy it. This is as good a link to use as any to see how to do it, but search the internet and you can find instructions:
    http://reviews.cnet.com/8301-12519_7-10242259-49.html
    2. Transfer your applications you have purchased to the new computer. To do this, open itunes in the new computer, hook up your phone and click on File>transfer purchases (from itunes store) to computer. This will move your applications to the new computer.
    3. Export your MS outlook calendar, contacts, notes, etc. to the new computer by saving each of these categories as a PST file (file>export>then choose the category and type of file)...and then copy these PST files to your new computer and import them into MS outlook.
    4. Copy your playlists from itunes on your old computer to your new computer. This link may be helpful or search the internet again if you need to:
    http://osx.tribe.net/thread/08fd0e5e-f1d0-450b-8de5-9f7cb5bd278d
    5. Now...the important part...how to transfer all your settings from the iphone to the new computer....this is the part that was hard to find online, but finally got it: NOTE: THE BACKUP THAT ITUNES MAKES BACKS UP THE APPLICATION SETTINGS BUT NOT THE APPS SO THIS IS WHY YOU NEED TO TRANSFER THE APPS TO THE NEW COMPUTER. The settings have all the data you put into your apps, email settings, preferences, etc...so its a huge time save to transfer these to the new computer also.
    -Sync your iphone with your old computer to have a backup in case you mess up...in that case you can restore from your old computer and start over
    -Plug your iphone into the new ocmputer and start itunes. It will detect your phone (I assume you have already authorized your new computer to use the library and playlists and apps that you moved)
    -Right click on the "iphone" on the left bar...you will see a popup menu...click on "BACKUP". Let it backup your iphone to the new computer. It will NOT sync the phone
    -When the backup is done....copy the backup file to a temp directory to be safe. The backup is located in "documents and settings">user name>applications>apple computer>mobile sync. If you cannot see it, you need to open windows explorer (not internet explorer) and go to tools>folder options>view and click on "show hidden files and folders" Note YOU CANNOT JUST COPY THE BACKUP FROM THE OLD COMPUTER TO THE NEW COMPUTER AS SUGGESTED ON SOME WEB SITES...THIS DOES NOT WORK, ITUNES WILL NOT IDENTIFY THE BACKUP EVEN IF YOU PUT IT IN THE FOLDER IN THE NEW COMPUTER THAT MIRRORS THE FOLDER LOCATION IN THE OLD COMPUTER.
    -OK now you are ready...click restore on the iphone and restore the phone to factory settings. This will happen in a few minutes (10-15 mins).
    -The phone will reboot and itunes will recognize the phone again...as a restored phone. It will then ask you if you want to restore it from the backup..say YES. You then need to go through all the itunes tabs and click on everything you want to sync to the phone (playlists, movies, podcasts, ringtones, etc). Once you are done going thru the tabs click "apply" and the sync will start. Go out, to a movie, to bed, whatever because it will take hours to sync.
    -Once the sync is done...voila...your iphone has been moved with ALL the settings to the new computer. Check it. Then you can delete the backup you put into the temp folder if it is OK
    -Deauthorize your old computer
    This worked for Win XP...should work for Vista. The whole process took many hours so don't rush through it (i'm guessing 12 hours total work).
    Can I send apple a bill for tech support?????

    All
    I got my wife a new macbook pro, running Windows XP prof. She has an iphone 3G with 16 GB memory running 3.0.1. So..she wanted to transfer the sync function from her PC to her macbook. Of course, Apple was of NO help at all (but did want to charge us $69.95 since her iphone is out of warranty, and this was an iphone not a mac problem, hmmm..). Took me lots of digging, but here is how you transfer you iphone from one computer to another:
    1. Move you itunes library from the old computer to the new one. To do this, you do NOT just copy it. This is as good a link to use as any to see how to do it, but search the internet and you can find instructions:
    http://reviews.cnet.com/8301-12519_7-10242259-49.html
    2. Transfer your applications you have purchased to the new computer. To do this, open itunes in the new computer, hook up your phone and click on File>transfer purchases (from itunes store) to computer. This will move your applications to the new computer.
    3. Export your MS outlook calendar, contacts, notes, etc. to the new computer by saving each of these categories as a PST file (file>export>then choose the category and type of file)...and then copy these PST files to your new computer and import them into MS outlook.
    4. Copy your playlists from itunes on your old computer to your new computer. This link may be helpful or search the internet again if you need to:
    http://osx.tribe.net/thread/08fd0e5e-f1d0-450b-8de5-9f7cb5bd278d
    5. Now...the important part...how to transfer all your settings from the iphone to the new computer....this is the part that was hard to find online, but finally got it: NOTE: THE BACKUP THAT ITUNES MAKES BACKS UP THE APPLICATION SETTINGS BUT NOT THE APPS SO THIS IS WHY YOU NEED TO TRANSFER THE APPS TO THE NEW COMPUTER. The settings have all the data you put into your apps, email settings, preferences, etc...so its a huge time save to transfer these to the new computer also.
    -Sync your iphone with your old computer to have a backup in case you mess up...in that case you can restore from your old computer and start over
    -Plug your iphone into the new ocmputer and start itunes. It will detect your phone (I assume you have already authorized your new computer to use the library and playlists and apps that you moved)
    -Right click on the "iphone" on the left bar...you will see a popup menu...click on "BACKUP". Let it backup your iphone to the new computer. It will NOT sync the phone
    -When the backup is done....copy the backup file to a temp directory to be safe. The backup is located in "documents and settings">user name>applications>apple computer>mobile sync. If you cannot see it, you need to open windows explorer (not internet explorer) and go to tools>folder options>view and click on "show hidden files and folders" Note YOU CANNOT JUST COPY THE BACKUP FROM THE OLD COMPUTER TO THE NEW COMPUTER AS SUGGESTED ON SOME WEB SITES...THIS DOES NOT WORK, ITUNES WILL NOT IDENTIFY THE BACKUP EVEN IF YOU PUT IT IN THE FOLDER IN THE NEW COMPUTER THAT MIRRORS THE FOLDER LOCATION IN THE OLD COMPUTER.
    -OK now you are ready...click restore on the iphone and restore the phone to factory settings. This will happen in a few minutes (10-15 mins).
    -The phone will reboot and itunes will recognize the phone again...as a restored phone. It will then ask you if you want to restore it from the backup..say YES. You then need to go through all the itunes tabs and click on everything you want to sync to the phone (playlists, movies, podcasts, ringtones, etc). Once you are done going thru the tabs click "apply" and the sync will start. Go out, to a movie, to bed, whatever because it will take hours to sync.
    -Once the sync is done...voila...your iphone has been moved with ALL the settings to the new computer. Check it. Then you can delete the backup you put into the temp folder if it is OK
    -Deauthorize your old computer
    This worked for Win XP...should work for Vista. The whole process took many hours so don't rush through it (i'm guessing 12 hours total work).
    Can I send apple a bill for tech support?????

  • How to copy the data from one database to another database without DB link

    Good Day,
    I want to copy the data from one database to another database with out DB link but the structure is same in both.
    Thanks
    Nihar

    You could use SQL*Plus' COPY command
    http://technology.amis.nl/blog/432/little-gold-nugget-sqlplus-copy-command
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/apb.htm#sthref3702
    Edited by: Alex Nuijten on Sep 16, 2009 8:13 AM

  • How to Copy the PLD from one database to another

    Dear Members,
       i have designed the  PLD for Purchase Order, i want to copy the particular PLD into another Database.
    i tried to copy the PLD from one database to another through copy express.. i copied the PLD sucessfully. But the problem is,it copies all PLD's from one database to another. i want only the Purchaseorder PLD has to be copied in to another database.any body can help me in this regard.
    With Regards,
    G.shankar Ganesh

    Hi,
    select * into A1 from RDOC where Author !='System'
    select *  into A2  from  RITM   where Doccode  in (select Doccode from A1 )
    select * from A1
    select * from A2
    sp_generate_inserts 'A1'
    sp_generate_inserts 'A2'
    you will get Insert scripts of A1 and A2 tables .After that You 'll  Replace A1 to RDOC and A2 to RITM.
    So that you can RUN this SQL srcipts any where (In any Database)
    but First u have to run sp_generate_inserts  Storeprocedure(from websites) .
    drop table A1,A2

  • How to access the JTextfield on one panel from the button on the other pane

    Hi to all!
    I m having very simple problem about getText() and setText(). I am developing the user interface for an application. I got the JTextField on one panel and one button on other panel. When I try to do getText() and SetText() operation on the JTextField which is placed on a JPanel with the help of JButton click event Which is placed on other panel. The JTextField doesn't response. My program is not showing any compilation as well as runtime error. So how can i solve this problem?
    Note: Duke dollar for rigth answer.
    Thanks! in advance!

    I've looked at the other post and was wondering what happened to all of those It is working briliantly...
    In any event, I've taken the original code and clean it up my way as shown below:
    import java.awt.event.*;
    public class MainClass {
       public static void main(String[] args) {
          MajorFrame majorFrame = new MajorFrame();
          majorFrame.setSize(550,550);
          majorFrame.show();
          majorFrame.addWindowListener(new WindowAdapter() {
             public void windowClosing(WindowEvent e) {
                System.exit(0);
       }  //method ends
    }  //class endss
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class MajorFrame extends JFrame implements ActionListener {
       Container contentPane = getContentPane();
       Panel1 panel1 = new Panel1();
       JButton buttonMajorFrame = new JButton("Button MajorFrame");
       public MajorFrame() {
          contentPane.setLayout(null);
          contentPane.setSize(550,550);
          panel1.setBounds(5,5,400,250);
          contentPane.add(panel1);
          buttonMajorFrame.setBounds(5,350,150,20);
          buttonMajorFrame.addActionListener(this);
          contentPane.add(buttonMajorFrame);
       } //constructor ends
       public void actionPerformed(ActionEvent ev) {
          if (ev.getSource() == buttonMajorFrame) panel1.panel11.textField11.setText("majorFrame working");
       } //methode ends
    } //class endss
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class Panel1 extends JPanel {
       Panel11 panel11;
       Panel12 panel12;
       public Panel1() {
          panel11 = new Panel11();
          panel12 = new Panel12(panel11);
          setLayout(null);
          panel11.setBounds(5,5,200,50);
          add(panel11);
          panel12.setBounds(5,65,200,50);
          add(panel12);
       //end constructor
    }//end classs
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class Panel11 extends JPanel implements ActionListener {
       public JTextField textField11;
       JButton button11;
       public Panel11() {
          setLayout(null);
          textField11 = new JTextField();
          button11 = new JButton("Button 11");
          textField11.setBounds(5,5,120,20);
          add(textField11);
          button11.setBounds(5,25,120,20);
          button11.addActionListener(this);
          add(button11);
       } //constructor ends
       public void actionPerformed(ActionEvent ev) {
          if (ev.getSource() == button11) textField11.setText("Text11 working");
       } //method ends
    } //class endss
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class Panel12 extends JPanel implements ActionListener {
       JButton button12 = new JButton("Button 12");
       public Panel11 panel11;
       public Panel12(Panel11 panel11) {
          this.panel11=panel11;
          setLayout(null);
          button12.setBounds(5,5,120,20);
          button12.addActionListener(this);
          add(button12);
       }//constructor ends
       public void actionPerformed(ActionEvent ev) {
          if (ev.getSource() == button12) panel11.textField11.setText("Text12 working");
       }//method ends
    }//class endssI think this is what you're looking for and hope it saves your rear end...hehehe!
    ;o)
    V.V.

  • How to access a variable from one program to another (independent)

    Hi,
    My requirement is to use a variable(value) from one program(prog1) to another (prog2). how is it possible.
    Regards
    Arani Bhaskar

    Go for memory id .
    passing on values from one program to another program
    Program1
    EXPORT (variable) TO MEMORY ID 'LOC'.
    Program2
    IMPORT (variable) FROM MEMORY ID 'LOC'.
    LOC is the address , for more press f1 on export in abap editor.

  • How to setup the Hyperlink from one page to another page

    Hi,
    I am new to Oracle APEX. My requirement is to setup a Hyperlink from one page to another page.
    Currently I am displaying 4 columns in the report of Page 1. The report is like below,
    Survey Response Count_of_Cities City_Name
    AB Y 2 LONDON,CHICAGO
    AB N 3 DELHI,MUMBAI,CHENNAI
    AC Y 1 LONDON
    AC N 4 TOKYO,HONGKONG,BANGALORE,HYDERABAD
    But the revised requirement is I need to show the City_name in another page i.e. Page 2 when the user clicks on value of the Count_of_Cities. i.e. If the user clicks on 3, In page 2 the values should be appear like below
    DELHI
    MUMBAI
    CHENNAI
    If I click on the 4, the values in the page should be like below,
    TOKYO
    HONGKONG
    BANGALORE
    HYDERABAD
    Currently in Page 1 I am hiding the City_Name and created a Hyperlink on Count_of_Cities. When clicked on Count_of_Cities it is navigating to Page 2. But the values for City_Name are not showing properly.
    Please sugegst how I can show the City_Name values in page 2?
    Please let me know if you require any additional information.
    Please provide the solution. The requirement is urgent.
    Thanks in Advance
    Edited by: 980540 on Jan 9, 2013 3:08 AM

    I got the answer on my own.

  • How to transfer the indexes from one DB To another DB

    Hi All,
    I have one question.I have to transfer all the database object from one database to another. and I have transfer it.Now I have to create an index on that tables then how can i know on which columns that indexes were created.and How I will create it in new database. Or Is there another way to transfer that indexes from old database to new database.
    Thanx in advance.

    user13310428 wrote:
    How I will create it in new database. Or Is there another way to transfer that indexes from old database to new database.You have to use the DDL (create index/create table with index constraints/etc) commands to create indexes.
    You cannot "+transfer+" the index data like you can table data. The reason is that indexes contains the physical address of the rows indexed. These addresses are different on the new database - and thus make the index data on the old database useless. Instead, you need to re-create the indexes so that the new row addresses can be determined and used by the index.

Maybe you are looking for