Re: How to get value among subclasses
- From: fzl2007 <fzl20@xxxxxxxxx>
- Date: Sat, 11 Apr 2009 19:43:26 -0700 (PDT)
On Apr 11, 3:50 pm, Mark Space <marksp...@xxxxxxxxxxxxxx> wrote:
fzl2007 wrote:
I have four classes that are extended from the same superclass. Each
class need to be able to get the value (rssdid) that the other class
set. How do I do that? I have tried to use the getter and setter. It
Unfortunately as Tom said things just don't work that way.
In Java, this is possible by using a static variable in the super class.
However, while the theory maybe the same in ActionScript, I have no
idea how to do it.
package fubar;
public class SharedValues
{
public static void main( String[] args )
{
Base1 b1 = new Base1();
b1.setMessage( "The message" );
Base2 b2 = new Base2();
System.out.println( b2.getMessage() );
}
}
class Super
{
protected static String message;
public void setMessage( String message )
{
this.message = message;
}
public String getMessage()
{
return message;
}
}
class Base1 extends Super
{
}
class Base2 extends Super
{
}
Please forgive my ignorance about classes and objects. I have come
from a non object background and now have to continue a project that
was created and left by an OO person. I have tried to gather my
thoughts and summarized the problem and presented it here in hope to
get some help. I obviously have demonstrated more confusion than
anything. Perhaps let me try one more time ...
I am using four viewHelpers (they are classes that extends from the
same super class which is a subclass of another superclass and etc,
designed by this OO person) to retrieve data for four datagrids on a
tab object, each datagrid sits on a tab, a total of four datagrids/
tabs. Every time when a row on a datagrid (of a tab) is clicked, it
will need to pick up the customer ID and retrieve data for the same
customer on the other three datagrids/tabs. My problem is, I don't
know how to store the customer id when the row is clicked so that I
can retrieve the data for the other three tabs for the same customer
id.
Thank you for your time. I appreciate it.
Faye
.
- Follow-Ups:
- Re: How to get value among subclasses
- From: Mark Space
- Re: How to get value among subclasses
- References:
- How to get value among subclasses
- From: fzl2007
- Re: How to get value among subclasses
- From: Mark Space
- How to get value among subclasses
- Prev by Date: Re: Change logging level for Logger.throwing
- Next by Date: Re: How to get value among subclasses
- Previous by thread: Re: How to get value among subclasses
- Next by thread: Re: How to get value among subclasses
- Index(es):
Relevant Pages
|