Constructor functions must be instance methods?

Hi,
I have this code as in the following:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.controls.*;           
            import mx.events.*;
            import mx.containers.*;       
            import thematicMap.*;  
             public var Region:Region = new Region();
             public var Scale:Scale = new Scale();
             public var ThematicMap:ThematicMap = new ThematicMap(); //1026:Constructor functions must be instance methods
             public var ReadXML:ReadXML = new ReadXML();       
             private var savedIndex:int= 99999;        
              public function addNavigation():void{
                  var buttonTools:Array = ["Driving Distance","Education Level--College",
                                           "Education Level--High School","Median Income","Population"];
                  var navigationBar:ToggleButtonBar = new ToggleButtonBar();
                      navigationBar.dataProvider = buttonTools;
                      navigationBar.toggleOnClick = true;
                      navigationBar.selectedIndex = -1;
                      navigationBar.addEventListener(ItemClickEvent.ITEM_CLICK,clickHandler);                      
                      //pass the variables?
                      addSlider(); //add the slider control  
                      vbox.addChild(navigationBar);
              public function addSlider():void{
                   var text_entry:HBox = new HBox();                 
                   var numColors:TextInput = new TextInput();
                       numColors.length == 3;
                       numColors.text = "5";
                       numColors.restrict = "0-9";
                   var direction:Text= new Text();
                       direction.text = "Number of Colors";
                    //recalculate the map if the listener is called
                   text_entry.addChild(direction);
                   text_entry.addChild(numColors);
                   vbox.addChild(text_entry);                    
             public function clickHandler(event:ItemClickEvent):void{
                 if(event.index == savedIndex) {
                     //don't do a thing
                 else savedIndex = event.index;           
                 //add the thematic map                
                 ThematicMap.addRegions(OK); //This part never worked
                 //mapGrid.addChild(thematicmap);
        ]]>
    </mx:Script>
   <mx:Canvas id="map" creationComplete="addNavigation()">
           <mx:VBox id="vbox" x="20" y="10">           
           <mx:Canvas id="mapGrid"/>      
    </mx:VBox>     
   </mx:Canvas>
</mx:Application>
Here is what I have in my ThematicMap.as:
package thematicMap
    import mx.core.*;
    import mx.events.*;
    public class ThematicMap {       
        public var region:Region = new Region();  
        public var readXML:ReadXML = new ReadXML();     
        public function addRegions(name:String):void {   
             trace(name);      
Have I done something wrong here? How come it keeps telling me that the constructor functions must be instance methods?
Thanks for your help.
Alice

Yes, I put in the quotes, and that took care of that error.
However, it still tells me I have an error that I am calling a possibly undefined method addRegions through a reference with static type ThematicMap
Here is the complete code of my main app:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.controls.*;           
            import mx.events.*;
            import mx.containers.*;       
            import thematicMap.*;   //I had imported all the classes
             public var region:Region = new Region();
             public var scale:Scale = new Scale();
             public var thematicMaps:ThematicMap = new ThematicMap();
             public var readXML:ReadXML = new ReadXML();       
             private var savedIndex:int= 99999;        
              public function addNavigation():void{
                  var buttonTools:Array = ["Driving Distance","Education Level--College",  "Education Level--High School","Median Income","Population"];
                  var navigationBar:ToggleButtonBar = new ToggleButtonBar();
                      navigationBar.dataProvider = buttonTools;
                      navigationBar.toggleOnClick = true;
                      navigationBar.selectedIndex = -1;
                      navigationBar.addEventListener(ItemClickEvent.ITEM_CLICK,clickHandler);                      
                      //pass the variables?
                      addSlider(); //add the slider control  
                      vbox.addChild(navigationBar);
              public function addSlider():void{
                   var text_entry:HBox = new HBox();                 
                   var numColors:TextInput = new TextInput();
                       numColors.length == 3;
                       numColors.text = "5";
                       numColors.restrict = "0-9";
                   var direction:Text= new Text();
                       direction.text = "Number of Colors";
                    //recalculate the map if the listener is called
                   text_entry.addChild(direction);
                   text_entry.addChild(numColors);
                   vbox.addChild(text_entry);                    
             public function clickHandler(event:ItemClickEvent):void{
                 if(event.index == savedIndex) {
                     //don't do a thing
                 else savedIndex = event.index;           
                 //add the thematic map                
                 thematicMaps.addRegions("OK");
                 //mapGrid.addChild(thematicmap);
        ]]>
    </mx:Script>
   <mx:Canvas id="map" creationComplete="addNavigation()">
           <mx:VBox id="vbox" x="20" y="10">           
           <mx:Canvas id="mapGrid"/>      
    </mx:VBox>     
   </mx:Canvas>
</mx:Application>
As a matter of fact, when I write import thematicMap. it looks like thematicMap.ThematicMap does show up, so that is imported, right?
I am getting confused.
Alice

Similar Messages

  • Error: 1026: Constructor functions must be instance methods.

    I am follwoing a tutorial on linda.com about creating a website in Flash
    everything was going well until i started trying to copy the action script in the online examples
    now I keep getting this error message and can't figure out how to get rid of it:
    1026: Constructor functions must be instance methods.
    any assistance wouold be much appreciated, thank you
    here is the action script I am using for my buttons:
    stop();
    tv.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
    gotoAndStop("tv");

    I'm sorry, I am still not following what you are saying
    here is what I have in the actions layer, frame 1
    stop();
    tv.addEventListener(MouseEvent.CLICK, clickSection);
    anim.addEventListener(MouseEvent.CLICK, clickSection);
    ads.addEventListener(MouseEvent.CLICK, clickSection);
    photo.addEventListener(MouseEvent.CLICK, clickSection);
    film.addEventListener(MouseEvent.CLICK, clickSection);
    home.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
    trace ("The "+evtObj.target.name+" button was clicked!")
    gotoAndStop(evtObj.target.name);
    I am trying to link markers on the actions time line: tv, anim, ads, photo, film and home
    with layers (web pages) on the time line below...

  • Constructor function must be instance method Error

    Hi I m got puzzled that How this error happen, Last time I finish the project all modules was working properly, but today I open file and render then I wounder the all base classes of Linkage object is missing and if i give them(flash.dispaly.MovieClip) manually then it dosen't show any error and it dosen't accept. When I delete the class of any linkage object then It accept base class of linkage object. How can I solve the Problem.???

    Hi,
    I clicked that option under the "Flash" tab and the same curt error message appeared.
    I'll try to answer your question on how I put together the file.
    The file contains static art, static text and a movie clip that runs through twice.  All that functions fine.
    **Perhaps I need to change the name in various locations relate to the button and the actions.  Here's what I did next:
    I then added a layer and called it "invisibleBtn"
    Drew a rectangle and converted it to a symbol and called it "invisibleBtn" - I also labeled it "invisibleBtn" in the window under the "Properties" tab when you click the rectangle in Scene 1 (can't remember what that box is called)
    I added another layer and called it "ActionScript"
    I called up the Actions-Frame window and added this code:
    invsibleBtn.addEventListener(MouseEvent.CLICK,onClick);
    function onClick(event:MouseEvent):void {
    navigateToURL(new URLRequest ("http://www.fcnmarketingsolutions.com"));
    I hope this is what you were asking for in your message.
    Thanks.

  • Error: 1026 "Constructor Functions must be instanst methods".  Why?

    I am being told that this error takes place on Line 3, which is blank. I can not figure out what the problem could possibly be. Any help would be greatly appreciated.
    package {
    import flash.display.*;
    public class toppings extends MovieClip {
      var inventory:Sweettreat;
      function toppings() {
       inventory = new Sweettreat(this);
       inventory.makeSweettreatItems([MCsprinkles,MCchocolate,MCcaramel,MCnuts,MCcherry]);

    The above is the code from the as file.
    Here is the corresponding flash code:
    cone_or_bowl.addEventListener(MouseEvent.MOUSE_DOWN, coneorbowlchoice);
    function coneorbowlchoice(event:MouseEvent):void {
        gotoAndStop(6);
    scoops.addEventListener(MouseEvent.MOUSE_DOWN, scoopschoice);
    function scoopschoice(event:MouseEvent):void {
        gotoAndStop(8);
    flavors.addEventListener(MouseEvent.MOUSE_DOWN, flavorchoice);
    function flavorchoice(event:MouseEvent):void {
        gotoAndStop(10);
    toppings.addEventListener(MouseEvent.MOUSE_DOWN, toppingchoice);
    function toppingchoice(event:MouseEvent):void {
        gotoAndStop(12);

  • "constructor functions must be" error

    i have this code snippet that i originally got from the snippet library, but i'm applying it to a new document. i made a square and converted it to a symbol, then gave an instance name of myMovieClip. i put this actionscript code in the first frame with it:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keymoving);
    function keymoving(event:KeyboardEvent):void
              switch (event.keyCode)
                        case Keyboard.UP:
                                  myMovieClip.y -=5;
                                  break;
                        case Keyboard.DOWN:
                                  myMovieClip.y +=5;
                                  break;
    case Keyboard.LEFT:
                                  myMovieClip.x -=5;
                                  break;
    case Keyboard.RIGHT:
                                  myMovieClip.x +=5;
                                  break;
    and now i get this error: Constructor functions must be instance methods

    thanks for confirming this for me. i thought it was suspicious too.
    so i made a new document and paid closer attention to how i'm setting up my actionscript code. i think in the first example i had inserted it into the wrong place which made it go haywire. now i have it working.

  • Singleton Class using a constructor not a get Instance method ?

    Hi,
    I have a class with a couple of contructors, the class is instantiated many times in the application.
    Is there any way by which I can return a single instance of the class when the contructor is called ?.
    I dont want to declare a get instance method to return a single instance is it somehow possible to do this in the contructor itself.
    This is done so I dont have to refactor the whole application and change all the places where this class is instantiated.
    Example
    XXXClass xxx = new XXXClass();
    every time new XXXClass() is called the single instance of the class must be returned.
    I dont want to implement
    XXXClass xxx = XXXClass.getInstance();
    Thanks in advance
    Rgds
    Pradeep Thomas

    Pradeep ,
    You see a constructor does not return anything
    when you tell java
    String str = new String();
    It is into the reference str that a Object of the type String is assigned and used ..
    If you want a single instance to exist in your application ..the best way is to use the singelton approach.
    Alternatively you could create one static instance of the object in a parent class and all the classes that inherit from it will then share access .

  • Why sap.ui.view is just a method & not a constructor function ?

    Hey,
    Every control in UI5 is defined as a Constructor Function, but why is sap.ui.view which is also a control just defined as a method !! Any reasons behind it?
    Thanks & Regards
    Sakthivel

    sorry, the 'would you mind' wasn't meant to sound
    snotty! its amazing how bad forums can be for getting
    feeling across. I meant to say something like 'oh
    hell, I can't see how to do this. I don't suppose you
    happen to have an example lying around the place, do
    you?'
    I'll give it a go...I sounded a bit harsh perhaps. Sorry.
    I only saw someone give an answer and a couple of minutes later a follow-up asking for "example code", which lead me to believe you did not do any research/googling on what was suggested. I now read your original post and saw that you already knew of the AffineTransform class.
    Anyway, when I want to see some classes "in action" I always go to http://www.exampledepot.com . It also has some snippets on how to use the AffineTransform class:
    http://www.google.com/custom?domains=exampledepot.com&q=AffineTransform&sa=Google+Search&sitesearch=exampledepot.com&client=pub-6001183370374757&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en
    Good luck.

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • How to call a instance method without creating the instance of a class

    class ...EXCH_PRD_VERT_NN_MODEL definition
    public section.
      methods CONSTRUCTOR
        importing
          value(I_ALV_RECORDS) type ..../EXCH_VBEL_TT_ALV
          value(I_HEADER) type EDIDC .
      methods QUERY
        importing
          I_IDEX type FLAG
          i_..........
        returning
          value(R_RESULTS) type .../EXCH_VBEL_TT_ALV .
    Both methods are instance methods.
    But in my program i cannot created instance of the class unless i get the results from Query.
    I proposed that Query must be static, and once we get results we can create object of the class by pasing the result table which we get from method query.
    But i must not change the method Query to a static method.
    Is there any way out other than making method Query as static ?
    Regards.

    You can't execute any instance method without creating instance of the class.
    In your scenario, if you don't want to process your method of your class, you can check the instance has been created or not.
    Like:
    IF IT_QUERY IS NOT INITIAL.
      CRATE OBJECT O_QUERY EXPORTING......
    ENDIF.
    IF O_QUERY IS NOT INITIAL.
    CALL METHOD O_QUERY->QUERY EXPORTING....
    ENDIF.
    Regards,
    Naimesh Patel

  • Should I use a static method or an instance method?

    Just a simple function to look at a HashMap and tell how many non-null entries.
    This will be common code that will run on a multi-threaded weblogic app server and potentially serve many apps running at once.
    Does this have to be an instance method? Or is it perfectly fine to use a static method?
    public static int countNonNullEntries(HashMap hm){
    if(hm==null)return 0;
    int count=0;
    for(int i=0; i<hm.size(); i++) {
    if(hm.get(i)!=null)
    { count++;}
    return count;
    OR
    public int countNonNullEntries(HashMap hm){
    if(hm==null)return 0;
    int count=0;
    for(int i=0; i<hm.size(); i++) {
    if(hm.get(i)!=null)
    { count++;}
    return count;
    }

    TPD Opitz-Consulting com wrote:
    The question is the other way around: Is there a good reason to make the method static?
    Ususally the answer is: no.The question is: does this method need state? Yes -> method of a class with that state. No -> static.
    The good thing of having this method statig is that it meight decrese memory foot pring but unless you're facing memory related problem you should not think about that.I doubt there is any difference between the memory foot print of a static or not method.
    I'm not shure if this method beeing static maks problems in multithreaded environments like the one you're aiming at. But I do know that an immutable object is always thread save.Does the method use shared state (data)? No -> no multi threaded problems.
    Can the parameters be modified by different threads? Yes, if multiple threads modified the parameter map, but nothing you can do about it here (no way to force the calling thread to lock on whatever you lock on).
    So my answer to your question is: yes, it should be non static.The method should be static since it uses no state.
    It is thread-safe when only the calling thread can modify the passed map (using a synchronized or ConcurrentHashMap is not enough, since you don't call a single atomic method on the map).
    // Better use Map instead of HashMap
    // We don't care about the generic type, but that does not mean we should use a raw type
    public static int countNonNullEntries(Map<?, ?> map) {
      // whether to accept null map or not, no need for explicit exception
      // since next statement throw NPE anyway
      Collection<?> values = map.values();
      // note your method is called countNonNull, not countNull!
      // (original code it would need to by if(null != mapValue) notNullsCounter++;
      return values.size() - java.util.Collections.frequency(values, null);
    }

  • Type's constructor function is called as many times as there are attributes

    The constructor method for object types is being called multiple times by SQL when using the constructor in an SQL insert statement. For example, if I create an object type called TEST_O, and an object table TEST_OT based on type TEST_O, and then insert into TEST_OT using the constructor:
    INSERT INTO TEST_OT VALUES ( TEST_O( TEST_ID_SEQ.nextval, 'Test', USER, SYSDATE ) );
    The contructor is actually called 5 times by SQL. Here's a sample type, table, type body, and anonymous PL/SQL procedure that reproduces this error:
    create type TEST_O as object (
    test_o.tps
    by Donald Bales on 3/1/2007
    Type TEST_O's specification:
    A type for debugging object type problems
    test_id number,
    test varchar2(30),
    insert_user varchar2(30),
    insert_date date,
    -- Get the next primary key value
    STATIC FUNCTION get_id
    return number,
    -- A NULL values constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o)
    return self as result,
    -- A convenience constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    aiv_test in varchar2)
    return self as result,
    -- Override the defaul constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    test_id in number,
    test in varchar2,
    insert_user in varchar2,
    insert_date in date)
    return self as result,
    -- Write to the debug object table
    STATIC PROCEDURE set_test(
    aiv_test in varchar2),
    -- A map function
    MAP MEMBER FUNCTION to_map
    return number
    ) not final;
    grant all on TEST_O to PUBLIC;
    ========================
    create table TEST_OT of TEST_O
    tablespace USERS pctfree 0
    storage (initial 1M next 1M pctincrease 0);
    alter table TEST_OT add
    constraint TEST_OT_PK
    primary key (
    test_id )
    using index
    tablespace USERS pctfree 0
    storage (initial 1M next 1M pctincrease 0);
    drop sequence TEST_ID_SEQ;
    create sequence TEST_ID_SEQ
    start with 1 order;
    analyze table TEST_OT estimate statistics;
    grant all on TEST_OT to PUBLIC;
    ============================
    create or replace type body TEST_O as
    test_o.tpb
    by Donald Bales on 3/1/2007
    Type TEST_O's implementation
    A type for logging test information
    STATIC FUNCTION get_id
    return number is
    n_test_id number;
    begin
    select TEST_ID_SEQ.nextval
    into n_test_id
    from SYS.DUAL;
    return n_test_id;
    end get_id;
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(zero param)');
    self.test_id := NULL;
    self.test := NULL;
    self.insert_user := NULL;
    self.insert_date := NULL;
    return;
    end test_o;
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    aiv_test in varchar2)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(one param)');
    self.test_id := TEST_O.get_id();
    self.test := aiv_test;
    self.insert_user := USER;
    self.insert_date := SYSDATE;
    return;
    end test_o;
    -- Override the default constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    test_id in number,
    test in varchar2,
    insert_user in varchar2,
    insert_date in date)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(four params)');
    self.test_id := test_id;
    self.test := test;
    self.insert_user := insert_user;
    self.insert_date := insert_date;
    return;
    end test_o;
    STATIC PROCEDURE set_test(
    aiv_test in varchar2) is
    begin
    insert into TEST_OT values ( TEST_O(aiv_test) );
    end set_test;
    MAP MEMBER FUNCTION to_map
    return number is
    begin
    return test_id;
    end to_map;
    end;
    ====================
    begin
    TEST_O.set_test('Before loop');
    for i in 1..10 loop
    TEST_O.set_test('Testing loop '||to_char(i));
    end loop;
    TEST_O.set_test('After loop');
    commit;
    end;
    ==========================
    Which produces the following output:
    SQL> @test_o
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    PL/SQL procedure successfully completed.
    SQL> select * from test_ot order by 1;
    TEST_ID TEST INSERT_USER INSERT_DATE
    2 Before loop SCOTT 20070301 173715
    7 Testing loop 1 SCOTT 20070301 173715
    12 Testing loop 2 SCOTT 20070301 173715
    17 Testing loop 3 SCOTT 20070301 173715
    22 Testing loop 4 SCOTT 20070301 173715
    27 Testing loop 5 SCOTT 20070301 173715
    32 Testing loop 6 SCOTT 20070301 173715
    37 Testing loop 7 SCOTT 20070301 173715
    42 Testing loop 8 SCOTT 20070301 173715
    47 Testing loop 9 SCOTT 20070301 173715
    52 Testing loop 10 SCOTT 20070301 173715
    57 After loop SCOTT 20070301 173715
    12 rows selected.
    Is it possible to get an Oracle employee to look into this problem?
    Sincerely,
    Don Bales

    Here some sample JavaScript code that might help you resolve the issue.
    var curPageNum = xfa.host.currentPage + 1; // this is index
    // based starts with 0
    if (curPageNum == 1) {
    // run your current script here then it will run only one
    //time on page 1

  • How to call Instance Methods and set property values in BAPI?

    In Project systems, for the three business objects viz.
    Network, ProjectDefinition and WBS, there are two kinds of methods which are available : class methods and instance methods. We have tried calling some instance methods, for instance, BAPI_PROJECTDEF_GETDETAIL to get details pertaining to a project. While importing this BAPI, it shows two elements for mapping i.e. Current Internal Project(string) and Current External Project(string). We supplied these values for an existing project. Upon running this call through an XML client at our end, it
    returned an error "Module Unknown Exception". This general message is present on every instance method thus far. Upon searching in BAPI Explorer for Project System->ProjectDefinition->GetDetail, we found that this BAPI didn't take any input parameter.
    Following message was displayed in BAPI Exlorer for this BAPI:
    "... Obligatory import parameters are the external and internal keys CURRENTEXTERNALPROJE and CURRENTINTERNALPROJE of the project definition.The system reads parameters contained in the structure
    BAPI_PROJECT_DEFINITION_EX ..."
    i) How to supply the values of Obligatory import parameters.
    ii) What are the possible causes of this exception.
    iii) How to call an instance method. We are using same mechanism for calling class as well as instance methods so far, we have been to call only class level methods successfully. Is there anything special that we
    need to do to call instance methods.

    Hi,
    what version is the SAP PS running?  If WebAs or higher,  create an inbound synch interface containing your two parameters in the request structure and as many as you require in your response structure.  Generate an Inbound ABAP proxy, where you can plug in some code, i.e. create and instantiate an object of the required type and make the call to the BAPI.
    If SAP PS on lower than WebAs, then create a wrapper function module and make it RFC enabled.  Then plug your code in here and do the same thing.
    Watch out for commits!
    Cheers,
    Mark

  • Flash Builder - RDS - LCDS - 1020: Method marked override must override another method

    I'm using RDS data modeller, the RDS fml file is working okay,
    I can work with the tables, use services
    but when I try to run the application I get prolems, and the problem states:
    Description
    Resource
    Path
    Location
    Type
    1020: Method marked override must override another method.
    _CityEntityMetadata.as
    /xoffer/src/xoffer
    line 219
    Flex Problem
    This issue extract is: for example: _CityEntityMetadata.as
        override public function getPropertyType(propertyName:String):String
            if (model_internal::allProperties.indexOf(propertyName) == -1)
                throw new Error(propertyName + " is not a property of City");
            return model_internal::propertyTypeMap[propertyName];
    this for some tables
    how does this present, I didn't do sth special, followed the how to online, already reinstalled the whole thing (flash builder 4.5.1, modeller 3.1.1)
    workflow:
    -> created in MySQL the Database
    -> used the RDS config (this works)
    -> generate the code and push to the server
    -> make a datagrid and link it to a service
    -> play => errors get detected
    ps when I delete the override it is ok, but I don't think this should be the case....

    I'm also experiencing this problem.  It's a real pain in the neck to have to do extended search / replace on certain method signatures to remove the override.
    Anyone have a solution?
    Thanks in advance!

  • Difference between function module and a method?

    Hi Experts
    Can anybody pls tell me the technical and functional difference between function moduel and a method?
    Thanks
    Sudhansu

    Hi,
    Function modules are procedures that are defined in function groups (special ABAP programs with type F) and can be called from any ABAP program. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
    Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library. The R/3 System contains a wide range of predefined function modules that you can call from any ABAP program. Function modules also play an important role in database updates and in remote communications between R/3 Systems or between an R/3 System and a non-SAP system.
    You can declare methods in the declaration part of a class or in an interface. To declare instance methods, use the following statement:
    METHODS <meth> IMPORTING.. [VALUE(]<ii>[)] TYPE type [OPTIONAL]..
                   EXPORTING.. [VALUE(]<ei>[)] TYPE type [OPTIONAL]..
                   CHANGING.. [VALUE(]<ci>[)] TYPE type [OPTIONAL]..
                   RETURNING VALUE(<r>)
                   EXCEPTIONS.. <ei>..
    When you declare a method, you also define its parameter interface using the additions IMPORTING, EXPORTING, CHANGING, and RETURNING. The additions define the input, output, and input/output parameters, and the return code. They also define the attributes of the interface parameters, namely whether a parameter is to be passed by reference or value (VALUE), its type (TYPE), and whether it is optional (OPTIONAL, DEFAULT).
    Unlike in function modules, the default way of passing a parameter in a method is by reference.
    As in function modules, you can use exception parameters (EXCEPTIONS) to allow the user to react to error situations when the method is executed.
    As in function modules, you can use the RAISE <exception> and MESSAGE RAISING statements to handle error situations.
    Regards,
    Sruthi

  • If a function must return an object,but if it throw something,then ?

    if a function must return an object,but if it throw something,then it same that it do not need to return any thing.
    public ActionForward execute(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws java.lang.Exception {
              LogonForm logonForm = (LogonForm) form;
              throw new UnsupportedOperationException("Easy Struts :");
    when I compile it ,it is good,why CAN it do not return the class ActionForward.
    and I see UnsupportedOperationException is alse an object,but it do not means that it is an instance or subclass of class ActionForward

    Hello! The way I see your program :
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,HttpServletRequest request,
    HttpServletResponse response)
    throws java.lang.Exception {
    LogonForm logonForm = (LogonForm) form;
    throw new UnsupportedOperationException("Easy Struts :");
    it will never be able to return ActionForward and it will always throw an UnsupportedOperationException(), since you are actually throwing it. Not unless you put it in a
    try {
    LogonForm logonForm = (LogonForm) form;
    do processing here .. etc.. etc..
    }catch (Exception e) {
    throw new UnsupportedOperationException("etc.. etc..");
    Hope it helps.
    Regards,
    Ronron

Maybe you are looking for

  • Integration between Purchase Requisition  & external web services

    Hi We have a requirement to Integrate  Purchase Requisition Process in MM & external web services(Portal).So we wanted to know what are the third party tools that SAP supports inorder to integrate both the systems.The requirement is like a business u

  • .jpg.jpg When exporting & other issues

    I guess something changed in iPhoto 08. It used to be when I imported from my camera, I would change the name of a photo from 1213231.jpg to cat.jpg. Then when I exported to a folder on my Mac it would export cat.jpg. Now if I rename and I export it,

  • HttpsURLConnection URL connection issue

    Hi All, I need to create URL connection with HTTPS URL. I can run Main java class successfully in machine which hosted in SAP Java server, but fail to run integrate it with e-commence application. When depployed in to SAP Java server cannot open Http

  • Share Batch Processing Sequences?

    I have created some Acrobat Pro 9 Batch Processing sequences that I would like to share with others on my team. Is there a way for me to export or copy the sequence and give it to others? I am on a Mac.

  • IPad mini 3 home key clicking noise

    I've had my iPad mini 3 for about 6 weeks now and I've just noticed that they home key has started to make a clicking noise before I even press on it. Is this a fault or just the way it's made? My original iPad mini never had this problem! regards Sa