STATIC vs STATIC2 in static LOV definition

Hi All,
what is the difference between STATIC and STATIC2 ?
The documentation on creating checkbox references word 'STATIC'. When I create static LOV by clicking 'Create or edit static List of Values' link on 'Edit Page Item' this uses word 'STATIC2' in LOV definition.

One sorts values alphabetically and the other in the order in which they are written.
Jure

Similar Messages

  • Dynamic call of a static method of an static attribute

    Hi all,
    is it possible to call dynamically a static method of a static attribute of a class.
    The statement without dynamic call would look like this:
    cl_test_class=>static_attribute=>static_method( ).
    I would like to do it like this:
    ('CL_TEST_CLASS')=>static_attribute=>static_method( ).
    Netiher the one nor the other way works for me - I'm getting the error "The notation used is reserved for business object classes".
    Regards, Stefan

    I guess, it is not possible to call method using the short form (parameters in brackets) is not possible in Dynamic Access. You may need to get the attribute first and then call the method.
    CLASS lcl_main DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA: o_same TYPE REF TO lcl_main.
        METHODS: run.
    ENDCLASS.                    "lcl_main DEFINITION
    CLASS lcl_main IMPLEMENTATION.
      METHOD run.
        WRITE: 'success'.
      ENDMETHOD.                    "run
    ENDCLASS.                    "lcl_main IMPLEMENTATION
    START-OF-SELECTION.
      DATA: lo_same TYPE REF TO lcl_main.
      CREATE OBJECT lcl_main=>o_same.
    *  lcl_main=>o_same=>run( ).
      TRY.
          FIELD-SYMBOLS: <fs> TYPE REF TO lcl_main.
          ASSIGN ('LCL_MAIN')=>('O_SAME') TO <fs>.
          CALL METHOD <fs>->('RUN').
        CATCH cx_root.
      ENDTRY.
    Regards,
    Naimesh Patel

  • How to reference a static variable before the static initializer runs

    I'm anything but new to Java. Nevertheless, one discovers something new ever' once n a while. (At least I think so; correct me if I'm wrong in this.)
    I've long thought it impossible to reference a static variable on a class without the class' static initializer running first. But I seem to have discovered a way:
    public class Foo  {
      public static final SumClass fooVar;  // by default initialized to null
      static  {
         fooVar = new SumClass();
    public class Bar  {
      public static final SumClass barVar;
      static  {
         barVar = Foo.fooVar;  // <<<--- set to null !
    }Warning: Speculation ahead.
    Normally the initial reference to Foo would cause Foo's class object to instantiate, initializing Foo's static variables, then running static{}. But apparently a static initializer cannot be triggered from within another static initializer. Can anyone confirm?
    How to fix/avoid: Obviously, one could avoid use of the static initializer. The illustration doesn't call for it.
    public class Foo  {
      public static final SumClass fooVar = new SumClass();  // either this ..
    public class Bar  {
      public static final SumClass barVar = Foo.fooVar;  // .. or this would prevent the problem
    }But there are times when you need to use it.
    So what's an elegant way to avoid the problem?

    DMF. wrote:
    jschell wrote:
    But there are times when you need to use it. I seriously doubt that.
    I would suppose that if one did "need" to use it it would only be once in ones entire professional career.Try an initializer that requires several statements. Josh Bloch illustrates one in an early chapter of Effective Java, IIRC.
    Another classic usage is for Singletons. You can make one look like a Monostate and avoid the annoying instance() invocation. Sure, it's not the only way, but it's a good one.
    What? You only encounter those once in a career? We must have very different careers. ;)
    So what's an elegant way to avoid the problem? Redesign. Not because it is elegant but rather to correct the error in the design.<pff> You have no idea what my design looks like; I just drew you a couple of stick figures.If it's dependent on such things as when a static initializer runs, it's poor. That's avoidable. Mentioning a case where such a dependency is used, that's irrelevant. It can be avoided. I know this is the point where you come up with a series of unfortunate coincidences that somehow dictate that you must use such a thing, but the very fact that you're pondering the problem with the design is a design problem. By definition.
    Besides, since what I was supposing to be a problem wasn't a problem, your "solution" isn't a solution. Is it?Well, you did ask the exact question "So what's an elegant way to avoid the problem?". If you didn't want it answered, you should have said so. I'm wondering if there could be any answer to that question that wouldn't cause you to respond in such a snippy manner. Your design is supposedly problematic, as evidenced by your question. I fail to see why the answer "re-design" is unacceptable. Maybe "change the way the Java runtime initializes classes" would have been better?
    This thread is bizarre. Why ask a question to which the only sane answer, you have already ruled out?

  • To static or not to static

    Hello, i have a little discussion with a colleage of mine about the use of statics.
    say we have a class (sqlManager) which is used to do all the sql work including the db connection.
    would it be wise to make this class static. in my opinion no. perhaps make it a singleton, but not static.
    My colleage thinks otherwise, make it static i do not need an object of it. it makes it easier to code and smaller.. perhaps this is true, i personally find it ugly. any suggestions.
    Maqish

    I think if in the constructor method there are
    important things to be executed, then the singleton
    pattern will be better. Otherwise, the static
    solution is better.There's always a static initializer (static { .. }) for static classes that have the same basic role for static content as constructors do for instance content. Not playing favorites, just pointing it out for any future readers.
    If you are sure that the class has features that make
    this class immutable, that is, probably it never
    will be necessary to inherit the class because of its
    characteristics, then you may declare its methods as
    final and static.Inheritability is definitely a major factor.
    This doubt is only about the architecture of the
    application, that is, about its features, that must
    be analized to decide what kind of class has to be
    developed.As mentioned, I think a good general rule is that if you need singleton behavior, use a singleton. If you just need some utility methods, use static methods.

  • Is it possible to change LOV definition using dynamic action?

    Hi,
    I have a multi-select LOV page item, P27_MULTI_CLASS_CODE, defined as below.  On page load, this list only contains values based on what has been passed to P27_OLO_CODE or P27_OLO_CODE_SW.
    SELECT DISTINCT c.class_code d, c.class_code r
      FROM ORGANIZATION o,
           POSITION p,
           CLASS c
    WHERE o.org_wk = p.org_wk
       AND p.class_wk = c.class_wk
       AND o.org_active_flag = 'Y'
       AND p.pos_active_flag = 'Y'
       AND c.class_active_flag = 'Y'
       AND (o.olo_code = :P27_OLO_CODE
            OR o.olo_code = :P27_OLO_CODE_SW)
    ORDER BY c.class_code ASC
    Before submitting the page, I would like the LOV definition of P27_MULTI_CLASS_CODE to change to the following (similar query without reference to P27_OLO_CODE or P27_OLO_CODE_SW) based on whether the user selects checkbox item, P27_ALLOW_SW.   By doing this, P27_MULTI_CLASS_CODE would contain a full range of values rather than limited values.
    SELECT DISTINCT c.class_code d, c.class_code r
      FROM ORGANIZATION o,
           POSITION p,
           CLASS c
    WHERE o.org_wk = p.org_wk
       AND p.class_wk = c.class_wk
       AND o.org_active_flag = 'Y'
       AND p.pos_active_flag = 'Y'
       AND c.class_active_flag = 'Y'
    ORDER BY c.class_code ASC
    I wanted to avoid writing Javascript.  Is this possible using dynamic actions...or at least somehow refresh P27_MULTI_CLASS_CODE so that it ignores P27_OLO_CODE and P27_OLO_CODE_SW?
    I've tried creating a dynamic action to clear the value of  P27_OLO_CODE or P27_OLO_CODE_SW, in hope it would trigger P27_MULTI_CLASS_CODE to display all values, but it has not been successful.  Any ideas?
    APEX 4.2

    I was able to resolve by changing the SQL statement to P27_MULTI_CLASS_CODE.  Note:  I also included an additional condition.
    SELECT DISTINCT c.class_code d, c.class_code r
      FROM ORGANIZATION o,
           POSITION p,
           CLASS c
    WHERE o.org_wk = p.org_wk
       AND p.class_wk = c.class_wk
       AND o.org_active_flag = 'Y'
       AND p.pos_active_flag = 'Y'
       AND c.class_active_flag = 'Y'
       AND (:P27_ALLOW_SW = 'Y'
            OR (o.olo_code =  :P27_OLO_CODE
                OR o.olo_code = :P27_OLO_CODE_SW)
       AND (:P27_PAY_PLAN IS NULL
             OR p.pay_plan = :P27_PAY_PLAN)
    ORDER BY c.class_code ASC
    I also changed the Cascading LOV Parent Item(s) value to:  P27_OLO_CODE,P27_OLO_CODE_SW,P27_PAY_PLAN,P27_ALLOW_SW.  Optimize Refresh = No, since a change in any one of these values should trigger refresh of LOV.
    The Dynamic Action was also modified to NULL out P27_OLO_CODE,P27_OLO_CODE_SW when P27_ALLOW_SW was enabled.
    So far, so good!  Thanks for your suggestions Tom and Howard!

  • Usage of non static members in a static class

    Can you explain the usage of nonstatic members in a static class?

    Skydev2u wrote:
    I just recently started learning Java so I probably know less than you do. But from what I've learned so far a static class is a class that you can only have one instance of, like the main method. As far as non static members in a static class I think it allows the user to modify some content of the class(variables) even though the class is static. A quick Google help should help though.Actually the idea behind a static class is that you dont have any instances of it at all, its more of a place holder for things that dont have anywhere to live.
    Non-static members in a static class wouldnt have much use

  • Public static void vs. public static int

    hey java_experts,
    we're learning arrays and i was just wondering whats the difference between public static void vs. public static int

    hi i want to do java mail but i am new in this field
    so please suggest me how i have to get help for the
    java mailNext time start your own thread.
    Google for Java mail tutorial.

  • Calling non-static command from within static method

    Hello,
    I have a static method that reads bytes from serial port, and I want to set a jTextField from within this method. but I get error that says it is not possible to call non static method from a static one. How can it be solved?

    ashkan.ekhtiari wrote:
    No, MTTjTextField is the name of jTextFiled class instance.You haven't declared any such variable in the class you posted, not to mention that such a variable name violates standard code conventions.
    This is and instance of that object actually. You haven't declared any such variable in the class you posted.
    the problem is something else. No, it isn't, based on the information you have provided. If you want accurate guidance, don't post misleading information about your problem.
    It can not be set from within static method.A question commonly asked on Java forums concerns an error message similar to the following:
    non-static variable cannot be referenced from a static context
    In Java, static means "something pertaining to an object class". Often, the term class is substituted for static, as in "class method" or "class variable." Non-static, on the other hand, means "something pertaining to an actual instance of an object. Similarly, the term instance is often substituted for non-static, as in "instance method" or "instance variable."
    The error comes about because static members (methods, variables, classes, etc.) don't require an instance of the object to be accessed; they belong to the class. But a non-static member belongs to an instance -- an individual object. There's no way in a static context to know which instance's variable to use or method to call. Indeed, there may not be any instances at all! Thus, the compiler happily tells you that you can't access an instance member (non-static) from a class context (static).
    Once you understand this concept, you can fix your own problem.
    ~

  • Difference between calling static method and not static method?

    Hi,
    Suppose i want to write a util method, and many class might call this method. what is better? writing the method as static method or not static method. what is the difference. what is the advantace in what case?

    writing the method as static method or not static
    method. what is the difference.The difference is the one between static and non-static. Any tutorial or the JLs will clarify the difference, no need to repeat it here.
    what is the advantace in what case?It's usually not like you have much of a choice. If you need access to an instance's attributes, you can't make it static. Otherwise, make it static.

  • Bug in Static LOV definition in tabular form?

    I have always defined static LOVs as follows
    STATIC:Yes;Y,No;N
    but now with V4.0+ the select list at runtime appears as follows:
    STATIC:Yes
    No
    Suddenly the literal "STATIC" is appearing in the first display field.
    If I omit the word "STATIC:" from the definition, it seems to work fine. Was this an intentional change in the definition of static LOVs? If so, you then the developers need to update the help text for LOVs.
    PaulP

    bump...

  • How can I use non-static  func in  a static func?

    Hello guys,
    I have a func processFiles which is static, i wanna use a func from another class FileData in processFile func and i dnt wanna make processFile non-static, what should i do?
    my code:
    public class Library {
         private FileData file = new FileData();
         public static void main(String[] args){
            try{
                 Library lib = new Library();
                  lib.processFiles(args);
            catch(IOException e)
                 System.err.println("IOException occurred in main.");
                   System.exit(0);
         @SuppressWarnings("unchecked")
         public  static void processFiles(String[] fileNames) throws IOException {
              file.getMaterial();// I get error here;
    class FileData{
        getMaterila() {}
    }

    1) it's not "func", it's "method".
    2) Create a FileData instance and call the method on that
    3) Read the basic tutorials about what "static" means, and put the error message into Google.

  • How can I call a static function in another static function?

    /** = d, as a String, using exactly 5 characters.
    Precondition: 0 <= d <= 999.
    The truncated d will have one of the forms: ddd.d, dd.dd, and d.ddd.
    Examples are: 360.1, 29.50, 4.003, 0.001, and 0.000
    public static String truncateTo5(double d) {
    // To get the desired output, do the following
    // 1. If d < 0.001, set d to 0.
    // This prevents d appearing in scientific notation, e.g. 1.5E-6.
    // 2. Convert d to a string s, in the usual way.
    // s is guaranteed to have a decimal point in it a digit before
    // and after the decimal point.
    // 3. Append zeros to s (if necessary) until s has 5 digits.
    // 4. Return s.
    String s= "" + d;
    if (d < 0.001) {
    d= 0;
    return "0.000";
    if (s.length() > 5) {
    return s.substring(0,5);
    if (s.length() == 3) {
    int l= s.length();
    return s.substring(0, l) + "00";
    if (s.length() == 4) {
    int l= s.length();
    return s.substring(0, l) + "0";
    return s;
    /** = d, but rounded (if necessary) to its first 5 characters.
    PreconditionL 0 <= d <= 360.
    E.g. round 1.3546 to 1.355. round 1.3544 to 1.354.
    E.g. round 21.995 to 22.00. round 21.994 to 21.99.
    E.g. round 130.59 to 130.6. round 130.54 to 120.54.
    public static String roundTo5(double d) {
    // Hint. Rounding to an integer j is usually done by
    // truncating the value j + 0.5.
    // E.g. Change 10.6 to 11.1 and truncate to 11
    // E.g. Change 10.4 to 10.9 and truncate to 10
    // You need to do this sort of thing, but what you add may depend
    // on how big d is.
    What I need to do is call the truncateTo5() in the roundTo5() in order for this to work properly but I dont know how. Can someone help?

    @captfoss: If they're static methods in the same class, you don't even need to do that. You can just call the method unquallified.
    @OP: First off, when you paste code, wrap it in code tags. You can find them between Quote and Help.
    As for your error, you have defined truncateTo5() to take a double as an argument. When you call it, you are not passing it a double and you get that error.

  • VM NIC keeps changing from Dynamic to Static IP (from a static IP pool)

    Back ground:
    Having migrated our VM's from 2008R2 and 2012SP1 servers into one 4 node 2012R2 Hyper V Cluster we have a problem with NIC's being changed to Static IP, this in turn gives a range of warning and errors when
    moving VM's between the nodes (example during a live migrate or when we put a node in maintenance mode). 
    The cluster share a Logical Switch, this switch has 1 Uplink. The uplink is a Port Profile called "TrunkPort" and it contains lots of network sites. Each network site links to a Logical Network, each Logical Network is basically a VLAN on our Cisco
    router/switch.
    We don't have any IP Pools configured since we assign all VM's a static IP manually or they use DHCP provided by our AD servers.
    When we change a NIC to from Static IP to Dynamic (there might be power shell to do this), bit in the GUI its painfull as you have to shutdown the VM remove the adapter and create a new one. I does not last long as the system after a few minutes changes
    the NIC configuration back to Static IP again. Any idea why and how to stop it?
    example of errors after a migration that completed w/ Info :
    Error (23801)
    No available connection to selected VM Network can be found.
    Recommended Action
    Ensure host NICs have connection to the fabric network on which VM Network is created.
    Error (23810)
    There is no host NIC with required classification.
    Recommended Action
    Ensure that there NICs with required classification on a host.
    Error (23806)
    All available ports on switch extension  has been used.
    Recommended Action
    Ensure there are free ports available on a switch extension.
    Error (23808)
    All available ports on port profile  has been used.
    Recommended Action
    Ensure that there are free ports available on a port profile.
    Error (23807)
    The switch extension  has reached maximum supported ports on this host.
    Recommended Action
    Ensure there are free ports available on a switch extension per host.
    Error (23809)
    The port profile  has reached maximum supported ports on this host.
    Recommended Action
    Ensure that there are free ports available on a port profile per host.
    Error (23825)
    The virtual machine requires a logical switch connection and the host network adapter is not attached to a logical switch or operating system doesn't support logical switch.
    Recommended Action
    Ensure operating system supports logical switch and there is a logical switch connection for the host or remove the network interface card from the virtual machine and try the operation again.
    Error (23753)
    The virtual machine or tier load balancer configuration requires an IP pool and there are no appropriate IP pools accessible from the host.
    Recommended Action
    Select a host with access to an appropriate IP pool and try the operation again.
    Warning (23830)
    Unable to find compliant logical switch.
    Recommended Action
    Fix logical switch compliance state.
    Note: a server configured with Dynamic NIC will move between nodes without any errors (nice green tick box icon), our problem is that SCVMM or the servers deside to reconfigure the NIC's to Static IP when ever they see fit!!

    I feel like some issue with the Fabric configuration.
    If you are create a new VM through SCVMM, do you face this issue? (While creating the new VM, on the hardware configuration page, use dynamic IP and Dynamic MAC)
    The first event which you listed says about missing VM Network.
    No available connection to selected VM Network can be found.
    Please check the VM Network to where the VM is connected through SCVMM. And check if all the nodes have the same VM Network.
    If thats missing, fixing it might fix few other errors which you mentioned.
    Optimism is the faith that leads to achievement. Nothing can be done without hope and confidence.
    InsideVirtualization.com

  • Non-static variable from a static context

    This is the error i get . If i understand the error correctly it says im using a static variable when i shouldnt be? Or is it the other way round? below the error is the actual code....
    The error...
    Googler.java:27: non-static variable this cannot be referenced from a static context
              submitButton.addActionListener(new ButtonHandler());The code...
              JButton submitButton = new JButton("Submit Query");
              submitButton.addActionListener(new ButtonHandler());

    thanks for the response.
    I have already tried what you said but I tried it again anyway and i get the same error more less...
    Googler.java:28: non-static variable this cannot be referenced from a static context
              ButtonHandler buttonHandler = new ButtonHandler();here is part of my code
    public class Googler
      static JTextField input1, input2;
         public static void main(String[] args)
              JFrame myFrame = new JFrame("Googler v1.0");
              Container c = myFrame.getContentPane();
              JLabel lab1 = new JLabel("Enter Google Query:");
              JLabel lab2 = new JLabel("Enter Unique API Key:");
              input1 = new JTextField(15);
              input2 = new JTextField(15);
              JRadioButton radSearch = new JRadioButton("Search Query");
              JRadioButton radCached = new JRadioButton("Cached Query");
              JButton submitButton = new JButton("Submit Query");
              ButtonHandler buttonHandler = new ButtonHandler();
              submitButton.addActionListener(buttonHandler);
              ButtonGroup group = new ButtonGroup();
              group.add(radSearch);
              group.add(radCached);Ive tried declaring buttonHandler as a static variable and this dosn't work either. I've never had this problem before it must be something silly im missing...?
    Thanks
    Lee

  • Non Static Variable addressed to Static Variable

    Hi,
    I am new to java, I am getting (Non Static Variable sb,serverAddress addressed to Static Variable)
    Here is the code. Thanks for reading, any help or explanation would be appreciated-
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package webcheck;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.ProtocolException;
    import java.net.URL;
    * @author
    public class checkhttp {
          private URL serverAddress = null;
          private StringBuilder sb = null;
          public checkhttp(java.net.URL serverAddress,java.lang.StringBuilder StringBuilder)
              this.serverAddress=serverAddress;
              this.sb=sb;
      public static void main(String[] args) {
          HttpURLConnection connection = null;
          OutputStreamWriter wr = null;
          BufferedReader rd  = null;
          String line = null;
          int x;
          //checkhttp check= new checkhttp();
          try {
              serverAddress = new URL("http://www.yahoo.com");
              //set up out communications stuff
              connection = null;
              //Set up the initial connection
              connection = (HttpURLConnection)serverAddress.openConnection();
              connection.setRequestMethod("GET");
              connection.setDoOutput(true);
              connection.setReadTimeout(10000);
              connection.connect();
              //get the output stream writer and write the output to the server
              //wr = new OutputStreamWriter(connection.getOutputStream());
              //wr.write("");
              //wr.flush();
              //read the result from the server
              rd  = new BufferedReader(new InputStreamReader(connection.getInputStream()));
              sb = new StringBuilder();
              while ((line = rd.readLine()) != null)
                  sb.append(line + '\n');
              System.out.println(sb.toString());
              System.out.println("Server is up");
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (ProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          finally
              //close the connection, set all objects to null
              connection.disconnect();
              //rd = null;
              //sb = null;
              //wr = null;
              connection = null;
    }

    Someone please correct me if I'm wrong, but since main is static, any fields it access must also be static.
    The static keyword declares that something is accessable no matter the class state, thus you can call main() and run your program without having something make an instance of the object that your progam defines. For example:
    class Foo {
          static public String strText = "Hello World";
    //Later in some method, this is valid.
    String MyString = Foo.strText;
    //However, if strText was not static you need to
    Foo fooExample = new Foo();
    String myString = fooExample.strText;Static should not override private, so static private fields/members are not accessable. To be accessable you still need to be public.
    Edited by: porpoisepower on Jan 21, 2010 2:18 PM

Maybe you are looking for