Application wide Variable

What is the best way to implement an Application wide Variable.
Here is what I want to accomplish. We have several users enter different data into Database. I want to filter the data the users see based on a column will call it Group that is in every table.
My thinking was to put a dropdown on the login page or some page and they would choose which Group's data they want to see.
Then on every page the queries for that page would have a where clause that would say where Group = :MY__APP_Variable.
I am not sure if one this is the best way to accomplish this,
and two if it is the best way I am not totally sure how to fully implent the app parameter.
I am thinking I would create some type of variable under shared components
then when they select the value from the drop down on the login I would make the variable equel to that.
I am just not sure exactly how to do this.
Thoughts??
Thanks

qtjr, I asked you about the number of reports, so that if you have less number of reports then you can have the option for changing the group on the report screen instead of going to the first page for changing it. You have 50 or more reports, so this probably will not be a good option. Allow the user to select a group after they login and set the value to an application level item.
You can use a page level item but I think an application level item will be a better option.
Thanks,
Machaan

Similar Messages

  • Global/Application level variable

    Hey guys
       I have been using sdk 3.0 so far, but now ran into a issue.  I wanted to create grouped data grid using AdvancedDataGrid, but when my data get loaded from CF, the AdvancedDataGrid does not update with newly acquired data.  I used
      [Bindable] public mydataprovider:ArrayCollection;
    and in result function have
        mydataprovider = new ArrayCollection(event.result as Array).
    All of this works but my datagrid remains empty, since there was no data when the component was created and added to the stage.  Turns out that this is a know issue and was fixed in subsequent DMV 3.0.2
    [link]http://bugs.adobe.com/jira/browse/FLEXDMV-1334?page=com.atlassian.jira.plugin.system.issue tabpanels:all-tabpanel[/link]
    So I installed sdk 3.3.  Now I have all sorts of errors.  Mainly this one.
    I have a utility.as file in which a var as bellow
    var app:[app name] = mx.Application.application as [app name]
    I am using this var (app) to access values that are set in different stages and also to dispatch and listen to events.  but now I can use it in 3.3
    I get an error
         Call to a possibly undefined method addEventListener through a reference with static type [app name]
    Now I think I know that I didn't use the best coding pratice, and made due with ad-hoc way of making app work.  But now I need some help to fix my hacks.
    So the question is how can I dispatch and listen for actions at a single point (I know that dispatched actions are suppose to bubble up till they are heard, but that for some reason didn't work for me from the start).  And how to I create application wide variables so I can access them anywhere and at anytime in my app.
    Sorry for such a long post, and thank you very much for all your help
    Jaysheel.

    Hey Alex,
       The the app name is the exact same.  I have a file called virome.mxml which has my <mx:application> tag and my var "app" is of type virome.  I have check the spelling.  Any other ideas?
    oo good to know that I should try to avoid even bubbling, hehe at least I am doing something right.
    Jaysheel
    p.s if it helps here is the application tag
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    xmlns="*"
                    creationComplete="initApp()"
                    layout="absolute"
                    width="100%"
                    height="100%"
                    preloader="custom.preload.Preloader"
                    historyManagementEnabled="false"
                    modalTransparency="0.45"
                    modalTransparencyBlur="8"
                    modalTransparencyColor="#FF6600">
    and here is my declaration in utility.as
         public var app:virome = mx.core.Application.application as virome;   
         public const viromeLSO:SharedObject = SharedObject.getLocal("viromeLocalSharedObject");
         private var parsing:Boolean = false;
         public function Utility(){
              app = mx.core.Application.application as virome;

  • Is there any way to create a system-wide variable?

    Hello IDM gurus.
    Is there any way to create rarely changing system wide variables that can be loaded at system startup that will be available to all users? For example, at IDM system startup, the variables would be read from configuration or generic objects and live in memory for ALL users as opposed to each workflow/user having to read the same variables when the workflow is run.
    Any help would be appreciated.

    That may very well be the answer I'm looking for. Is there a way for that to be available within the entire application instead of having to read it in each workflow?

  • Setting a server wide variable at startup

    Anyone have a way to set a server wide variable (likely in
    the server scope) that gets set on server startup rather than in a
    specific page request via a cfset.
    What I would like to be able to do is set a variable external
    to any application that describes the servers role (ie.
    development, integration, staging, production) rather than
    hardcoding into the applications a test for server ip, name, etc.
    Thanks
    -Mike

    That's a new one. I can't think of anything internal to CF
    that would
    accomplish this.
    My first idea, assuming a windows world, you could do
    something in the
    services start that would call some resource that would set
    this for
    you. I have no idea how or know for sure this is possible.
    My second idea is what might be done in the Java
    underpinnings. Could
    something be done there.
    There are several xml files that are parsed at start up, but
    I have no
    idea how, if at all, extensible they are.

  • Application & Session variables

    how to store & use Application & Session variables in Seervlets & JSPs

    Hi
    how to store & use Application & Session variables in JSPSee: http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents.html
    how to store & use Application & Session variables in ServletsSee:
    http://java.sun.com/docs/books/tutorial/servlets/communication/attributes.html
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems inc.
    http://www.sun.com/developers/support

  • Creating class wide variable that gets re-initialized every time

    I declared a class-wide variable in my jsp document using the <%! %> tags:
    <%! boolean HasMoreRows = true %>
    I set this variable to false in one of the private jsp methods (also declared within <%! %> tags) when the program is supposed to terminate (there are no more rows left in my database result set).
    When I run the jsp document the first time after modifying it, it works fine. But if I hit the browser "back" button and then hit the "submit" button on the jsp page again to recreate the database result set, the HasMoreRows variable has the same value it had after the report ran the first time (that is, it is set to false).
    I think this has something to do with the way a servlet is created and re-used by the servlet container. I have to set the variable in a method so I cannot use a local variable (i.e. a variable declared inside <% %> tags). Does anyone know how to declare a variable that can be used anywhere inside the jsp document (including all methods) but gets reset to its initialization value every time the jsp document is run? Thanks.

    I think I figured out the solution. It is to declare the variable in the <%! %> tags but initialize it in the <% %> tags.
    <%! boolean HasMoreRows; %>
    <% HasMoreRows = true; %>

  • Application-wide "env-entry"

    Hi,
    I'm creating a J2ee application using various EJB's and at least one WAR, all inside one single EAR file.
    This app. is to be intalled at different clients. I'd like to be able to specify different properties ( server used, remote host addresses, etc.) in some part of the EAR that will be available using
    (String)context.lookup("java:comp/env/" + name );
    I have been able to customize individual EJB's using the <env-entry> tag in its DD but what about the being able to customize the whole application??
    I'm been scouring docs and the net and I can't see any specific application.wide examples.
    Many thanks for your help.
    Terry Doyle

    I faced the same problem some time ago. I went through the EJB 2.0 spec and the DTD of ejb-jar.xml. It appears that env-entry is for an EJB only. There is no 'global' env-entry.

  • Application scope variables ... an easier way or not ?

    Instead of sharing application scope variables through the
              servletContext()/application I am using a normal singleton class (or maybe
              static class) to share all my application varaiable. It works fine and it
              takes a lot less code to write.
              It seamed logical to do this a static classes or singletons are shared
              within a single servletContext/application (which there seems to be only one
              per WL instance anyway). (singleton is quite nice pattern coz. all
              jsp:useBeans with the application scope are by definition singletons)
              Has anoyne tried something similar or maybe know of the problem with this
              approach. I assume that server will never reinitialise application level
              variables ...... hope the assumption is correct. ....
              

    When you specify application scope, the JSP stores/retrieves the value
              into/from the servlet context. You may already know this, but it sounded
              like what you thought you were somehow avoiding.
              Cameron Purdy
              http://www.tangosol.com
              "Bohinc D" <[email protected]> wrote in message
              news:[email protected]..
              > Instead of sharing application scope variables through the
              > servletContext()/application I am using a normal singleton class (or maybe
              > static class) to share all my application varaiable. It works fine and it
              > takes a lot less code to write.
              >
              > It seamed logical to do this a static classes or singletons are shared
              > within a single servletContext/application (which there seems to be only
              one
              > per WL instance anyway). (singleton is quite nice pattern coz. all
              > jsp:useBeans with the application scope are by definition singletons)
              >
              > Has anoyne tried something similar or maybe know of the problem with this
              > approach. I assume that server will never reinitialise application level
              > variables ...... hope the assumption is correct. ....
              >
              >
              >
              

  • Are there application context variables on WebAS  like in tomcat?

    Hello @ all,
    can anyone tell me if there is a possibility to store variables in an application context on WebAS like in tomcat.
    I need this possibility to implement a connection pooling on a server wide basis. Where i thought of implementing a singleton to do the connection pooling and i wanted to store this in the application context of WebAS if there is one.
    Any hint or link to documentation would be very welcome.
    Thanks
    Tobi

    Hi,
    Since you are in the portal forum, I assume you have a portal installed.
    You can then create a portal service, which will function as a singleton for the application server. Note however that if you run a cluster of many application servers, each of them will have an instance of it.
    Dagfinn

  • WEB Application / Dynamic variable input / Prompts

    I've defined a variable on characteristic Currency with the following definition:
    Processing by              : User Entry/ Default Value
    Variable represents        : Single Value
    Variable entry is          : Optional
    Ready for input            : yes
    Can be changed in query nav: yes
    Default Value              : EUR
    This variable ist used in "Currency Translation" as "Target currency" (variables entry: yes)
    The query is used in a Web-Report that performs the following command by selecting currencies from a checkbox:
    url=SAP_BW_URL_Get() +"&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VAR_NAME_1=SL_CURR&VAR_VALUE_EXT_1=";
    url=url+value;
    (value is the code of the selected currency)
    Everything works pretty good, but opening the web-report I get a prompt window for the variable. How can I avoid this ?
    Changing the variable property <Ready for input : no> causes the effect that the dynamically changing of the variable doesn't work anymore. It seems that in this case always the default value of the variable is taken.
    The application should use the default value while opening the report, afterwards it should be possible to set the variable dynamically.
    Thank you very much for your ideas !!

    Hi Stefan,
    you can activate/deactivate the variable screen with parameter "Force Variable Screen" in your web template.
    bye

  • IP Application: Control variables management

    Hi experts;
    I have a BW IP 7.0 Application to plan our client budget. We've built several input querys, web models, etc. That objects are controlled by some variables, like ZPLANYEAR. Let me explain you: ZPLANYEAR is a characteristic value variable for 0FISCYEAR, manual entry type, but it's not ready for input. Its default value is the planning year.
    It is inside "Planning import" column of our queries, and it fixes the actual year that they are planning. Obviously, it must change each year, and it must change manually, i can not calculate it based on actual date.
    And finally, the requirement is that a user must be able to do that, and  in a friendly way of course...
    Does anyone know a user-friendly way to change the value of a variable, without entering BEX, or RSPLAN, etc???
    Thanks in advance

    Hi, Mayank.
    That's exactly what i'm doing as i post your message...but i have to be carefull with internal and external values, special BW codding for characteristic values with compounded infoobjects (like 0PROFIT_CTR with its 0CO_AREA code). I guess our users won't easily understand why they must enter a profit center value with its controlling area code before, or why must they inform a fiscal year/period value in YYYYPPP format...
    I still think about a function to change variable values, similar to
    RRS_VAR_VALUES_EXIT_FILL
    but for changing instead of reading...something more simple...something i can call in a small report
    Well, thanks a lot Mayank, but i still keep message open wondering for a suitable solution in this case...
    Has anyone else faced this situation before????

  • Flashbuilder and Cold Fusion  (using application/session variables)

    I would like to know if anybody uses Flashbuilder with Cold Fusion?
    Since Cold Fusion has lots of different scopes of variables (application, session, client, form, url, etc...) how do you manage this in Flex/Flashbuilder?
    Are there forums or groups specifically for using Flex3/Flashbuilder with backend server side technologies such as Cold Fusion?.
    The only server side technology that I have interest in is Cold Fusion.  I've seen basic tutorials and videos using Cold Fusion CFC's and data binding with Flex.  I haven't seen or heard anything using a Cold Fusion application, session, or client variable in Flex.
    Hopefully some of you have some experience on this topic.
    Thanks

    hey popster,
    i too had this question some time ago. my entire app was built on CF with HTML before i started integrating Flex 3 with it. i found that i needed to create cookie variables for all my session variables i was using in order to maintain and remember who the user was in my CFC calls. i also found that after i compiled a flex app, i changed the .html to .cfm (the file that loads the compiled SWF file). by doing this i was able to pass CF session variables into the flex app and you can refer to these anywhere in Flex by using Application.application.parameters.{variable name here} 
    add the CF variable in the FlashVars line to pass it into Flex (see the last line of code). this will create a variable (in my case i'm passing session.employeenumber). then in your flex app you can reference it by using Application.application.parameters.emplid:
    AC_FL_RunContent(
       "src", "Request",
       "width", "100%",
       "height", "87%",
       "align", "middle",
       "id", "Request",
       "quality", "high",
       "bgcolor", "#869ca7",
       "name", "Request",
       "allowScriptAccess","sameDomain",
       "type", "application/x-shockwave-flash",
       "pluginspage", "http://www.adobe.com/go/getflashplayer",
       "wmode","transparent",
       "FlashVars","emplid=<cfoutput>#session.employeenumber#</cfoutput"
    A little trick I learned (does Adobe really expect us to re-engineer how our apps have been working by no longer using sessions for Flex?). Then in your CFCs if you also create cookies for every session variable you can maintain the variables based on user login. HOPE THIS HELPS!
    -Matt

  • Changing the application wide default focus traversal policy

    Hi,
    I have a Swing application built using JDK1.3 where there lots of screens (frames, dialogs with complex screens - panels, tables, tabbed panes etc), in some screens layouts have been used and in other screens instead of any layout, absolute positions and sizes of the controls have been specified.
    In some screens setNextFocusableComponent() methods for some components have been called at some other places default focus traversal is used. (which I think is the order in which the components are placed and their postions etc). Focus traversal in each screen works fine.
    Now I have to migrate to JDK1.4. Problem now is that after migrating to JDK1.4.2, focus traversal has become a headache. In some screens there is no focus traversal and in some there is it is not what I wanted.
    So I thought to replace applicaiton wide default focus traversal policy and I did the following:
    ///////// Replace default focus traversal policy
    java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(new java.awt.ContainerOrderFocusTraversalPolicy());
    But there is no change in the behaviour.
    Then I tried following:
    ///////// Replace default focus traversal policy
    java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(new java.awt.DefaultFocusTraversalPolicy());
    I did all this in the main() method of the application before anything else just to ensure that all the components get added after this policy has been set. But no luck.
    Does someone has any idea what is the problem here ? I do not want to define my own focus traversal policy for each screen that I use (because thats lot of codes).
    Thanks

    not that hard if you only have the one focus cycle ( > 1 cycle and it gets a bit harder, sometimes stranger)
    import javax.swing.*;
    import java.awt.*;
    class Testing
      int focusNumber = 0;
      public void buildGUI()
        JTextField[] tf = new JTextField[10];
        JPanel p = new JPanel(new GridLayout(5,2));
        for(int x = 0, y = tf.length; x < y; x++)
          tf[x] = new JTextField(5);
          p.add(tf[x]);
        final JTextField[] focusList = new JTextField[]{tf[1],tf[0],tf[3],tf[2],tf[5],tf[4],tf[7],tf[6],tf[9],tf[8]};
        JFrame f = new JFrame();
        f.setFocusTraversalPolicy(new FocusTraversalPolicy(){
          public Component getComponentAfter(Container focusCycleRoot,Component aComponent)
            focusNumber = (focusNumber+1) % focusList.length;
            return focusList[focusNumber];
          public Component getComponentBefore(Container focusCycleRoot,Component aComponent)
            focusNumber = (focusList.length+focusNumber-1) % focusList.length;
            return focusList[focusNumber];
          public Component getDefaultComponent(Container focusCycleRoot){return focusList[0];}
          public Component getLastComponent(Container focusCycleRoot){return focusList[focusList.length-1];}
          public Component getFirstComponent(Container focusCycleRoot){return focusList[0];}
        f.getContentPane().add(p);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • Object Type as Application Level Variable

    I probably already know the answer to this but thought I would see if anyone has gotten to work or developed some sort of work-around.
    My question is, if I define an object type (create type ... as object ...) is it possible to hold a variable of this type as the session level? For example, if I am creating an order using multiple web pages, it would be much easier (and intuitive) to create and manipulate an order object than to hold the data in generic collections.
    If that is not possible, is there some way to make a generic Apex collection appear more application specific? By this I mean some way to map the columns C001, C002, ... to more intuitive names such as CUST_NO and ORDER_DATE. I had considered possibly creating a view of the APEX_COLLECTIONS view which would rename the columns but then I would also have to create a bunch of instead of triggers if I wanted to update it as well.
    Any thoughts or suggestions would be appreciated. Thanks,
    Mark

    Mark Wagoner wrote:
    I probably already know the answer to this but thought I would see if anyone has gotten to work or developed some sort of work-around.
    My question is, if I define an object type (create type ... as object ...) is it possible to hold a variable of this type as the session level? No. APEX session variables are stringly typed (perhaps the biggest single drawback of the framework).
    If that is not possible, is there some way to make a generic Apex collection appear more application specific? By this I mean some way to map the columns C001, C002, ... to more intuitive names such as CUST_NO and ORDER_DATE. I had considered possibly creating a view of the APEX_COLLECTIONS view which would rename the columns but then I would also have to create a bunch of instead of triggers if I wanted to update it as well.
    jarola wrote:It might that instead of trigger do not work for view where you query APEX_COLLECTIONS.Confirmed: +{message:id=10391521}+
    Don't waste your time on it.
    But you can create view to display data from APEX_COLLECTIONS and give generic columns meaningful alias.
    Then create own procedures where utilize APEX_COLLECTIONS package to make update/delete/insert.That's the approach I'd use as well.

  • Application wide connection pooling

    Just a quick question about connection pooling. How would one go about using application-side connection pooling? For example, I have multiple users logged into my application, all wanting to access the same database (with different username/password credentials). Is this possible? And if so, could someone provide a (brief) code snippet?
    Thanks in advance :)
    Ben

    Thank you for your replies. I understand everything that you have said, but I think that I will elaborate my question further just to make sure that I have everything the right way around in my head.
    My application defines a class called Product. This class represents a particular database schema/product. Within the Product class is the member variable;
        private transient ConnectionPoolDataSource connectionPool = null;
    When the product is constructed a platform-specific pooled datasource is created (either Oracle or MS SQL Server).
        com.microsoft.jdbcx.sqlserver.SQLServerDataSource ds = new com.microsoft.jdbcx.sqlserver.SQLServerDataSource();
    or
        oracle.jdbc.pool.OracleConnectionPoolDataSource ds = new oracle.jdbc.pool.OracleConnectionPoolDataSource();
    which is assigned to the aforementioned member variable.
    I also have a class called UserSpace which represents a user's work area. Multiple users can access the same product concurrently, and this is why I want to use connection pooling.
    A user will do a lot of work "in situ". What I mean by this is that the user will take some time to construct a SQL query, and while they do so their work area is updated with relevant information. When they have fully specified the query that they want to execute I want to be able to grab a connection from the relevant product's connection pool, execute the query, and then hand the connecton back (so that it can be used by someone else).
    To me it seems that this should be possible. Indeed I note that there is a method in the ConnectionPoolDataSource class called "getPooledConnection(String username, String password)". This suggests to me that username and password details can be set after the pool is created and that different connections in the pool can have differing user/password details and hence different access priviledges.
    Is this correct?
    Ben

Maybe you are looking for

  • Where we can link the vendor & Customer open and cleared iteams.

    Dear Experts,            Vendor & Customer open line iteam and clear line iteams tables is BSIK, BSID, BSIAK,BSAD, But where we can link the open iteam and clear iteam, what is the link table of open iteam and cleared iteam. And where we can link the

  • "An unspecified error occurred while performing a conform action on the following file:"

    Has anyone else gotten this error in any of their projects?  I've searched around Adobe support pages and elsewhere on the internet, but have found nothing. It comes up in the events window and I can't even read what file it's talking about because i

  • Bootcamp problem

    trying to install windows on my macbookpro (mac osx 10.7.5) using bootcamp and that message all what i have  (The disk cannot be partitioned because some files cannot be moved.) Back up the disk and use Disk Utility to format it as a single Mac OS Ex

  • Serial # does not work. Chat is always unavailable.

    Hello, 1. I bought Adobe Creative Suite 5 Design Standard in 2010. 2. I have not tried to initiate Adobe Premiere until now. 3. The serial number I had originally does not work. 4. I have already contacted help (from the registration screen) and rece

  • How can I make the file download expire like in SendNow?

    In Send Now, you can set up an expiration period for the document so that it is not just hanging out there. I do not see it on Adobe Now. Is this function still available?