Extending class gives unexpected behaviour

Hello forumusers
I am making my own table model by extending DefaultTableModel. When calling insertRow(int, Object[]) in my own code, super.insertRow calls insertRow(int, Vector) in my code instead of in the superclass. I didn't think that the superclass would hold any reference to my class and when the superclass calls insertRow(int, Vector) it would be a method in the DefaultTableModel class.
Please see the code below. Can anyone explain this behaviour to me?
import java.awt.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
class TableModelTest {
  public TableModelTest() {
    BundleTableModel m = new BundleTableModel(
        new String[][]{{"aaa", "aab", "aba"}, {"ccc", "cca", "cac"}},
        new String [] {"header0", "header1", "header2"});
    m.insertRow(1, new String[]{"BBB", "BBA", "BAB"});
  public static void main(String[] args) {
    TableModelTest dut = new TableModelTest();
  public class BundleTableModel extends DefaultTableModel {
    public BundleTableModel(String[][] dataIds, String[] columnNameIds) {
      super();
      setColumnCount(columnNameIds.length);
      setRowCount(dataIds.length);
      // My own code comes here
    public void insertRow(int row, Object[] rowData) {
      System.out.println("insertRow(int, Object[] called");
      super.insertRow(row, rowData);
      // My own code comes here
    public void insertRow(int row, Vector rowData) {
      System.out.println("insertRow(int, Vector) called");
      super.insertRow(row, rowData);
      // My own code comes here
}

Lesson learned.
ejp was correct from the beginning.
JLS section 8.4.10.6 'Large Example of Overriding' explains:
"The critical point about overriding in this example is that the method putstr, which is declared in class BufferOutput, invokes the putchar method defined by the *current object this*, which is not necessarily the putchar method declared in class BufferOutput.
This allows a subclass of BufferOutput to change the behavior of the putstr method without redefining it."
Thanks for all comments.

Similar Messages

  • Can't get extended class to work with asbstract class

    I am having trouble working an extended class to work with my base abstract class. I keep getting this error message: "Fiction.java:4: invalid method declaration; return type required" public FictionBook()" Can someone give me some advice and or guidance on what I need to do? Thanks.
    Here is my abstract class:
    import javax.swing.*;
    public abstract class Book
         protected String bookTitle;
         protected double bookPrice;
         public abstract double setPrice();
    public Book()
              setBookPrice();
    public double getBookPrice()
              return bookPrice;
    public abstract void setBookPrice();
    Here is the extended class that I have:
    import javax.swing.*;
    public class Fiction extends Book
         public Fiction()
              super();
              setBookPrice();
         public void setBookPrice();
              bookPrice = 24.95;
         public String toString()
              return("Fiction Book Price is $" + bookPrice);
    }

    Fiction.java:2: Fiction is not abstract and does not override abstract method setPrice() in BookThis one is pretty straightfoward: Book declares an abstract setPrice() method. In effect is promises "every concrete subclass of Book will define an implementation of setPrice()". But your Fiction class does not do this - it does not give an implementation of setPrice() even though as a Book it is required to do so. That is what the compiler is complaining about.
    Fiction.java:6: call to super must be first statement in constructorThis one is slightly cryptic. If you use super() it must be as the first line of a constructor. You are using it as the first line of Fiction() so that looks OK - until you realise that Fiction() is not a constructor! That's because you declare it as a method returning void. Remove the "void" and the compiler will recognise it as a constructor and will be happy about your use of super().
    Edited by: pbrockway2 on Sep 13, 2008 12:13 PM
    Just a general point: it might be worth writing very brief comments for your abstract class to say what the methods are supposed to do. It isn't really clear what setBookPrice() is supposed to do given that it isn't passed any argument. Likewise setPrice(), how does it differ from setBookPrice()? what is the double value that it returns?

  • Can not filter the data with the extended class

    Hi,
    I have a quick question about PortableObject format. I have created a class which extends PortableObject interface and implemented serializer methods as well. I have updated it in the pof-config.xml file as well. If I insert the objects of this type of object in the cache, they get inserted properly and I can filter the values based on the getters defined in the class. Everything works fine here.
    Now, I am trying to extend the existing class that I have. We have our custom API which we have built for our domain objects. I need to store these objects in the cache. So, naturally I need to implement PortableObject interface to do that. So, instead of creating a new class with new set of getters and setters and local fields, I am extending our domain class to create a new class which implements PortableObject interface. Instead of defining the local fields and getters and setters i am reusing the ones provided by my existing class. Now, I can insert the objects of the new class to the cache. But I can not filter the values for the objects of this new class.
    Let me show you what exactly I am trying to achieve by giving a small example:
    Domain Class:
    class Person
    private String person_name;
    *public String getPerson_name() {return person_name;}*
    *public String setPerson_name(person_name) {this.person_name = person_name;}*
    The new class implementing PortableObject interface:
    class ExtPerson extends Person implements PortableObject
    public static final PERSON_NAME = 0;
    *public void readExternal(PofReader reader) throws IOException{*
    setPerson_name(reader.readString(PERSON_NAME));
    *public void writeExternal(PofWriter writer) throws IOException{*
    writer.writeString(PERSON_NAME, getPerson_name());
    *// And HashCode, Equals and ToString methods, all implemented using the getter from the Person class*
    So, if I create a new class ExtPerson without extending the Person class and write all the methods, store the objects in the cache and perform the following query, I get the size printed
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","ABC"))).size());
    But if I use the extended class and insert the values into the cache and if I use the same query to filter, I get 0 printed on the console.
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","ABC"))).size());
    So, can anyone tell what exactly is causing this?
    Thanks!

    Well, just a quick question. It seems that I can not get ContainsAnyFilter or ContainsAllFilter working.
    EqualsFilter is actually working properly.
    I am preparing a Set of Strings and passing it to ContainsAnyFilter or ContainsAllFilter and it is returning me 0 records.
    E.g.:
    Set<String> setStr = new HashSet<String>();
    setStr.add("ABC");
    setStr.add("DEF");
    System.out.println((cache2.entrySet(new ContainsAnyFilter("getPerson_name", setStr))).size());
    I get 0 in my output
    If I try this:
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","ABC"))).size());
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","DEF"))).size());
    I get 1 for each of the query.
    If I club all these EqualsFilter in a Filter[] array and create an AnyFilter or AllFilter and pass it to the query, it works fine.
    List<Object> lst = new ArrayList<Object>();
              lst.add("ABC");
              lst.add("DEF");
    Filter[] filter = new Filter[lst.size()];
         for(int i=0;i<lst.size();i++)
              filter[i] = new EqualsFilter("getPerson_name",lst.get(i).toString());
    AnyFilter fil = new AnyFilter(filter);
    System.out.println((cache4.entrySet(fil)).size());
    I get the desired result here, which is 2.
    Am I missing something here?

  • Unexpected behaviour upon pressing the 'Enter' key on dialog screen

    Hi.
    I have two dialog screens that exhibit unexpected behaviour when i pressed the 'Enter' key.
    Screen 1: When I pressed the 'Enter' key, the focus shifted to another input field and the content of the previous input field is cleared. The thing is, I did not have any codes in PAI for 'Enter'. Why is this happening?
    Screen 2: On load, some of the fields on this screen will be disabled. However, when I pressed the 'Enter' key, all the disabled fields become enabled. Again, I did not have any codes that handle the 'Enter' key in PAI. Why is this happening?
    Any help is appreciated.

    Hi Atish.
    Yes, I have used CHAIN... END CHAIN.
    I thought that CHAIN... END CHAIN allows my input fields to be re-activated after an error message is displayed.
    How would CHAIN... END CHAIN cause the unexpected behaviour?
    Thanks.

  • 'My Application Page' is not allowed here because it does not extend class 'System.Web.UI.Page'

    I have a custom SharePoint 2010 solution that includes an aspx page. The aspx page in is in the /layouts folder within the solution and I created it by just adding an application page to the solution. I am trying to create a parent-child relationship between
    two different lists in SharePoint. From the parent I have a custom button on the ribbon that creates a child item with the ID of the parent stamped on it.
    The page is just a processing page that forwards on parameters from the parent to the new child item. (i.e. the ID value)
    The code generated when I add the aspx page is below:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="MY.Solution.Layouts.MY.Solution.processingpage" MasterPageFile="~/_layouts/application.master" %>
    <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    </asp:Content>
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    </asp:Content>
    <asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server"> Processing Page </asp:Content>
    <asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" > Processing Page </asp:Content>
    The code behind is as follows:
    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Administration;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.Utilities;
    using System.Reflection;
    namespace MY.Solution.Layouts.MY.Solution
    public partial class processingpage : LayoutsPageBase
    protected void Page_Load(object sender, EventArgs e)
    try
    //Get a reference to the SPWeb object
    SPWeb oWeb = SPContext.Current.Web;
    //Use the Parameters That Are Passed In
    SPList thisList = oWeb.Lists[new Guid(Request.QueryString["List"])];
    SPListItem thisItem = thisList.GetItemById(int.Parse(Request.QueryString["ID"]));
    sContentType = thisItem["ContentType"].ToString();
    sContentTypeID = thisItem.ContentTypeId.ToString();
    if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAIID = thisItem["ID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/Blist" + "/NewForm.aspx?AIID=" + sAIAuditID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAIID = thisItem["AIID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/AList" + "/NewForm.aspx?AIID=" + sAIID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAICID = thisItem["AICID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/CList" + "/NewForm.aspx?AICID=" + sAICID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else
    LoggingService.LogError("MY.Solution - Processing Page", "No Applicable Content Type Found.");
    catch (Exception ex)
    LoggingService.LogError("My.Solution - Processing Page", ex.Message);
    finally
    //DO SOME FINAL THINGS HERE WHEN REQUIRED.
    In the page I need to use Request.QueryString to get the values from the URL. But when I deploy the solution and load the page I get the error:
    'MY.Solution.Layouts.MY.Solution.processingpage' is not allowed here because it does not extend class 'System.Web.UI.Page'.
    When I change the line:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="MY.Solution.Layouts.MY.Solution.processingpage" MasterPageFile="~/_layouts/application.master" %>
    to inherit as follows:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" MasterPageFile="~/_layouts/application.master" %>
    it does not work either.
    If I change it to inherit like below:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="System.Web.UI.Page" MasterPageFile="~/_layouts/application.master" %>
    it also does not work.
    What does this error actually mean?  And why doesn't the default code generated by Visual Studio work?

    @NadeemYousuf I have tried this too and it didn't work.  
    What does the error even mean?  And why does the error appear with default Visual Studio code?  In my example I have just added a basic application page with no other code in it and it still does not work.

  • NoClassDefFoundError extending class in separate JAR

    I have a class Foo which gets called from my servlet (extends HttpServlet) class. Both Foo and the servlet class are located in WEB-INF/classes and are deployed as part of the war file. Class Foo extends class Bar, which is a different .jar file located in the /WEB-INF/lib directory of the webapp. When I attempt to create an instance of Foo, I get the following exception:
    java.lang.NoClassDefFoundError: /general/client/common/beans/Bar
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1267)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at server.DBServlet.createFoo(DBServlet.java:236)
         at server.DBServlet.processInput(DBServlet.java:333)
         at server.DBServlet.doGet(DBServlet.java:154)
         at server.DBServlet.doPost(DBServlet.java:205)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:419)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    I'm running this on Windows, and found if I added the classpath the the jar file where the Bar class is located, that it worked fine. But my expectation is that the jar file should have been found because it is in the /WEB-INF/lib dir. There is a line the Tomcat docs that says:
    "Last, any JAR containing servlet API classes will be ignored by the classloader. All other class loaders in Tomcat 5 follow the usual delegation pattern."
    So maybe I need to do something special to load the Bar class, or there's something strange about the way the classes and jars are being loaded that I don't fully understand. I was able to instantiate the Bar class directly from w/in my servlet class, I just can't create an instance of the Foo class that is in /WEB-INF/classes along with the servlet class. So I'm not convinced that the Bar class or associated jar file isn't being loaded.
    I don't want to have to set the classpath explicitly, so I'm looking for advice on why I'm getting this exception and how best to dynamically load the classes I need.
    Thanks.
    ab.

    Thanks for hanging in there so far. Here's the specifics if you want to try to re-create this.
    I have a webapp, which contains the class DBServlet:
    package com.hm.dhca.server;
    public class DBServlet extends HttpServlet
    // Stuff
         public void processInput()
              Foo foo = new Foo();
    The webapp also contains the class Foo:
    package com.hm.dhca.common;
    import com.general.client.common.beans.Bar;
    public class Foo extends Bar
         public Foo()
              super();
              System.out.println("Foo");
    Both of the classes are located in webapps\DHCA\WEB-INF\classes...
    The Bar class is in a separate jar called HMJCommon.jar in the webapps\DHCA\WEB-INF\lib dir.
    Class Bar looks like this:
    package com.general.client.common.beans;
    public class Bar
         public Bar()
              System.out.println("Bar");
    DBServlet creates an instance of Foo as:      
    Foo foo = new Foo();
    Which throws the Exception:
    java.lang.NoClassDefFoundError: com/general/client/common/beans/Bar
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1267)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at com.hm.dhca.server.DBServlet.processInput(DBServlet.java:236)
         at com.hm.dhca.server.DBServlet.doGet(DBServlet.java:154)
         at com.hm.dhca.server.DBServlet.doPost(DBServlet.java:205)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:419)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Clues:
    1. All three classes exist in the locations specified above - I have checked this manually.
    2. Within DBServlet, I can create an instance of Bar. But I cannot create an instance of Foo without the exception.
    3. If I move the Foo class from package com.hm.dhca.common to package com.hm.dhca.server (same package as DBSerlvet), everything works fine.
    4. If I modify Tomcat's classpath to include the HMJCommon.jar, it works fine (as previously discussed).
    Theory:
    I have a vague theory that what is happening is that two different webappclassloaders are loading the Foo and Bar classes, for whatever reason. As a result, they can't see each other, because neither is up the hierarchy tree from the other.
    This does not explain how I can instantiate Bar from DBServlet, but not Foo.
    Hope this helps. I think I've corrected previous mistake w/ removing too much from package naming. I'm resorting to the workaround in clue #3 for the moment. But it's not the correct solution, and it's showing that I don't really understand what's going on here.

  • Extending classes at runtime

    Hi,
    Is there a way to extend a class at runtime? What I'd like to do is the following:
    I want to have a tabbed pane component that does not stretch its tabs when there are several lines of tabs. The stretching of the tabs is implemented in the UI component of JTabbedPane - and this depends on the look & feel - it can be MetalTabbedPaneUI, WindowsTabbedPaneUI, etc.
    I want to extend the currently-used UI class (which is only known at runtime) with my own class that overrides a single method.
    I can extend all those that I currently know and use some mapping from the currently used class to the one extending it - but tomorrow someone may install a new look & feel which uses a different UI component, for which I will not have an extending class.
    Therefore, I'd like to find the currently used UI component class and extend it at runtime.
    Thanks,
    Shlomy

    Shlomy-Reinstein wrote:
    Thanks. It's a good solution, but it requires me to write wrappers for all the public methods of BasicTabbedPaneUI, doesn't it? All I'm interested in is to override a single method. If there is no easier way, that's okay, but since there are scripting languages that interface with Java (e.g. BeanShell), in which I can extend classes, I thought there should be an easy way to extend a class at runtime.You don't write code that is "easy". You write code that is correct.
    If there are several different ways to write code which are all correct then you use other criteria to determine the best one. The first criteria is how much maintenance each would require. And how complex each solution would be. Complexity also impacts maintenance.
    And nothing I have seen in this thread would suggest that anything but a wrapper is a correct solution. Certainly unless you can demonstrate that it would not work then I doubt anything would be better.
    And using beanshell just so you don't have to type is definitely not the correct solution.

  • Passing Optional Parameter Via Extended Class Constructor

    Following is a snippet of code I copied and have a question about when extending DataGridColumn class to sort numeric for colums that have numeric values:
    CustomAdvancedDataGridColumn(columnName:String=null,numeric:Object=null)
    super(columnName);
    initCompare(numeric);
    function initCompare(numeric:Object):void
    if (numeric == NUMERIC) {
    sortCompareFunction = numericCompare;
    The extended class is supposed to receive variable "numeric" type Object in the constructor which is then supposed to be used in the initCompare function to determine if a column contains numeric values.  This code didn't work for me as numeric variable remains null.  To get it working I added a new public static const and private propery "numeric" and obtained it with get() set() to see if should the column should sort numeric.  This works but you have to set the property in the extended datagrid column FLEX  tag.
    My question is how is the variable numeric in the code snippet above supposed to get it's new data for the initCompare function?  I can't get it to be anything other than null.
    Thanks for any insights...I'm new to FLEX.
    Jason

    Still searching for a solution.
    Please note, that I'm using the syntax described in
    <a href="http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf">http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf</a>
    on page 65.
    So did I get anything wrong? Help would be really appreciated, also Workarounds if there's no solution for the problem.

  • Extending classes with private methods?

    my understanding of extending classes is that you gain all the functions and methods of that class thus You could over ride any one of them. How ever I am confused on weather or not you inherit and can over ride private methods of the class you are extending or if you have to have all methods public in an extended class.
    hope that makes sense, an example can bee seen bellow.
    package
         public class Class1
              public function apples():void
                   //some code
              private fnctuin bananas():void
                   //more code
    package
         public class Class2 extends Class 1
              override public function apples():void
                   //i changed code
              //can I over ride bananas?

    you can only override methods that would be inherited.  a private method won't be inherited:
    http://www.kirupa.com/forum/showthread.php?223798-ActionScript-3-Tip-of-the-Day/page5

  • Authoring Tool "Inherit Class" vs "New Class" vs "Extended Class" Scenario Help

    Hi Community,
    I am currently creating the ground work needed to create Self Service Portal Request Offerings to be used by end users and then take that input and automate it with Orchestrator.
    I'm pretty comfortable with the overall process of how this is done, but I was hoping to get guidance from the community to make sure that I don't waste my time by editing my existing management pack incorrectly from the beginning.
    We currently have a Whole bunch of SR and IR Templates in a Management Pack - lets call it: "Company.Templates.MP" now what I want to do is edit this MP and add new List and String Properties to hold the responses provided from the
    Self Service Portal so that I can use a Runbook Activity to feed these responses into Orchestrator.
    Now what I have done is "Extended" the existing "Service Request" and "Incident" classes and created the new properties in each extended class. Now that I have Extended the default Classes I believe that the properties now apply
    to EVERY existing and new SR and IR.
    My question is... Do you think I have done this correctly?
    I have a gut feeling that I have done it wrong and I should revert my MP changes and then instead of extending the existing IR and SR Classes which affect all existing Work Items, I should create a new SR and IR class which would then be used to create new
    Templates which are then ONLY ones that contain the new properties that would be used for Runbook Automation.
    The feedback I receive will be VERY MUCHLY appreciated...

    Answering your implicit question in the title:
    Inherit is where you create a new class that has all the properties of the parent and then some new ones also, but people can still use the parent for regular work. This is for specialization, like say you want a new type of incident to
    cover firewall problems, and need new properties for the IP and Ports from the portal.
    Extended would be where you add properties to a class that make sense for all of those and all inheriting classes. say the client has a cost of IT tracking system where every Incident and Service Request needs to be assigned a cost of effort
    code, you would create two extensions for Incident and Service request, and point them at the same enum list. you wouldn't extend WorkItem, because changes, activities, released etc wouldn't use a simple cost estimate list value, and you wouldn't inherit off
    of SR and IR because all user requests should have this property, even if some of them are blank  
    New would be a class from scratch that inherits from Entity. This is hardly ever what you want to do, because even completely new things are either work items or config items, and should, where ever possible, inherit from one of those
    basil classes
    Now to your explicit question: No, i think you've done exactly what the situation called for. every SR should have this value, even if it is empty for the historical items.
    two side notes: 1) any item that refers to the base of an extension will continue to work as expected, but  2) Offerings are always the exception. The net of these two rule of thumb guidelines is that your existing templates should continue to work
    without modification, but you may have to recreate the offering before you can use the new property in a question.  
    AFAIK you cannot extend an abstract calls (ex. Work Item), but I could be wrong.
    http://codebeaver.blogspot.dk/

  • Extending classes and overriding methods

    If I have a class which extends another, and overrides some methods, if I from a third class casts the extending class as the super class and calls one of the methods which gets overrided, is it the overrided method or the method of the superclass which get executed?
    Stig.

    Explicit cast can't enable the object to invoke super-class's method. Because dynamic binding is decided by the instance. The cast can just prevent you from using methods only defined in sub-class, but it does not let the object to use super-class's method, if the method's been overrided. Otherwise, the polymophism, which is one of the most beautiful feature of Object-Oriented thing, can't be achieved. As far as I know, the only way to use super-class's method is the super keyword in the sub-class, and seems no way for an object to do the same thing (I may wrong, since I haven't read the language spec).
    here's a small test:
    public class Test {
    public static void main(String[] args){
    A a = new B();
    a.method();
    ((A)a).method();
    class A{
    public void method(){
    System.out.println("A's method");
    class B extends A{
    public void method(){
    System.out.println("B's method");
    The output is:
    B's method
    B's method

  • Bounds are not propagated in extended class

    Have a look on this small example, 3 classes A, B and C.
    B and A are generics class,
    B herits of A and there is a lower bounds on the class T in B (T extends C)
    public class A<T> {
         public A() {}
         public T foo()
    public class B<T extends C> extends A<T> {
         public B() {}
         public static void main(String[] args) {
              B inst = new B();
              C cInst = inst.foo3();  //problem : it does'nt work !!
    public class C {
         public C() {}
    }The problem is in the main of the class B, the compiler says : "Cannot convert from Object to C".
    My reasoning :
    There is a type constraint (a lower bound) on T in the class B, so "T extends C" in the class B, so "T extends C" in the class A for an instance of the class B. The call to the method foo() does answer an object which class extends class C !!
    Someone has an explanation, it's abnormal or I should set the parameters of javac.
    thank you.

    Ok my examples were wrong !!
    Have a look on this example (smaller and better !)
    B and A are generics class,
    B herits of A and there is a lower bounds on the class T in A "T extends C"
    public class A<T extends C> {
         public A() {}
         public T foo()
         public void foo2() {
              C cinst = foo(); //no problem : it works
    public class B<T> extends A<T> {
         public B() {...}
         public void foo3() {
              C cinst = foo(); //error : "cannot convert T to C"
    }The type constraint "<T extends C>" of the class "A" is not propagated to the class "B" !!
    I have to add the constraint <T extends C> to the class B like this
    public class B<T extends C> extends A<T> {...}However, it's inevitably like this !

  • [svn:osmf:] 11139: Extending class with a 'processLoadingState' stub, invoked when load state is set to LOADING.

    Revision: 11139
    Author:   [email protected]
    Date:     2009-10-26 03:02:38 -0700 (Mon, 26 Oct 2009)
    Log Message:
    Extending class with a 'processLoadingState' stub, invoked when load state is set to LOADING.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/media/LoadableMediaElement.as

    Strobe was used to verify that the problem was not with my OSMF implementation. Since the results were the same, I am more supsicious of OSMF itself or the underlying AIR framework than the player implementation. Either way, the information I've seen says that progressive download of h.264 video is supported on mobile devices with AIR. It would appear that this is not true in all cases.
    The issue has not been observed on not occur on the desktop. It only occurs with StageVideo enabled playback with autoplay on.
    In the actual product the videos play one at a time. Once the user has finished with a video, the player clears the references to the media. These are OSMF calls; the media assigned to the player is nulled. If this is not sufficient for garbage collection, then I am at a loss as to how to proceed. My test uses four videos that are roughly 1 MB. If there is a memory use problem, then it would appear something is broken in AIR or OSMF.
    I want to be sure I report this correctly. The code involved is more than a snippet, it's a media player designed to be embedded in an app. Do I need to include the complete implementation or will a description be sufficient?

  • SAP Personas: An unexpected behaviour has been detected and you have been disconnected – please log in again.

    Hallo everyone,
    We are installing Personas and facing several challenges.
    Personas 2 SP02 was installed according to instructions of Note '1848339 - Installation and Upgrade note for Personas' and configured according to the Config Guide v1.3 (rel. May 2014). The referenced notes were also applied as well as the 'How to config - FAQ' blog by Sushant.
    We are able to log on and execute transactions and perform activities successfully (e.g. SE80, SPRO, KB15, etc.).
    When trying to copy a screen the following error appears: 'An unexpected behaviour has been detected and you have been disconnected - please log in again.'
    Thereafter one can simply continue executing transactions without having to log in again.
    Please see the download of the error attached as per blog: SAP Screen Personas Support Tips – client side logging
    The HAR is unfortunately too large to attach. Are there any alternatives?
    Thank you in advance for you assistance!
    Kind regards,
    Daniel
    Message was edited by: Daniel K

    Hi,
    I have never worked on SAP PERSONA but you can try below things
    1)try to use different user or J2ee_admin since it might be same user multiple session case
    2) Try with different browser since plugins can behave unexpectedly
    3)Make entry in host file also
    4) check dev_icm logs
    5) check on ABAP side for dumps in ST22
    Warm Regards,
    Sumit

  • Trying to extend class TimecardCO but getting error the following message

    I am using jdev version 9.0.3.5
    I am trying to extend class TimecardCO; but an error is produced when I try to run the page in EBS.
    This is the message I am getting:
    Error message is java.lang.NullPointerException
    at oracle.apps.hxc.selfservice.common.util.GlobalUtilities.changeDestinationURL(GlobalUtilities.java:1418)
    This is my package below.
    package oracle.apps.hxc.selfservice.timecard.webui;
    import oracle.apps.hxc.selfservice.timecard.webui.TimecardCO;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.OAFwkConstants;
    public class xtimecardcoex extends TimecardCO
         public void processFormRequest(oracle.apps.fnd.framework.webui.OAPageContext param1, oracle.apps.fnd.framework.webui.beans.OAWebBean param2)
    System.out.println("IN xtimecardcoex processFormRequest");
    }

    Here is my error Page
    =============
    Error Page
    Exception Details.
    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2335)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._RF._jspService(_RF.java:102)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.apps.hxc.selfservice.common.util.GlobalUtilities.changeDestinationURL(GlobalUtilities.java:1418)
         at oracle.apps.hxc.selfservice.timecard.webui.TimecardCO.processRequest(TimecardCO.java:261)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2335)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._RF._jspService(_RF.java:102)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    java.lang.NullPointerException
         at oracle.apps.hxc.selfservice.common.util.GlobalUtilities.changeDestinationURL(GlobalUtilities.java:1418)
         at oracle.apps.hxc.selfservice.timecard.webui.TimecardCO.processRequest(TimecardCO.java:261)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2335)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._RF._jspService(_RF.java:102)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)

Maybe you are looking for

  • Destinations of a portal

    Hi, I'm quiet new with SAP and NetWeaver. I've installed the sap netweaver sneak preview 2004, the pdk  for .net and the .net connector. I can deploy a very simple application (like the "Hello World" example) on my deployment server and view it in th

  • Port Security based on Device Type

    Hi all: We need to know whether there is any feature or software that allows to block switch ports for type of devices. For instance, we have some switches for IP phones and we do not want to have PCs connected to those ports. We know that it can be

  • Fast boot with MSI Geforce GTX970

    Hi! I just tried to enable Ultra fast boot in my ASRock UEFI,.. didn't work. I learned that I need a GPU which supports GOP. Does my GTX970 support this protocol by default? Do I need to flash a VBios? S/N:602-V316-03SB1409025050 I have difficulties

  • HT201412 The font on my display is huge, how do I shrink it?

    I can't use my screen any more as everything is over-magnified. I can't even type in my security code to get started. How do I shrink it back to a functional size?

  • Net Price Issue

    Hi all, I am extracting data from 2LIS_02_SCL into Cube. When I checked the extractor in RSA3 I noticed Net Price getting different values. The Net Price is coming from EKPO. As we know that in the data source it will show per unit price ie. Net Pric