Generics in view's method

Hi
I am working in CE 7.2 and I want to declare a method that returns ArrayList<String>.
How is it done?
regards
Yuval Peery

Hi Arun
Thank you for your reply.
The problem is not Arraylist but ArrayList<String> , supported as of JDK 1.5.
Moreover when I try to add the generic type <String> to a function that has been
declared as returning ArrayList, the compiler automatically removes the addition of <String>.
public ArrayList myFunc()   should be declared as public ArrayList<String> myFunc()
regards
yuval peery

Similar Messages

  • How to call view-controller method out of componentcontroller

    Hello all,
    my component implements a component-interface with method BACK.
    Thus my componentcontroller has the interface Method BACK.
    When triggering BACK from an foreign component, the implementation within the componentcontroller is called. So far so good.
    Now I want to POPUP_AND_CONFIRM when BACK is hit. But this POPUP_TO_CONFIRM requires me to create an action. But I can't create an action within the componentcontroller.
    I could realize the POPUP_AND_CONFIRM within the components view. But how can I call a view-method out of the componentcontroller?
    Or does anybody have a better solution? (Maybe I could implement BACK within the view, but how to connect the componentcontroller-back-method with the views back-method?)
    Thank you very much in advance...
    Regards
    I. Durmaz

    You should never attempt to call view methods from outside the view.  It is possible to register popop event handlers to methods of the component or custom controllers.  From the online help:
    For a few special cases it is useful to register event handlers for component controllers or custom controllers on the button events of a dialog box. For these cases, a special POPUP_TO_CONFIRM attribute of type IF_WD_POPUP_TO_CONFIRM_N has been implemented in the IF_WD_WINDOW interface. This interface provides precisely the methods with which event handlers for component and custom controllers can be registered on events of the dialog box.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/47/b9487e01602fe2e10000000a42189d/frameset.htm

  • Call view's method from component_controller

    Hello,
    I need to call a view's method from a component controller.
    Does anybody know how this can be done?
    Thank you.

    Hello,
    Thanks for the info.
    In this case. If I have a button on my ALV that takes a user to a different view how would that work?
    Navigation is done using plugs. ALV is initialized in COMPONENT_CONTROLLER and it does no not have plugs. Would I have to create an object of a view where ALV is initialized and than call FIRE_TO_XXXXX_PLG method?
    Thank you.

  • Call a view's method from Component Controller.

    Hi
    Is it possible to call a view's method from Component Controller.
    Regards
    Nikhil

    Hi Tummuru,
    I have created an event in Component Controller by the name toMenuView. Now I created a method in which this event is getting fired. Foll. is the code of the method.
      public void fireToMenuView( )
       wdComponentAPI.getMessageManager().reportSuccess("fireToMenuView");
       wdThis.wdFireEventToMenuView();
    Now I have created an event handler "handleToMenuView" in the MenuView and subscribed the event handler to the event in Component Controller.
    The control is reaching to the fire event in component controller but not to the Event handler in view controller.
    What am I missing.
    Regards
    Nikhil

  • How to see VIEW and METHODS in webdynpro applications ?

    Hi ,
        I am New to WEBDYNPRO applictions , How can i see
    ABAP Webdynpro Application ZAPPROV View V_GETLIST Method VALI_APP....and  BOR Object ZBUS2081 get_property approverlist changing container.....Can any one kindly let me know .
    Regards,
    Veera

    open transaction SE80
    in the repository browser, select Webdynpro component/interface in the dropdown.
    type the name of your webdynpro component and press enter.
    The component will open up, it will have the views, applications that you have created in this component....you can see them as it is required.
    On the left tree, there will be a node for VIEWS, open it and find your view V_GETLIST in it. The view wil open up on the right....there you can find the tab methods in the end (right most)....a list of methods will be displayed....double click on the method name and you will see the code

  • Calling view controller method from component controller method

    Hi,
    Is there any way to call view controller method from component controller method?
    Thanks,

    Hi Khandal.
    You should not make you component controller dependent from a view controller.
    But what you can do is to define an event in the component controller. The view
    controller can register for this event.
    In the stage where you currently want to call the view controller method just fire
    the event. In the event handler method in the view controller you can call the
    method then.
    Why do you need to call a view controller method? Can you give more details
    about the scenario?
    Cheers,
    Sascha

  • Generic arguments in a Method on an interface.

    Hi all,
    I'm having trouble with the following code:
    Basically this is what i want:
    the Classes:
    public class SuperClass
    public class ClassA extends SuperClass
    public class ClassB extends SuperClass
    public class ClassC extends SuperClass
    The interface
    public interface interfaceX
       public methodX(SuperClass A);
    Implementation of the interface
    public class classX implements interfaceX
         public methodX(ClassA A)
    }My problem is on the declaration of the interface interfaceX in the class classX.
    How can i do such thing?
    I'm trying to avoid the "correct" declaration. this is:
    public methodX(SuperClass A)
            { ... }because I have a couple of class that extends that interface with deferents arguments, all of them extending from the SuperClass.
    I know i could use the instanceof keywork, but i'm trying to avoid the extra checking...
    Thanks in advance for any help!!
    Edited by: ValdemarP on Mar 29, 2010 1:55 AM

    i know I'm changing the contract, but only the arguments. if you notice, the new arguments is child of class SuperClass... How can I do this? Declare an method in an interface that accepts an arguments of some class and implement that interface, with argument that are children of the arguments declared in the interface... hope i was more clear this time... :(
    Example. I can do this on an interface:
    public void MethodListGeneric(List<? extends SuperClass> xpto )and during the implementation of the interface, I can declare the method using any arguments for the generic list, that extends SuperClass.
    Example:
    public class xpto extends InterfaceX
        public void MethodListGeneric(List<ClassA> xpto )
         // in here I've use ClassA insted of SuperClass
    }Edited by: ValdemarP on Mar 29, 2010 3:15 AM
    Edited by: ValdemarP on Mar 29, 2010 3:15 AM

  • How to define method  witch returning an array in View, using method wizard

    Dear experts.
    I would  like to define method  which returning an array in View.
    When View is opened, in "Methods" tab push "new" button, then select "Method" in Method Type window,
    push "Next" but in Method Properties window Array Type checkbox is disabled. So, it is not possible to
    define method with returning array type.
    Please anybody, help me to resolve this problem.

    Hi
    While creating method, you can see a check box over there as array type just check it that array type check box,
    or
    You can selet java native type as array by selecting "java native type"
    thanks
    anup
    Edited by: Anup Bharti on Oct 15, 2008 8:50 AM
    Edited by: Anup Bharti on Oct 15, 2008 8:51 AM

  • Question on View Object method to use to reset a data entry form?

    I am using a transient View Object form for the purpose of collecting and persisting data entered by users in a set of web data forms that span multiple pages. In the Application Module, I create the first row (see below.) After the user submits the last form, I programmatically add the data to the database (later may change to an Entity Object, but right now I don't use one.) So, the data they entered remains in the VO (it only ever has one row.)
    My question is which method do I use to clear out the current set of data values. I tried VO.clearcache() but it deletes the row, and VO.reset() did not clear the data? If the only way is to delete the row, then please advise the best way to re-create the row or re-set the iterator.
    thanks!
    -- sample code to insert initial row in App Module --
    protected void prepareSession(oracle.jbo.Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getView1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    ---- in service method after user submits the form and row remains in VO, I have tried: --
    vo1.reset(); // does not delete data from the row
    vo1.clearCache(); // deletes the row

    Thanks. Yes this looks more like what I need. How do I call this method from the client-tier, or from within a service method in my Application Module?
    vo1 = findViewObject("myViewObject");
    row = (MyViewRowImpl)vo1.first();
    row.initDefaults();
    compiler error message received:
    Error(279,21): method initDefaults() has protected access in class oracle.jbo.server.ViewRowImpl
    "Customer applications should not access this class on the client-tier of an application. Instead, the Row interface should be used for client tier access"
    Which Row interface method can I call?
    Message was edited by:
    javaX

  • Form Error: form based on a Generic connectivity view

    A view was based on a select from a table in a Syabase database (accessed in Oracle using Generic Connectivity).
    When I built a block in a Form based on that view, I faced the following error:
    ORA-02070: database SYB does not support ROWID in this context.
    Also, the same error appeared in the reports accessing the same view.
    Can anyone give me a clue to solve this problem plz?
    Thanks in advance.

    I later knew that the issue can be addressed by setting the parameter Key Mode to nonupdatable.

  • Generic delta view

    i am trying to create a view from the EINE and EINA.when i try to create generic data source using this view i am getting an error "invalid extract structure template" when i double click on this i am getting an error message"Quantity and currency fields refer to a different table" whether i should add that table in the joins? how to create the data source
    regards
    rajan

    You do not have to add the table in the joins. But you have to append the currency or unit field to the extract structure. Then specify this added field as the currency field for the main value field in the extract structure.
    This should solve your problem.

  • Using a non-static vector in a generic class with static methods

    I have a little problem with a class (the code is shown underneath). The problem is the Assign method. This method should return a clone (an exact copy) of the set given as an argument. When making a new instance of a GenericSet (with the Initialize method) within the Assign method, the variables of the original set and the clone have both a reference to the same vector, while there exists two instances of GenericSet. My question is how to refer the clone GenericSet's argument to a new vector instead of the existing vector of the original GenericSet. I hope you can help me. Thanks
    package genericset;
    import java.util.*;
    public class GenericSet<E>{
    private Vector v;
    public GenericSet(Vector vec) {
    v = vec;
    private <T extends Comparable> Item<T> get(int index) {
    return (Item<T>) v.get(index);
    public static <T extends Comparable> GenericSet<T> initialize() {
    return new GenericSet<T>(new Vector());
    public Vector getVector() {
    return v;
    public static <T extends Comparable> GenericSet<T> insert (GenericSet<T> z, Item<T> i){
    GenericSet<T> g = assign(z);
    Vector v = g.getVector();
    if (!member(g,i))
    v.addElement(i);
    return g;
    public static <T extends Comparable> GenericSet<T> delete(GenericSet<T> z, Item<T> i){
    GenericSet<T> g = assign(z);
    Vector v = g.getVector();
    if (member(g,i))
    v.remove(i);
    return g;
    public static <T extends Comparable> boolean member(GenericSet<T> z, Item<T> i) {
    Vector v = z.getVector();
    return v.contains(i);
    public static <T extends Comparable> boolean equal(GenericSet<T> z1, GenericSet<T> z2) {
    Vector v1 = z1.getVector();
    Vector v2 = z2.getVector();
    if((v1 == null) && (v2 != null))
    return false;
    return v1.equals(v2);
    public static <T extends Comparable> boolean empty(GenericSet<T> z) {
    return (cardinality(z) == 0);
    public static <T extends Comparable> GenericSet<T> union(GenericSet<T> z1, GenericSet<T> z2) {
    GenericSet<T> g = assign(z1);
    for(int i=0; i<cardinality(z2); i++) {
    Item<T> elem = z2.get(i);
    insert(g, elem);
    return g;
    public static <T extends Comparable> GenericSet<T> intersection(GenericSet<T> z1, GenericSet<T> z2) {
    GenericSet<T> g = initialize();
    for(int i=0; i<cardinality(z2); i++) {
    Item<T> elem = z2.get(i);
    if(member(z1, elem))
    insert(g, elem);
    return g;
    public static <T extends Comparable> GenericSet<T> difference(GenericSet<T> z1, GenericSet<T> z2) {
    GenericSet<T> g = initialize();
    for(int i=0; i<cardinality(z1); i++) {
    Item<T> elem = z1.get(i);
    if(!member(z2, elem))
    insert(g, elem);
    for(int i=0; i<cardinality(z2); i++) {
    Item<T> elem = z2.get(i);
    if(!member(z1, elem))
    insert(g, elem);
    return g;
    public static <T extends Comparable> GenericSet<T> assign(GenericSet<T> z) {
    GenericSet<T> g = initialize();
    for(int i=0; i<cardinality(z); i++) {
    Item<T> elem = z.get(i);
    insert(g, elem);
    return g;
    public static <T extends Comparable> boolean subset(GenericSet<T> z1, GenericSet<T> z2) {
    for(int i=0; i<cardinality(z1); i++) {
    Item<T> elem = z1.get(i);
    if(!member(z2, elem))
    return false;
    return true;
    public static <T extends Comparable> int cardinality(GenericSet<T> z){
    Vector v = z.getVector();
    return v.size();
    }

    The issue is not "reference a non-static interface", but simply that you cannot reference a non-static field in a static method - what value of the field ed would the static method use? Seems to me your findEditorData should look something like this:   public static EditorBean findEditorData( String username, EditorBean editorData )
          return editorData.ed.findEditor( username );
       }

  • Enum value not displaying in view - correct method to display in column?

    Hello again Experts,
    Having trouble with certain columns not populating in my custom class. I know I must have entered them incorrectly, hoping someone can shed some light on it.
    Its a custom work item class, so I borrowed the Work Item Status property but am obviously referencing it wrong...
    under my class properties its listed as follows:
    <Property ID="Status" Type="enum" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="56" MinLength="0" Required="false" Scale="0" EnumType="WorkItem!IncidentStatusEnum" />
    In my Columns definition its entered like this (this is where I made the mistake I think):
    <mux:Column Name="Status.DisplayName" DisplayMemberBinding="{Binding Path=IncidentStatusEnum.DisplayName, Mode=OneWay}" Width="100" DisplayName="Status" Property="Status.DisplayName" DataType="s:String" />
    Next is a custom enum called Source_List, here is the property again followed by the column definition:
    <Property ID="Source" Type="enum" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" EnumType="Source_List" />
    <mux:Column Name="Source.DisplayName" DisplayMemberBinding="{Binding Path=Source_List.DisplayName, Mode=OneWay}" Width="100" DisplayName="Source List" Property="Source.DisplayName" DataType="s:String" />
    The last one is "Destination FSL", below are the property and column definitions:
    <Property ID="Target_FSL" Type="enum" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" EnumType="Destination_FSL_List" />
    <mux:Column Name="Destination_FSL_List" DisplayMemberBinding="{Binding Path=Destination_FSL_List, Mode=OneWay}" Width="100" DisplayName="Destination FSL" Property="Target_FSL" DataType="s:String" />
    I know I've mucked them up pretty bad... I kept trying to change things around hoping I could get it to work so pls forgive my newbiness! Thanks in advance.

    Look at other views in Service Manager's management packs to get insight into how enum columns are configured.
    Change your binding paths to Status.DisplayName, Source.DisplayName, and Target_FSL.DisplayName respectively. You have to bind your columns to your object properties, not your lists.

  • Some generic anonymous class overriding methods compile, while others don't

    I have the following (stripped-down) code. The abstract class SessionHandler<T> is used by other code to define and run an operation that needs a session to something. This is best done in my code with anonymous classes, because of the shear number of operations defined. In the EntityOps<T> class, these work great. But, in the last class shown here, SomeClass, the anonymous class definition fails, though the semantics are almost identical. (List<T> vs.List<AnotherClass>) What am I doing wrong here? Or is this a bug in Java?
    Thanks, Tom
    public interface IEntityOps<T> {
        T get();
        List<t> getAll();
    public abstract class SessionHandler<T> {
        abstract T handle(Session session) throws Throwable;
        public final T perform() {
            ... calls handle(session) ...
    // These anonymous class definitions compile fine!
    public class EntityOps<T> implements IEntityOps<T> {
        public T get() {
            T ret = null;
            ret = new SessionHandler<T>() {
                T handle(Session s) throws Throwable {
                    T ret = (some T object calculation);
                    return ret;
            }.perform();
            return ret;
        public List<T> getAll() {
            T ret = null;
            return new SessionHandler<List<T>>() {
                List<T> handle(Session s) throws Throwable {
                    List<T> ret = (some List<T> calculation);
                    return ret;
            }.perform();
    // This anonymous class definition fails with the error:
    // "SomeClass.java": <anonymous someMethod> is not abstract and does not override abstract method handle()
    //     in SessionHandler at line XX, column XX
    public class SomeClass {
        public List<AnotherClass> someMethod() throws {
            List<AnotherClass> ret = null;
            ret = new SessionHandler<List<AnotherClass>>() {
                List<AnotherClass> handle(Session s) throws Throwable {
                    List<AnotherClass> ret = (some List<AnotherClass> calculation);
                    return ret;
            }.perform();
            return ret;
    }

    I added @Override above the abstract method override, and it provides this additional error:
    "HousingConfigImpl.java": method does not override a method from its superclass at line 382, column 17
    I have also reconstructed the code layout in a separate set of classes that have no dependancies, but there's no error coming from these!
    public class CustomThing {
    public interface ISomeInterface<T> {
        List<T> interfaceMethod();
    public abstract class SomeAbstractClass<T> {
        private Class _c = null;
        public SomeAbstractClass(Class c) {
            _c = c;
        protected Class getC() {
            return _c;
        public abstract T methodToOverride(Object neededObject) throws Throwable;
        public final T finalMethod() {
            try {
                return methodToOverride(new Object());
            } catch(Throwable e) {
                throw new RuntimeException(e);
    import java.util.List;
    import java.util.Collections;
    public class SomeInterfaceImpl<T> implements ISomeInterface<T> {
        public List<T> interfaceMethod() {
            return new SomeAbstractClass<List<T>>(CustomThing.class) {
                public List<T> methodToOverride(Object neededObject) throws Throwable {
                    return Collections.emptyList();
            }.finalMethod();
    import java.util.Collections;
    import java.util.List;
    public class SomeOtherClass {
        public List<CustomThing> someMethod() {
            return new SomeAbstractClass<List<CustomThing>>(CustomThing.class) {
                public List<CustomThing> methodToOverride(Object neededObject) throws Throwable {
                    return Collections.emptyList();
            }.finalMethod();
    }So, there's something about my code that causes it to be, somehow, different enough from the example provided above so that I get the error. The only differences in the override method definitions in my actual code are in the return type, but those are different in the example above as well. Here are the class declarations, anonymous abstract class creation statements, and abstract method declarations from the actual code.
    public abstract class SessionHandler<T> {
        abstract T handle(Session session) throws Throwable;
    public class EntityOps<T> implements IEntityOps<T> {
                return new SessionHandler<List<T>>(_mgr, _c, "getAll" + _c.getName()) {
                    List<T> handle(Session s) throws Throwable {
    public class HousingConfigImpl implements IHousingConfigOperations, ISessionFactoryManager {
                ret = new SessionHandler<List<Tenant>>((ISessionFactoryManager)this, Housing.class, "getTenantsInNeighborhood") {
                    List<Housing> handle(Session s) throws Throwable {I can't for the life of me see any syntactical difference between my example and the real code. But, one works and the other doesn't.

  • Generic Extraction (views)

    HI
    I am involved in a project where there are 35 ztables now i am told to use use views as much as possible and extract the data. does any has any step by step doc to create views and what are the conditions on which i can join the tables.
    appreciate any kind of help regarding the issue
    k.mohan

    try this:
    /people/sap.user72/blog/2005/09/05/sap-bw-and-business-content-datasources-in-pursuit-of-the-origins
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    also check this:
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/content.htm
    assign points if useful ***
    Thanks,
    Raj

Maybe you are looking for

  • How do I get my built-in speakers to work again

    I recently had my built-in speakers stop working less than a year after purchasing my MacBook Pro 15".  About 24hrs ago, my built-in speakers were working fine.  At some point, I was using my bose headphones, and after I unplugged them, my speakers d

  • TS1368 " Cannot connect to I Tunes store. Invalid argument "

    Using iPhone mobile: When I tried to update an App, listed by the AppStore App, as needing an update, I received this pop-up message: "Cannot connect to ITunes Store. invalid argument." What might I do to correct the problem? • I have created a new p

  • Sap workflow tutorial issue

    Hi, Looks like someone else has had the same issue recently (see Work flow in error when executed with a user decision.) but that question was marked as answered so am reposting my response here... Hi, I believe the orginal poster is following the wo

  • Unable to right click on Master Page - Adobe Muse CC

    How do I access Page Properties to update Metadata when right clicking on the Master Page does not work in Adobe Muse CC?

  • Package manager aka 'pacman'

    So, I am new to Linux operating systems. I did at one point mess around with Linux Mint && Peppermint (which probably explains why I love LXDE). I quickly grew bored...So, it was short lived and I reverted back to Windows. About 6 months ago I decide