Referencing repeated components from different AS file

Hi
I am having a View SatSetting.mxml and it has repeater
component which is text field.I am trying to assign the value to it
from different action script file like below code snippet
msatView:SATSetting = new SATSetting();
msatView.taxid_ti[0].text = "Testing";
where taxid_ti is the id of the textinput inside the
repeater.
I am getting null exception at line #2
I am following the steps in flex doc but still getting this
error.
Thanks in advance
K

What you need to do is pass a reference for your GUI mainline class to the constructor of your subcomponents and keep a reference to the subcomponents in the mainline. This way the main GUI object can refer to methods in the other objects and they can refer to methods in the GUI.
eg:
class GuiMain extends JFrame
    MyMenu menu;
    MyButtons buttons;
    GuiMain()
       menu = new MyMenu(this);
       buttons = new MyButtons(this);
       // the rest of the constructor
    // the rest of the class
    m.buildMenu("File");
// in separate files
class MyMenu
    GuiMain parent;
    MyMenu(GuiMain parent)
        this.parent = parent;
        // rest of constructor
    // rest of menu class
    void mnuExit()
       parent.doExit();  // ask parent to shut down
// other classes

Similar Messages

  • Trying to import from different csv files into multiple JTables

    This might seem like something that isn't commonly done, but I'll see if anyone has done this before anyways.
    I currently have a JTable (tab #1) and it successfully reads in the data from a CSV file to populate the cells. Now, I am looking into making 3 more JTables. I can tab between the four different tables, but I can't seem to figure out how to get the data to go to the correct JTable. Tab #1 = table, Tab #2 = table2, Tab #3 = table3, Tab #4 = table4.
    Thanks.
            try
                FileInputStream fileInput = new FileInputStream ("upcoming.csv");
                BufferedReader InputCSV = new BufferedReader (new InputStreamReader (fileInput));
                line = InputCSV.readLine(); //start reading into the records.
                    //Create data for the table.
                    //the row variable = starting row
                int row = 0;
                while(line != null)
                    tmp = line.split(",");
                    for (int col = 0; col < columnNames.length; ++col)
                        data[row][col] = tmp[col]; //store cells' data to the 2-dimensional array.
                    row++;
                    line = InputCSV.readLine();
                }//end of WHILE-statement.
            } //END of TRY-statement.
            catch(Exception e)
                System.out.println(e);
            }

    I have been successful in my quest to get 4 different datasets into 4 different JTables. The previous posters suggestion to use the Table model led me to this page:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/table/TableModel.html
            TableModel myData = new MyTableModel();
            JTable table = new JTable(myData);I had some very similar code in my program. I use the DefaultTableModel and the SortFilterModel before having 4 different JTables.
            DefaultTableModel model = new DefaultTableModel(data, columnNames);
            DefaultTableModel model2 = new DefaultTableModel(data2, columnNames);
            DefaultTableModel model3 = new DefaultTableModel(data3, columnNames);
            DefaultTableModel model4 = new DefaultTableModel(data4, columnNames);I use the code in the first post 4 times, and only change the filename and the data#.
    I also have some code that counts the number of lines that will be needed.
    Thanks.

  • Add 2 3D objcts from different to files to 1 file (Help!)

    I just started with photoshopping, but i have some problems.
    I'm working in 3d, and i want to put 2 different 3d models from 2 different documents (files) together in 1 document (file)
    In 2d you can grap the foto and drag it to the other document, so ps makes a new layer with that foto.
    But I can't do that in 3d.
    Can someone help me?

    Michael,
    A simple answer, in simple terms - at last! Success - I can now upload my website.
    Thank you so much for your help!
    Regards
    Simon Richards

  • Referencing utility classes from a war file

    How do you reference a utility class from a war file? I tried adding the class to the deployment plan descriptor, however I still get a ClassNotFoundException.
    Thanks,
    Will

    To use the utility classes from a war you have to place them under the web-inf/classes directory.
    webApplication(WAR directory)--->WEB-INF--> classes (put your utility classes in this directory)

  • How to append data from different import files?

    Dear experts,
    The customer is having different applications running that will output imports files BPC needs at a different time of process. Is it possible to append data which already exist in BPC from import?
    eg. BPC already has a record
    Factory1, Actual, 2008.OCT, Movement1, 30
    import file-
    Factory1, Actual, 2008.OCT, Movement1, 100
    and I need to add them up to become 130.
    Looks like regular import will only replace the original record by the new imported value. I'm still trying...
    Thanks a lot,
    Jim Hsu

    I do not think there is a way to use a standard import package to perform this action.  Typically when you are importing, you are saying this is the new value.  Not increment/decrement the value. 
    I have never had to implement a solution for a problem like this.  However, I would write a custom SSIS package that would extract the BPC data for the same dimensionality being imported and append it with the import file, then import the combined file.  Values sharing the same dimensionality in the same import file are aggregated on the actual import.
    SO your input file has 30, the export gets 100, the combined file has both and the actual value imported would be 130.
    That would be the approach I would take, but others might have more experience in different areas.

  • Copying the Components from different applications

    Hi, 
                  I have a requirement where components should be copied from 1 application to another application. I cannot use export/import commands as it will overwrite the content in the second application. I want to achieve the similar functionality for which user copies pages/cartridges within application. Is there any way to do it?
    Regards,
    Aashish U S

    I think you can extract contents from both workbench by using emgr_update cmd and merged them locally (xml files) and import the desired content to workbench by using emgr_update cmd.   The challenging part would be merging the two content (XML) files,   depending on how complex your requirements, you might be just manually find/replace or you can write a program to merge them.
    Thanks,
    Meng

  • How to call java methods from different java file.

    Hi, i create 2 files:
    CircleCalculationMethod.java
    Main.java
    In Main.java, How can i call method in CircleCalculationMethod.java ?
    Should i put everything in same folder ??
    Should i do something like "import CircleCalculationMethod.java"
    Should i do something like create a package
    Thanks
    P/S: i use Eclipse software

    As I suggested in your OTHER threads - the BEST WAY to learn, and often the fastest, is to TRY THINGS yourself.
    Just posting code you get from the internet and asking others to modify it for you won't teach you anything.
    Go through The Java Tutorials. There are trails for ALL of the basic functionality that include working, sample code.
    This is the trail on 'Packages':
    Lesson: Packages (The Java™ Tutorials > Learning the Java Language)
    And this is the one on 'Classes and Objects'. This trail includes sections for methods and how to define and use them.
    Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)

  • Grouplayout link size of components from different jpanels

    Hi,
    i have a gui in which i has 5 panels (layed out from top to bottom in one column, using grouplayout).
    now inside each of the panels it looks like this (they use grouplayout as well):
    label 1          component
    labelexample 2     componenthowever, the labels arent always the same size, e.g. the labels in panel 3 are 50% longer than the ones in panel 5
    so all in all it looks like this:
    label 1            component
    labelexample 2      component
    label 1                    component
    labelexample_takesmorespace 2      component
    label 1 component
    label 2 componentI'd really like all the labels be the same size, so that the components all start at the same line. ive tried layout.linksize in the main frame, but this doesnt work, since the jlabels arent in a group in the main frame layout :( ( --> an exception is being thrown)
    is there a way to do this? Any help apprechiated :)
    Edited by: kaori_chan on Jul 21, 2010 7:43 AM

    If the preferred sizes (strictly speaking, preferred widths) of all the "component" components in your layout are the same, it should be fairly trivial using a GridBagLayout with appropriate weightx and fill constraints.
    db

  • How to make one movie from different imovie files?

    I have 12 imovie files that I am trying to put together as one movie with 12 chapter markers.
    How do I do that?
    Thanks.

    ...import all 12 movies in it and mark the chapters...
    very hard to imagine a less space consuming way...
    you can drop the movies directly into iDVD…
    you get a videoDVD with 2x6 (I wouldn't place 12 chapters on a single menu) "chapters"...

  • Trouble referencing instance name from different frame

    Newbie here. All my code is in frame 1 and is working fine except for one onRelease event. In frame 20 (labeled "gameOver") there is a button which has an instance name of btnQuit. I want that button to do something onRelease. The code works fine if I put it inside the button like so: on (release) {......etc. But I would like to have all my code in frame 1 in a timeline called "scripts".
    I think I'm missing something to reference the button's instance name (maybe a "_root", or "this", or some of those things that I don't fully understand).
    Here's the code that works when put in frame 20 inside the button, but not in frame 1 in a different timeline:
    btnQuit.onRelease = function () {
      // Calculate elapsed time
      var now = new Date()
      var elapsedTime = now - startTime; // startTime set beforehand
      var strTime:String = Math.floor(elapsedTime / (1000 * 60 * 60)) + ":" +
       (Math.floor(elapsedTime / (1000 * 60)) % 60) + ":" +
       (Math.floor(elapsedTime / (1000)) % 60);
      // Send data to PHP
      dataOut = new LoadVars();
      if ( finalScore > 89 ) {
        dataOut.passed = '1';
      } else {
        dataOut.passed = '0';
      dataOut.score = finalScore;
      dataOut.time_spent = strTime;
      dataOut.send("lesson.php","_self","POST");

    The button has to be in the presence of the code when the code is executed.  So you either need to have that button in frame 1 or have that code in frame 20.  You could have it in frame 1 and turn it invisible until frame 20 if that is an option.

  • JLayerPane draws random components from different layers.

    Hello,
    I am running the latest version of JAVA 1.6 on Mac OS X. I am using JLayerPane and I have three panels where. The problem is that when application starts it draws JTextFields from the third layer, but they don't work. When I go to the last panel (the third) one, I just let's say open my Skype it draws JButton's from the second layer and judging from working effects they do work. Any ideas what's wrong?
    David

    For more help create a [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://sscce.org], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Updating Swing components from a different class

    I would like to use the JTextArea component in a JFrame to display fast updating text from my application. My application is very simple. When the app launches the GUI is created then my application engine would start processing and displaying text data into the GUI. After reading about Thread safety when using Swing components I concluded it would not be a good idea for my app engine class to update the JTextArea class directly using methods such as .append(String).
    I would be grateful for any suggestions on how I should approach updating Swing components from different classes.
    Many Thanks in advance Sean

    Hi
    Why don't you just implement a basic callback method?
    To do this the right way you should probably define a simple Interface that has a public method like updateProcessText(String s). Your swing class then implements this interface, basically forcing it to provide the public method you defined (this is no different than implementing ActionListener, which forces you to define actionPerformed). Secondly modify your processing class, so that it take's a class that implements the interface you just created, as one of the arguments in it's constructor. Lastly assign the argument from your construnctor to a private var - this will enable your processing class to have a handle to your swing class and update it as it pleases.
    This might sound very complex, but it's really simple once you've done it once.

  • Comapre 2 same channels from two different dat filea

    Hi ,
    I want to compare the wave forms of two same channels names (in my sample data which is in attachment, the same channel names are S1KNSLLE00H3DSZP) from different dat  file(S2100044 and S2100041) .
    Load the 2 dat files from navigator.
    Come to report and open two 2d axis systems to see the wave forms of two different channels ( Like in attachment result.jpg)
    I need an autosequence to do the same for all the channels for 2 dat files automatically.
    Attachments:
    cmp.zip ‏1967 KB
    result.JPG ‏158 KB

    Hi RSH,
    I appreciate you posting 2 data files and the jpg, but I'm afraid I still have lots of questions before I can advise you.  You sent 2 *.dat files which each had 1 channel in them named "Data", which is different from your email text and the jpg you posted.  Will your data sets typically have many channels in them?  Your posted *.dat files had no time channel and the "Data" channel was not a waveform channel, yet the 2 different "Data" channels were different lengths.  Do you want to plot your channels vs. the array index all the time (as is shown in your jpg)?
    Do you want to have N sheets in REPORT, one for each channel?  Why don't you want to have both "S1KNSLLE00H3DSZP" channels as curves with different colors on the same graph-- wouldn't that make it easier to compare them?
    When you drag over the data channel onto a REPORT graph, you will get a reference like "[1]/Data" or "[2]/Data", which is exactly what you want to compare the "Data" channel from 2 arbitrary data files (note that the file name does not show up in the channel references).  So it seems to me that the REPORT layout you sent a jpg of already satisfies what you're asking us to create for you.  Why do you need a script at all?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Aggregator seems to randomize quize questions from various project files

    I am using Captivate 5.5.
    I created 10 quizzes, each in its own captivate project.  Each project has its own quiz ID and the question slides are randomized using one pool.   'when I publish each captivate project file, the quzi (swf file) the questions are fine.   
    However, when I aggregate all 10 files into an aggregate project, I get quiz questions from different project files...and the title slide doesn't even match the master slide for that quiz!  For example, after aggregating the project file, my Ch 2 quiz would contain question slides from various chapters...and the
    the title slide doesn't even match the chapter for that question.

    When you use Question Pools, the SWF files for the pools are external to the SWF.  The filenames for the question pools are taken from whatever you called the pool, with the letters _CQP on the end.
    When you use Aggregator, all of the SWF files for each aggregated project file are placed in the same folder.  Each project is not kept isolated in it's own folder.
    So if any of your question pools happen to have the same name, they may overwrite one another when Aggregator compiles them into the same folder.
    Go back into your projects and make sure you first give each published project file a unique name.  Then append the name of each question pool with some extra letters that differentiate it from a similar pool in any of the other projects.  Then republish everything again and build another Aggregated version from scratch.  See if that resolves the issue.

  • Loading UI components from config file

    Hi,
    I wanted to know your opinion about a project that i'm working on.
    The inicial idea of the project is to have a config file (file.ini) with a syntax similar to this one:
    [Component1]
    type = sevenseg
    width = 200
    height = 50
    numberOfDigits = 5
    foregroundColor = green
    backgroundColor = grey
    [Component2]
    type = button
    width = 50
    height = 20
    command = GETLED 3
    [Window]
    width = 500
    height = 300The application needs to read the file when it starts and after that, it needs to build the interface based in the config file. I think this is the easy part.
    The most difficult part is that i also want the application polling a webserver for data in order to refresh the values displayed in the components and also, when there is some input action (clicking a button, changing a slider, etc) i want to send it to the server.
    The problem is that I'm not imagining a way of linking the various components that will be in the UI while using this config file.
    Do you have any ideas or do you think this can be done?
    The purpose of reading the "UI" from the config file was to reduce the writing of code, since this application will be used by people with little skills in programming.
    And in the future, it could be possible of creating an application to create all the UIs needed in a way similar to netbeans and swing based UI.
    Thanks for your attention.
    João Gonçalves
    PS: If this isn't possible, I'm also considering the possibility of creating a netbeans plugin to design the UI. Here I don't avoid the coding problem, but i can reduce it a bit.

    Well, I'm going to try to explain it a bit better.
    The application that i'm going to do is the interface and it's going to be done in javafx, (obviously).
    The application will be the user interface of a remote device that will be located somewhere in a LAN. The webserver is located in the middle, between the client (UI) and the device, and is the webserver that it's going to make the bridge between the client and the device.
    The architecture will be something like this:
    Client <------> WebServer <------> device
    The idea of the project is to make it possible to use a large number of devices, all different. So the UI that is going to control each device will need to be customized in order to look similar to the control panel of the device and to permit the user to interact with this one like if he was in front of it.
    The reason of my question is because it was asked to me if it was possible to create a config file and load the UI components and layout from the file, to avoid dealing with the code, since the persons who are going to configure the devices are not software developers and don't know too much about java and programming.
    This is why i made this post, to know the opinion of people more experienced than I in programming, and above all, in javafx.

Maybe you are looking for

  • How can i access the internet using a non-wireless...

    Before upgrading my BT broadband to BT Infinity, I was able to connect my two desktop PC's to the BTHUB2 without a problem. One of them is running Windows 7 and has a wireless connection, the other is running Windows XP and does not have a wireless a

  • Fiscal Year Variant for non calendar year

    Dear Experts, The fiscal year for my client is as follows:      Start Date     -      End Date Month 1     -      21-Mar     -      20-Apr Month 2     -      21-Apr     -      21-May Month 3     -      22-May     -      21-Jun Month 4     -      22-J

  • Laptop connects to iPhone 4s personal hotspot but internet doesn't work

    I want to be able to use internet on my PC laptop (or any wi-fi capable device) with my 4S as the wi-fi hotspot. The laptop I'm using (Windows XP) sees my phone and connects to it (with full connectivity) but web pages won't load (there doesn't seem

  • Acrobat 7 Pro - How to disable prompt for filename?

    I have a Windows XP Pro SP3 system with Office 2003 Pro and Visio 2002 Pro installed. I have an Access database that creates Visio 2002 files within the application. Within the Access database, i have the ability to print a single or multiple visio f

  • Sh.it lo cant update 4.3.5 ==

    sh.it lo now all ppl also cant update 4.3.5~haizzzz~all said got problem me also dun wan update lo T.T