How to get array values from one class to another

Supposing i have:
- a class for the main()
- another for the superclass
And i want to create a subclass that does some function on an array object of the the superclass, how can i do so from this new subclass while keeping the original element values?
Note: The values in the array are randomly generated integers, and it is this which is causing my mind in failing to comprehend a solution.
Any ideas?

If the array is declared as protected or public in the superclass you can directly access it using its identifier. If not, maybe the superclass can expose the array via some getter method.
If this functionality can be generified (or is generic enough) to apply to all subclasses of the superclass the method should be moved to the superclass to avoid having to reproduce it in all the subclasses.

Similar Messages

  • How to get a value from one item into another

    How can i get value from one item into another item.
    Ex: I have a report, in there i have check boxes, and when i have checked some rows, and press submitt, a prosses computates it into a item on another page, and a branche redirects to page 3. Then i'm going to use the value in the item into a PL/SQL script in an report to show the submittet items.
    How can i do this?
    Computation script, pages and all that is fixed. But i dont know which PL/SQL statement to use to get th value from the item.

    Hi Fredr1k,
    Use the V() function from pl/sql.
    e.g. V('P3_MY_ITEM')
    will return the value of that page item.
    As long as the pl/sql is called from within the Apex environment.

  • How to get attribute values from one view to another

    HI all,
    Thx in Advance..
    I have 2 view like v1,v2.In v1 i used one attribute values from "get single attribute" method.And i need the same values in v2 screen.For this i did in v1 outbound plugs , i mentioned the parameter name . How can i get the same values in  v2.

    Hi chandru ,
    you said you declare the parameters in the Outbound Plug of V1.  now go to view V2 inbound plug Tab and creat one inbound plug
    double click on the plug name .it will navigate you to the event handeler method . Now add the outbound parameter variables in the
    For example : V1firing the navigation plug
    a type string " defined in parameter
        a =      'ABCD'                           " string
    you can retrive the value freely in v2 inbound event handeler
    a type string " defined in parameter
    *   set single attribute
          name =  `TEXT`
          value =  a )." here you will get the 'ABCD'.
    Chinnaiya P
    Edited by: chinnaiya pandiyan on Jun 23, 2010 7:12 PM

  • How to get a values from one form to another form

    Hi All,
    I am using oracle forms 10g.
    I have created two forms. First form named as Hotel reservation req and second form named as Hotel Res Summary.
    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.
    I have written a query in when button pressed Like this
    type r_cursor is ref cursor;
    c_XXMBHIS r_cursor;
    V_xxmbht XXMB_DOMHTRS_REQ%rowtype;
    open c_xxmbhis for select * from XXMB_DOMHTRS_REQ where requisition_number=:Global.V_REQ_NO
    fetch c_xxmbhis into v_xxmbht;
    exit when c_xxmbhis%notfound;
    --dbms_output.put_line (V_XXMBHT.REQUISITION_NUMBER);
    end loop;
    close c_XXMBHIS;
    And how to refer this to the calling form.
    But now the form is opening and record is not querying can any one correct me where i went wrong.
    Thanks & Regards
    Edited by: Srikkanth.M on Aug 19, 2011 6:43 PM

    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.If more than 1/4 of your Forms will need the REQUISITION_NUMBER then using a GLOBAL variable makes scense. However, if it is only your Hotel Reservation and Hotel Res Summary forms that will use the REQUISITION_NUMBER then use a Parameter List instead. Global variables are always of type CHAR so you could encounter conversion errors if you don't explicitly cast the value to the correct data type. Parameter object can be of type CHAR, NUMBER and DATE and offer greater flexibility. If you need an example of how to use a parameter list, open the Forms Help system, go to the Search tab and search on "Creating a Parameter List." This article give a brief overview and a list of all the built-ins associated with Parameter Lists. You will need to create a Parameter object in your Hotel Req Summary form to catch the parameter passed via the Parameter List. Then you will need to write code to do something with the value passed (usually in the When-New-Form-Instance trigger).

  • How we can get the values  from one screen to another screen?

    hi guru's.
         how we can get the values  from one screen to another screen?
              we get values where cusor is placed but in my requirement i want to get to field values from one screen to another screen.

    Just think of dynpros as windows into the global memory of your program... so if you want the value of a field on dynpro 1234 to appear on dynpro 2345, then just pop the value into a global variable (i.e. one defined in your top include), and you will be able to see it in your second dynpro (assuming you make the field formats etc the same on both screens!).

  • How to pass a variable from one class to another class?

    Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
    class A {
      int a;
      int doA() {
          a = a + 1;
          return a;
    class B {
      int b;
      A r = new A();
      r.a;  // error: <identifier> expected. What does that mean ?
      int doB() {
         int c = b/a;  // error: operator / cannot be applied to a
    }Thank you!

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • How to get Array values from context

    In my jsp page, I have a group of checkboxes, named "checkbox" and each of them has a different value.
    <input type=checkbox name=checkbox value=1>
    <input type=checkbox name=checkbox value=2>
    After I submit the form, I need to get the checkbox's values from next page's control file, which is a Java file. In the Java file, I use "" class,
    String cbString = (String)context.getNodeList().get("checkbox");
    but I can only get the value of the first checkbox.
    I have tried context.getValue("checkbox", 0), context.getValue("checkbox", 1), context.getValue("checkbox", 2), but all I got is "null".
    I beleive the context has the value of the checkbox array. But how to get them out? Thanks a lot!

    You can download MAM application here
    Source code is in
    Also here is my view file, which may provide some clue:
    <?xml version="1.0" encoding="UTF-8"?>
    <view screen="/zjsp/zpm_enh_quickPassConf/zQuickPassConf.jsp" controller="">
        <event name="onLoad">
           <forward name="error" component="error" view="ErrorDetail"/>
           <forward name="callback" component="zpm_enh_649" view="zPmEnh649Main" />
        <event name="onGoEnh649">
         <forward name="default" component="zpm_enh_649" view="zPmEnh649Main" />
        <forward name="callback" component="zpm_enh_650" view="zPmEnh650Main"/>
        <event name="onGoProcessRec">
         <forward name="default" component="zpm_enh_649" view="zPmEnh649Main" />
        <forward name="callback" component="zpm_enh_650" view="zPmEnh650Main"/>

  • How to get selected value from one choice list

    Hi All,
    i want to get selected value in onechoice to achive this

    check these

  • How to send a variable from one class to another?

    i have "", which is the document class for one.swf.
    i also have "two.swf", with "Two.swf" entered as its document
    One loads two into it. two is basically a 10 frame movieClip
    with a variable at the beginning called "var endFrame:Boolean =
    false", then on the last frame it says endFrame = true.
    my question: how in the world do I communicate this back to i've tried ENTER_FRAME listeners, declaring the variable
    here and there... and many other embarrassingly usuccessful
    i would just like to load in "three.swf" after two.swf
    finishes... but One needs to know that it has indeed finished.
    your help would be greatly appreciated. thanks

    > David,
    > thank you for responding.
    Sure thing! :)
    > so does what you are saying mean that endFrame is a
    property of
    > two (the movieClip), or Two (the Class)?
    If you've written a property named endFrame for your Two
    class, then
    yes, Two.endFrame is a property of that class.
    Looking back at your original post, I see that you wrote
    > One loads two into it. two is basically a 10 frame
    > with a variable at the beginning called "var
    endFrame:Boolean = false",
    > then on the last frame it says endFrame = true.
    So it sounds like your Two class extends MovieClip. (I'm not
    that's true, but that's what it sounds like.) That means your
    Two class
    supports all the features of the MovieClip class, including a
    play() method,
    a currentFrame property, and so on. In addition, you've added
    functionality that amounts to -- by the sound of it -- a
    property named
    endFrame. If you made your property public (i.e., public var
    then it should be accessible by way of an object reference to
    your Two
    > so can i invoke that method in do I call it
    Two.endFrame (if
    > (Two.endFrame == true) {?
    Methods are things an object can *do,* such as
    gotoAndPlay(). What
    you're describing is a property (a characteristic ... in this
    case, a
    Boolean characteristic). You wouldn't use the expression
    unless that property was static. Static classes are those
    that cannot have
    an instance made of them. Think of the Math class. It
    contains numerous
    static properties in the form of constants, such as Math.PI,
    Math.SQRT2, and so on. You can't create an instance of the
    Math class -- it
    wouldn't make sense to -- so Math is a static class.
    On the other hand, you definitely create instances of the
    class. Every movie clip symbol is an instance of MovieClip
    class, which
    means that each instance carries its own unique values for
    MovieClip class
    members. The MovieClip class defines x and y properties, but
    each movie
    clip symbol (that is, each instance of the MovieClip class)
    configures its
    own values of those properties, depending on where each
    instance is located
    on the Stage.
    Assuming your Two class is not static, then somewhere along
    the line,
    your One class will have to make an instance of it. Somethine
    like ...
    // inside your One class ...
    var myTwo:Two = new Two();
    ... at which point that myTwo variable because a reference to
    particular instance of Two. You can invoke Two methods on
    that instance.
    You can invoke Two properties and events on that instance.
    You can invoke
    whatever functionality is defined by the Two class on that
    myTwo instance.
    If Two extends MovieClip, that means you can also invoke any
    MovieClip class
    member on that myTwo instance.
    At some point in your One class, you can refer to that myTwo
    later and check if the value of myTwo.endFrame is true or
    David Stiller
    Adobe Community Expert
    Dev blog,
    "Luck is the residue of good design."

  • How to pass the values from one screen to another

    consider me21n,
    po is created with the item category L,so components tab is enabled.that u all know.
    i have added the custom tab in the item details with netwt,gross wt,no of pieces and one more field.
    those fields are also in component structure of material data.
    i need to pass the matnr,maktx,quantity,ntwt,grosswt from the component to be displayed in  the subscreen.
    i used import mdpm to xmdpm from memory id 'subcon',  where it is exported from the function module 'me_components-maintain'.
    how to pass  all the values from component of structure MDPM to the subscreen of custom tab in the item details.
    help me pls........................'

    hi everyone,
    MODULE status_0111 OUTPUT.
    data : fill type i.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.,
      DESCRIBE TABLE lt_zzmm_po_comp LINES fill.
      ctrl_0111-lines = fill.
    ENDMODULE.                 " STATUS_0111  OUTPUT
    MODULE fetch_data OUTPUT.
      ctrl_0111-lines = 2.
    import xmdpm to lt_xmdpm from memory id 'SUBCON'.
    IF not sy-subrc eq 0.
        CLEAR lt_zzmm_po_comp[].
        LOOP AT lt_xmdpm.
          MOVE-CORRESPONDING lt_xmdpm TO lt_zzmm_po_comp.
          APPEND lt_zzmm_po_comp.
    MOVE-CORRESPONDING lt_zzmm_po_comp TO ctrl_0111.
      read table ctrl_0111-cols into col where index = 3.
    ENDMODULE.                 " FETCH_DATA  OUTPUT
    MODULE pass_line OUTPUT.
      READ TABLE lt_zzmm_po_comp INDEX ctrl_0111-current_line.
      MOVE-CORRESPONDING lt_zzmm_po_comp TO ctrl_0111.
    ENDMODULE.                 " PASS_LINE  OUTPUT
    flow logic
    MODULE status_0111.
    loop at lt_zzmm_po_comp WITH CONTROL ctrl_0111 cursor
       module pass_line.
    *module read_data.
    but i cant see my fields in the table control .....i dont know y it is  not coming?can anyone help me with code...

  • How to transfer variable value from one query to another query?

    I create two queries which contain the same variable "Year" and "Month".
    In the wad,Query1 is used to be a table and Query2 is used to show the chart in the condition with the same variable value of Query1
    So I want to transfer the variable  value from query1 to query2.
    Can anyone help me ?

    Let me explain the issue in detail.
    In Query Designer, both the year and  month variables are defined by user exit function to read current year and month and can be modified  during the query runtime.
    In WAD, Query1 is  used  to be a table with a table interface to hyperlink a chart which is defined by Query2 with the same variable value of Query1.
    During the runtime of template, if I change the variable value of Query1 , I want the variable of Query2 to be changed automatically with the same new value.
    So in the table interface of Query1 , I write the ABAP code in "SE24" and related source code to the variable is following:
    'function fire_urlJGSP_Col(filter) {'
    'chart_url="' url '" + "&CMD=LDOC'
    '&TEMPLATE_ID=GCCHART_9' "WEB ID of the work book
    '&PAGEID=Graphics'       "Name of the view
    into l_coding.
    In this way , I can only transfer the year variable value from Query1 to Query2 and not two variables .
    So , how  shall I do to transer the two variable value in the same?

  • How can I pass values from one node to another

    Give a standard and efficient way to pass values from child to parent

    hai Prathap
    You can use the custom event  for passing values from child to parent

  • How to get the value from one Popup lov column to another popup lov column

    I am new to oracle apex development and having the below issue.
    In my application, there is a tabular form with 15 columns ( c1.. c15).
    I have to populate the value of column C5 based on the selected(from popup lov) value of column C3, tried to use onchange, but didn't help much.
    Any help please.
    Thanks and Regards,

    Oh boy, this is a fun one.
    onchange should work theoretically (in this example, assume that f05 is the target column that should be set and "this" is the source item whose value is to be transferred to f05 on the same row (row 2)):
    BUT the catch is of course that needs to be different for every row (can't hardcode the '2'), so you need something to dynamically create the row number component.
    I wrote this for an app I'm working on that uses master-detail forms heavily (I also wrote a lot more code to read the fmap array that is in v4 so that I can reference my cells via their column name and not the numeric position (so "f05 can be determined w/o hard coding), insulating against columns moving around, columns being made display-only etc. but I won't bore you with that here unless you really need to know).
    function getRow(pObj)
    { //Pass in an object reference to a tabular form cell and get back an integer
      //derived from the object ID.
      if (isNaN(vRow))
        return (null);
      return (parseInt(vRow,10));
    function formatRow(pRow)
    { //Pass in an integer and it'll be returned as the tabular form cell ID suffix
      //(e.g.: pass in 1 and get back string "_0001").
      //Used in building ID references to tabular form cells.
      if((isThingEmpty(pRow)) || (isNaN(pRow)))
      var vRow=pRow.toString();
    So in essence, pass in "this" which will be a reference to the current item, largely to determine what row we're on. getRow will return 1, 2, 3, etc. formatRow will take that and return 0001, 0002, 0003, etc. Once that is done, it'll concatenate with the f05 and f04 to refer to the correct columns (determining f05, f04, etc. dynamically is another matter if you really need to but I didn't want to complicate this answer too much at once).
    Note: above I also use a isThingEmpty() function that I wrote. It does nothing other than check the item for an empty string, if the item is null, etc. Just do your own evaluation of empty-string, no-value, etc. there.
    It would indeed be nice though if Apex had a better way to delclaratively access the tabular form items though. Despite all the v4 enhancements, tabular forms were not entirely upgraded to the same full functionality of page items.

  • How can i get the values from one JSP to another JSP

    Hi All,
    I am very new to JSP technology, I have one jsp having radio button, i want to accecc the state of this radio button to another JSP page, How can i do this.
    Could anybody help me.
    with Regards

    Try page import <%@ page import ="index.jsp" %> or include <%@include file="index.jsp" %> methods perhaps they might work.

  • How to copy a value from one Frame to another Frame.

    I am new to Swing and AWT prgramming .
    I have created a menu called " Test window " and it contains toplevel menu item "File" and File Menu contains subitems "Product Evaluation", "ProcessEvaluation", "ResourceEvalation", "TotalEvaluation" and "Exit".
    When i click File->Product Evaluation it displays a new Frame named frame1 , similarly if i click ProcessEvaluation , ResourceEvalation , TotalEvalation it displays frame 2 , frame 3 and frame 4 Respectively,
    frame 1 , frame 2, frame 3 contains four textfields with names t1,t2,t3 and t4.(NOTE: I have given same names for textfields in all three frames so that in future i want to extend my GUI).
    frame 4 contains 4 textfields with names t5,t6,t7,t8 and 4 buttons (b1,b2,b3,b4).
    After i compile my program i will select ProductEvaluation and enter some values in textfield of frame 1 and minimise it. Similary i will open ProcessEvaluation and TotalEvaluation and enter values in textfields of frame2 and frame3 and minimise them.
    My queston is now if i select TotalEvaluation and press Button1 in frame 4 it should display in textfield t5 the value extracted from t1 in frame1 added to the value extracted from t1 in frame 2 added to the value extracted from t1 in frame 3.
    ie after pressing Button 1 textfield t5 should conatin value of t1 in frame1+ value of t1 in frame2 + value of t1 in frame3.
    I am sending the code.
    Can you please help me.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Component;
    // Make a main window with a top-level menu: File
    public class MainWindow extends Frame {
        public MainWindow() {
            super("Test Window");
            setSize(500, 500);
            // make a top level File menu
            FileMenu fileMenu = new FileMenu(this);
            // make a menu bar for this frame
            // and add top level menus File and Menu
            MenuBar mb = new MenuBar();
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
        public void exit() {
            setVisible(false); // hide the Frame
            dispose(); // tell windowing system to free resources
            System.exit(0); // exit
        public static void main(String args[]) {
            w = new MainWindow();
        private static MainWindow w ;
        protected TextField t1, t2, t3, t4,t5,t6,t7,t8;
        // Encapsulate the look and behavior of the File menu
        class FileMenu extends Menu implements ActionListener {
            private MainWindow mw; // who owns us?
            private MenuItem itmPE   = new MenuItem("ProductEvaluation");
            private MenuItem itmPRE   = new MenuItem("ProcessEvaluation");
            private MenuItem itmRE   = new MenuItem("ResourceEvaluation");
            private MenuItem itmTE   = new MenuItem("TotalEvaluation");
            private MenuItem itmExit = new MenuItem("Exit");
            public FileMenu(MainWindow main) {
       = main;
            // respond to the Exit menu choice
            public void actionPerformed(ActionEvent e) {
                if (e.getSource() == this.itmPE) {
                   final Frame frame1 = new Frame("Frame1");
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    t3 = new TextField("");
                    t3.setBounds(430, 230, 50, 24);
                    t4 = new TextField("");
                    t4.setBounds(530, 230, 50, 24);
                    frame1.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                if (e.getSource() == this.itmPRE) {
                  final  Frame frame2 = new Frame("Frame2");
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    t3 = new TextField("");
                    t3.setBounds(430, 230, 50, 24);
                    t4 = new TextField("");
                    t4.setBounds(530, 230, 50, 24);
                    frame2.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
               if (e.getSource() == this.itmRE) {
                 final   Frame frame3 = new Frame("Frame3");
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    t3 = new TextField("");
                    t3.setBounds(430, 230, 50, 24);
                    t4 = new TextField("");
                    t4.setBounds(530, 230, 50, 24);
                    frame3.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                if (e.getSource() == this.itmTE) {
                  final  Frame frame4 = new Frame("Frame4");
                    t5 = new TextField("");
                    t5.setBounds(170, 230, 50, 24);
                    t6 = new TextField("");
                    t6.setBounds(270, 230, 50, 24);
                    t7 = new TextField("");
                    t7.setBounds(370, 230, 50, 24);
                    t8 = new TextField("");
                    t8.setBounds(470, 230, 50, 24);
                    ActionListener action = new MyActionListener(frame4, t5, t6, t7, t8);
                    Button b1  = new Button("Button1");
                    b1.setBounds(170, 400, 120, 24);
                    Button b2  = new Button("Button2");
                    b2.setBounds(300, 400, 120, 24);
                    Button b3  = new Button("Button3");
                    b3.setBounds(420, 400, 120, 24);
                    Button b4  = new Button("Button4");
                    b4.setBounds(550, 400, 120, 24);
                    frame4.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                else {
          class MyActionListener implements ActionListener {
                private Frame frame4;
                private TextField t5;
                private TextField t6;
                private TextField t7;
                private TextField t8;
                public MyActionListener(Frame frame4,TextField tf5, TextField tf6, TextField tf7, TextField tf8)
                    this.frame4 = frame4;
                    this.t5 = tf5;
                    this.t6 = tf6;
                    this.t7 = tf7;
                    this.t8 = tf8;
                public void actionPerformed(ActionEvent e) {
                    String s = e.getActionCommand();
                    if (s.equals("Button1")) {
             // I think code for the Button1 action can be written here  

    u have ot submit the values using
    b1 for f1,
    b1 for f2 and
    b1 forf3
    after u can access the values in to f4 other wise u con't
    what u have to do use method in each frame like
    setValueforframe1() { } and 2 and 3
    and u can call this method in frame 4 and u can get the values

Maybe you are looking for

  • 404 Error when opening Web Analysis

    I have just finished setting up a System 9 test environment (my first environment), which includes Reporting and Analysis System 9 release Unfortunately, I'm having trouble getting Web Analysis to open. When I go to the URL (http://localh

  • Multiple DV tapes into one DVD

    I'm trying to transfer two DV tapes from my Sony handycam into one DVD double layer using iDVD. Everytime the first DV tape has finished transfering and the DVD has finished burning, the DVD is ejecting. When I try to transfer the second DV tape, I h

  • [bug-report] AI CC for Mac got "loading plugin error" at startup

    Enviornment: 2012 late Mac Mini, OSX 10.8.6( English ) Just fresh installed adobe illustrator cc for Mac(Simplified Chinese), which is got "loading plugin error" at startup, even update AI or reinstall it after using adobe cc clean tool. Finally I fo

  • How do we create Dynamic Breadcrumbs

    Hi All, I have 10 tabs, a->b->d....->j. which is having two master pages like 1->2->a->b->........->j I have to go to 5th tab from two different pages, How can I create breadcrumbs dynamically? it should show like this 1->2->abc(new page)->5th tab Pl

  • After installing iTunes 11.0.4 sync  hangs

    I have re-installed iTunes 11.0.4 cleanly (removed all Apple software from Windows 7 system and cold booted). Since the original install of 11.0.4 I have not been able to synch my iPad 2. iTunes hangs just after it starts the second step, Backup iPad