Why we need State?

Hi, dear all,  I am reading what's new in flex4 these days, and found the states has some big changes in flex4 rather then flex3, but I can not realize what is the benefits with use states? actually all state does is to add/remove some components, or make some changes on a compnent, but I can even do that with turn on/off the component's visible settings, or change some other properties, so why state?  I know there must be the reason that flex provide the states, and make it more easy to use. can some body give me some prompt abouth this?  Regards, Mike.

Thanks for your response EvyatarBH and Kumar Pratik.
I think in the case EvyatarBH said, yes, it was much easier to set propertie values on differents states.
If there are lot of state, and the controls always to be different size, then this may replace dozened of if...else..(s)
For the example Kumar gave out, actually I understood what was the point.
But I think that may only works when the "general" and "admin" page looks very similar.
Otherwise we may need to maintains a lot of controls and logics in one component, that will be much difficult I think.
Not sure if my understanding 100% correct, welcome for more replies.
Again, thanks for your answers, any better suggestions, please keep on.
Regards,
Mike

Similar Messages

  • Why would it state under the "more about this mac" that i already have10.8.3 and then in the app store say i need to "resume" do you know what i mean? is it possible i already did download mountain lion entirely once? I am confused and don't want it twice

    why would it state under the "more about this mac" that i already have10.8.3 and then in the app store say i need to "resume" do you know what i mean? is it possible i already did download mountain lion entirely once? I am confused and don't want it twice

    This is cause by the way the App Store checks to see if an application is installed on your system.
    Basically when an app is installed it is in the Applications folder and this is where the MAS looks for them. So it looks at your purchase history for the apps you bought and looks in the Applications folder to see if they are installed. If an app is in your purchase history but not in the Applications folder the MAS says you need to install it.
    For normal apps this works fine but the OS doesn;t install into the Applications folder. So the MAS sees you have Mountain Lion in your purchase history but it's not in the Applications folder and so it says you need to download it.
    Hopefully one of these days Apple wil fix this.
    regards

  • Why to need close the result set and statement

    why to need close the result set and statement

    It's best to explicitly close every ResultSet, Statement, and Connection in the narrowest scope possible.
    These should be closed in a finally block.
    Since each close() method throws SQLException, each one should be in an individual try/catch block to ensure that a failure to close one won't ruin the chances for all the others.
    You can capture this in one nice utility class, like this:
    package db;
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.Map;
    import java.util.LinkedHashMap;
    import java.util.List;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    * Created by IntelliJ IDEA.
    * User: MD87020
    * Date: Feb 16, 2005
    * Time: 8:42:19 PM
    * To change this template use File | Settings | File Templates.
    public class DatabaseUtils
         * Logger for DatabaseUtils
        private static final Log logger = LogFactory.getLog(DatabaseUtils.class);
        /** Private default ctor to prevent subclassing and instantiation */
        private DatabaseUtils() {}
         * Close a connection
         * @param connection to close
        public static void close(Connection connection)
            try
                if ((connection != null) && !connection.isClosed())
                    connection.close();
            catch (SQLException e)
                logger.error("Could not close connection", e);
         * Close a statement
         * @param statement to close
        public static void close(Statement statement)
            try
                if (statement != null)
                    statement.close();
            catch (SQLException e)
                logger.error("Could not close statement", e);
         * Close a result set
         * @param rs to close
        public static void close(ResultSet rs)
            try
                if (rs != null)
                    rs.close();
            catch (SQLException e)
                logger.error("Could not close result set", e);
         * Close both a connection and statement
         * @param connection to close
         * @param statement to close
        public static void close(Connection connection, Statement statement)
            close(statement);
            close(connection);
         * Close a connection, statement, and result set
         * @param connection to close
         * @param statement to close
         * @param rs to close
        public static void close(Connection connection,
                                 Statement statement,
                                 ResultSet rs)
            close(rs);
            close(statement);
            close(connection);
         * Helper method that maps a ResultSet into a map of columns
         * @param rs ResultSet
         * @return map of lists, one per column, with column name as the key
         * @throws SQLException if the connection fails
        public static final Map toMap(ResultSet rs) throws SQLException
            List wantedColumnNames = getColumnNames(rs);
            return toMap(rs, wantedColumnNames);
         * Helper method that maps a ResultSet into a map of column lists
         * @param rs ResultSet
         * @param wantedColumnNames of columns names to include in the result map
         * @return map of lists, one per column, with column name as the key
         * @throws SQLException if the connection fails
        public static final Map toMap(ResultSet rs, List wantedColumnNames)
            throws SQLException
            // Set up the map of columns
            int numWantedColumns    = wantedColumnNames.size();
            Map columns             = new LinkedHashMap(numWantedColumns);
            for (int i = 0; i < numWantedColumns; ++i)
                List columnValues   = new ArrayList();
                columns.put(wantedColumnNames.get(i), columnValues);
            while (rs.next())
                for (int i = 0; i < numWantedColumns; ++i)
                    String columnName   = (String)wantedColumnNames.get(i);
                    Object value        = rs.getObject(columnName);
                    List columnValues   = (List)columns.get(columnName);
                    columnValues.add(value);
                    columns.put(columnName, columnValues);
            return columns;
         * Helper method that converts a ResultSet into a list of maps, one per row
         * @param rs ResultSet
         * @return list of maps, one per row, with column name as the key
         * @throws SQLException if the connection fails
        public static final List toList(ResultSet rs) throws SQLException
            List wantedColumnNames  = getColumnNames(rs);
            return toList(rs, wantedColumnNames);
         * Helper method that maps a ResultSet into a list of maps, one per row
         * @param rs ResultSet
         * @param wantedColumnNames of columns names to include in the result map
         * @return list of maps, one per column row, with column names as keys
         * @throws SQLException if the connection fails
        public static final List toList(ResultSet rs, List wantedColumnNames)
            throws SQLException
            List rows = new ArrayList();
            int numWantedColumns = wantedColumnNames.size();
            while (rs.next())
                Map row = new LinkedHashMap();
                for (int i = 0; i < numWantedColumns; ++i)
                    String columnName   = (String)wantedColumnNames.get(i);
                    Object value = rs.getObject(columnName);
                    row.put(columnName, value);
                rows.add(row);
            return rows;
          * Return all column names as a list of strings
          * @param rs query result set
          * @return list of column name strings
          * @throws SQLException if the query fails
        public static final List getColumnNames(ResultSet rs) throws SQLException
            ResultSetMetaData meta  = rs.getMetaData();
            int numColumns = meta.getColumnCount();
            List columnNames = new ArrayList(numColumns);
            for (int i = 1; i <= numColumns; ++i)
                columnNames.add(meta.getColumnName(i));
            return columnNames;
    }Anybody who lets the GC or timeouts or sheer luck handle their resource recovery for them is a hack and gets what they deserve.
    Do a search on problems with Oracle cursors being exhausted and learn what the root cause is. That should convince you.
    scsi-boy is 100% correct.
    %

  • 1.how can I interpret meaning of TARGET  STATE   in output of command crsctl stat res -t  2. what exactly is nodeapps and why it need to be stopped before any maintenanace activity.

    I have two question requesting from the Gurus.
    1.how can I interpret meaning of TARGET  STATE   in output of command crsctl stat res -t  2. what exactly is nodeapps and why it need to be stopped before any maintenance activity. 

    I'd tried deleting my user preferences before, and it didn't seem to help. However, I tried again, and also removed the couple of actions I'd had in ~/Library/Automator. Success! Just for good measure, I tried putting the actions back and restoring the old preferences file, and everything still worked. Huh. But that's the nature of these things, I guess. At least it works now, thanks!

  • Why this select statement is failing

    Hi to all experts.
    Im not able to understand why this select statement is not fetching the record with this parameters. When i give the same parameters in se11 table t512w.. It has one record, but here the sy-subrc Value is 4.
    select  * from t512w where molga EQ '15'
             and lgart in g_lgart01
           and endda gt pn-endda
       and begda lt pn-endda.

    Dear Mohamed,
    This Select Statement is bound to Fail. When you are doing a select * from T512W, you intend to get a single record from T512W into the work area T512W which you have declared using TABLES statement. So, here you need to use Select single instead of Select *
    If you want more data, then you declare an internal table, say gt_t512w type standard table of t512w and use "
    Select from T512W
    Into TABLE GT_T512W
    WHERE ........
    Hope this solves your problem.
    Regards,
    Amit Sharma

  • Why we need BPM Exactly

    Hi All,
    Why We Need BPM Exactly in XI .
    Please Explain me Clearly & Give me the Answer in the Interview Perspective
    Regards
    Vamsi

    Hi Vamsi,
    BPM provides you...."<b>Stateful Integration</b>"....these two words are enough to satisfy any interviewer...:-)
    1) Collecting of messages till a certain count
    2) Merging messages
    3) Splitting messages
    4) Processing of error files
    5) Parallel Processing etc..
    Kindly look at the above examples shared by one of our friend......
    Lets take first case...
    we want to collect 100 messages and when we have collected 100 messages the only want to proceed...here collection of 100 messages is a state...
    Similarly we can make the scenario stateful on the basis of a particular time, time period...etc...
    for practical example...plz go through BPM patterns under basis objects...where you can see collect patterns,sync/Async bridge...very beautiful examples...to under the need of BPM...
    Regards,

  • Why we need XML?

    hi,
    Why we need XML.?(we have ascii file format is a gentral format, to access all plateform,why not we didn't follow.?)
    like XML:
    <contact>
    <name> java</name>
    <age>25</age>
    </contact>
    flat files:
    contact name:java age:25
    i feel flat file is small and easy .....why we didn't use it.........?

    PS - Jos, how's the weather in your garden today?
    (Rainy and cool here.) Well picture this: both of my parrots are trying to
    sleep in their own hollow
    coconut, slightly disturbed by some silly squeaky
    bird at the other side
    of the barn. The fish in the pond are sort of
    sunbathing between the
    floating leafs, my wife seems to be in a catatonic
    state sleeping all the
    time and then there's me in front of my little laptop
    (protected by a silly
    little green umbrella like thingy, the laptop that is
    ;-)A nice image indeed.
    It's been one wet spring here. It's very cool and overcast, threatening more rain. I'm sitting in my office working away on getting my head around Spring. I've been going through Rob Harrop's "Pro Spring" slowly and carefully, making all the code work and taking little side trips to set it into my head. Rod Johnson's team is doing a great job, in my opinion.
    I still feel that the Spring framework, the web part
    of it, is as some sort
    of a corset, a hindrance. I feel like I'm all
    dressed up but nowere to go
    because Spring or something else I don't know about
    forbids me ... I
    know that I have it wrong alltogether but I can't get
    a grip on it. Not sure what the impediment is, but then I don't understand all the nuances of Spring yet. Maybe their newer web flow stuff might help. It models a UI as a state machine, so you can do more complex flows from page to page. The finite automata underneath will appeal to your inner mathematician. 8)
    btw. it's in
    the lower thirties here (celcius); that makes it in
    the lower nineties (fahrenheit).
    btw, YoGee helped me a lot yesterday.No surprise there. YoGee sure is smart. While I was reading the thread I wished that I had seen it first. You've been so helpful to me so often that I would have enjoyed reducing the trade deficit I have with you. I know that particular problem with Tomcat and JSTL well.
    Yep, I'm working on a large ('Dutch-wise' speaking
    that is) optic fibre
    network. Technically this network works great.
    Managerially speaking
    ahem there's nothing yet: no services, no control
    of services, no
    network checking stuff, no customer (crm) stuff, no
    nothing. Those folks
    want me to do it all. Sounds like a great problem. Could be an engagement to carry you through the summer.
    Yes, that particular part gave me blood behind my
    eyes: I did everyhing
    according to the book and that crap simply refused to
    work. It turned out
    that I was trying to develop something against wrong
    versions of several
    components. In a certain way I'm a believer, i.e.
    when I finally do understand
    what it's all about I "walk this way" when the
    documentation tells me to
    "walk this way". When that turns out not to work at
    all I want my pink
    inflatable axe again (or worse ;-)I like Tomcat, but I think the docs are sketchy. This seems to be a common problem.
    No, I feel reluctant to introduce yet another
    technology while I'm still
    struggling with the ones I found necessary to use.Me, too. I'm overwhelmed by all that I don't know. That's why I'm taking the time to get all the way through Spring once. I've been reading and dabbling, but I haven't given it enough concentrated attention to have it under my fingers. I've got three personal projects lined up once I get through "Pro Spring" that should set it into my head nicely.
    <advertisement>
    By the way, I decided to buy a copy of IntelliJ. I've never paid for an IDE, but since I've gotten used to it at work I don't want to be without it. I've never championed an environment as much as I do this one. I used Eclipse for several years and was glad to have it, but I'd still find myself slipping out and using a text editor to do quick things. IntelliJ doesn't get in my way. It's completely eliminated any temptation to use a text editor. A terrific product that's only getting better with time.
    </advertisement>
    <disclaimer>I'm not related to anyone who works for or affiliated with JetBrains in any way. Just a happy customer.
    </disclaimer>
    I'm not a GUI guy myself, far from that and I'd like
    to stay away from it as
    far as possible. As I wrote above I feel "all dressed
    up but nowhere to go".
    I've got my beans all ready, my DataSources are all
    solid and sound; I
    can see that everything works (from the logs), but
    that darn web stuff
    keeps on pestering me ...I think the UI is always the hardest part. Everything from the service layer back can almost be generated from the beans and tables: Hibernate mappings, DAOs, service layer, JUnit tests for the whole thing. A few nice annotations and you've got the whole thing. Just the UI beast left to tame...
    >
    I think I'll take another Grolsch and chase that
    silly squeaky bird away.
    Enjoy your weekend!
    kind regards,
    JosYou too! Go enjoy some World Cup football!
    %

  • Why we need two Joins (Left and Right)

    Hi,
    Why we need two joins while we can do it just by replacing the tables?
    Query 1.
    SELECT e.ename, d.dname
    FROM emp e LEFT JOIN dept d ON e.deptno = d.deptno ;
    Query 2.
    SELECT e.ename, d.dname
    FROM emp e RIGHT JOIN dept d ON e.deptno = d.deptno ;
    The same result of Query 2 can be get from following query with LEFT JOIN.
    Query 3.
    SELECT e.ename, d.dname
    FROM dept d LEFT JOIN emp e ON e.deptno = d.deptno ;
    So why we need LEFT and RIGHT Joins while we can do this by just replacing tables position ( as in Query2 and Query3).
    Regards,
    Danish

    Danish wrote:
    Any other suggestions?What do you find lacking in the answers that have been suggested so far?
    Why would you restrict the syntax so that you only had one of the two syntax options? That forces developers to write queries in a particular way. If you only had a LEFT OUTER JOIN operator, for example, the first table would always have to be the one that drove the number of rows in the result set. Sometimes (most of the time in my experience), that's a sensible way to approach the problem. But occasionally you get problems where you want to start with the sparse tables and join to the denser tables and having the RIGHT OUTER JOIN makes it much easier to approach the problem that way.
    Re-ordering the tables in a query using ANSI syntax is also not necessarily a trivial endeavor. If you're working on building up a query (i.e. join 3 tables, verify the results, join a fourth table, verify the results, etc.) it's potentially non-trivial to change the order of the tables-- you may find that you've inadvertently changed the semantics of your query and now you have to backtrack a bit to verify the new logic.
    It's also the same reason that you have multiple ways to write a loop or multiple ways to iterate through a collection. While it's completely possible to rewrite any loop in the form
    LOOP
      <<do something>>
      EXIT WHEN <<something>>
      <<do something else>>
    END LOOP;that's not always the clearest way to express a piece of logic. Generally, a nice FOR loop or a nice WHILE loop is simply a clearer and cleaner solution. Similarly, sometimes a LEFT OUTER JOIN is a clearer way of expressing a SQL statement and sometimes a RIGHT OUTER JOIN is a clearer way of expressing it.
    Justin

  • HT4910 i save my photos to camera roll. then back up but can't see it on icloud. why? we just lost 300 photos on my other iphone because we do not get proper help. that's why i need to learn now.

    i save my photos to camera roll. then back up but can't see it on icloud. why? we just lost 300 photos on my other iphone because we do not get proper help. that's why i need to learn now.

    You can't view your back up files at icloud.com.
    You can't view your camera roll and you can't view your Photo Stream files at icloud.com.
    The icloud back up plan allows you to "restore" your iOS device from the files you backed up at icloud.com.

  • I am not able to register my Apple ID for iCloud and the error is "the maximum no of free accounts have been activated on this phone" can any one help me why I need to do

    I am not able to register my Apple ID for iCloud and the error is "the maximum no of free accounts have been activated on this phone" can any one help me why I need to do

    Sir, your Apple ID can be used as an iCloud account as well. They are both the same thing.
    You can learn more from --> Set up your Apple ID for iCloud and iTunes - Apple Support

  • Can you give me some reasons about why I need to buy an iPod touch 5.Although I have the iPhone ,iPod nano, iPad ,MacBook pro,I think the iPod touch 5 is so attractive that I can't help buying it at once.If I have it,what I can do with it,can you tell me?

    can you give me some reasons about why I need to buy an iPod touch 5.Although I have the iPhone ,iPod nano, iPad ,MacBook pro,I think the iPod touch 5 is so attractive that I can't help buying it at once.If I have it,what I can do with it,can you tell me?

    All I can say is that I REALLY like my Touch 4th gen because I have all sorts of capabilities in a small form: e-mail, web browsing, news, weather, books, magazines, etc. etc.  Plus lots and lots of apps out there, including so many free ones.  I use the Cloud a lot so it's great to have everything sync'd to my MacBookPro (e-mail, Evernote, Pocket, etc.)
    It would be easier, though, to do some of this, especially magazines, on the iPad mini, but, again, I love the small size of the Touch. 
    As for the 5th gen instead of the 4th, the fifth has Siri and the 3D feature in maps, which are great.  And I'm sure it's a lot faster in iOS 6 than the 4th gen.  And cool colors! 
    Don't know if this helps . . .

  • IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan

    Hi Experts,
    IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan for Daily/weekly??
    Vinai Kumar Gandla

    Hi Vikki,
    Many systems rely solely on SQL Server to update statistics automatically(AUTO UPDATE STATISTICS enabled), however, based on my research, large tables, tables with uneven data distributions, tables with ever-increasing keys and tables that have significant
    changes in distribution often require manual statistics updates as the following explanation.
    1.If a table is very big, then waiting for 20% of rows to change before SQL Server automatically updates the statistics could mean that millions of rows are modified, added or removed before it happens. Depending on the workload patterns and the data,
    this could mean the optimizer is choosing a substandard execution plans long before SQL Server reaches the threshold where it invalidates statistics for a table and starts to update them automatically. In such cases, you might consider updating statistics
    manually for those tables on a defined schedule (while leaving AUTO UPDATE STATISTICS enabled so that SQL Server continues to maintain statistics for other tables).
    2.In cases where you know data distribution in a column is "skewed", it may be necessary to update statistics manually with a full sample, or create a set of filtered statistics in order to generate query plans of good quality. Remember,
    however, that sampling with FULLSCAN can be costly for larger tables, and must be done so as not to affect production performance.
    3.It is quite common to see an ascending key, such as an IDENTITY or date/time data types, used as the leading column in an index. In such cases, the statistic for the key rarely matches the actual data, unless we update the Statistic manually after
    every insert.
    So in the case above, we could perform manual statistics updates by
    creating a maintenance plan that will run the UPDATE STATISTICS command, and update statistics on a regular schedule. For more information about the process, please refer to the article:
    https://www.simple-talk.com/sql/performance/managing-sql-server-statistics/
    Regards,
    Michelle Li

  • Why we need ABAP if we can connect With Crystal Reports to SAP R/3

    Hi,
        I am new to Crystal reports.I came to know that we can connect SAP R/3 by using SAP InfoSet,SAP Table Cluster and Function connectivity in Crystal Reports.So we can generate reports for SAP R/3 database with out need of ABAP.So why we need to go ABAP module.Is there any disadvantages if we dont use ABAP to generate reports or we can use always Crystal Reports to generate Reports for R/3 database?

    Hi,
    it is correct that you can built a Crystal Report without the need to use ABAP, but we have lots of customers that have invested over the years into ABAP Routines and Crystal REports is able to leverage those as well. So with Crystal Reports you have the choice to leverage existing ABAP Functions as a source for reporting - which might help to leverage complex processing on the backend - or to use InfoSets and tables.
    regards
    Ingo

  • Why I need a code for rent a film and where ist the code? (I dont have a card)

    Why I need a code for rent a film and where ist the code? (I dont have a card)

    it's unclear what you mean
    you say you dont have a card which I guess is you don't have a creditcard
    in which case the other option is to pay by a giftcard which include a code which you put in
    because to rent you have to pay otherwise it's not really renting

  • Why we need Java Class in c++ pof Serialization

    Hi,
    I'm really confused why we need java class which implements PortableObject to support complex objects of c++. If we are not using any queries or entry processors in the application can't we keep the object as serialized byte format and can't we retrieve in from the c++ deserialization.
    Please share your thoughts if there's a way if we can skip any Java implementation.
    regards,
    Sura

    feel both are doing same work. Also can anyone tell me what is teh difference between Serilization and Exgternalization.If you need someone to tell you the difference, (a) how can you possibly 'feel both are doing the same work'? and (b) why don't you look it up in the Javadoc?
    It's not a secret.

Maybe you are looking for