States in Flex3

Hi,
I am currently using FlexBuilder3 and am perplexed with a case that I have --
I have two Radio Button groups
If we select a button, a child datefield component is created.
First thought, I decided to handle this with States.
But the problem is that if I select anything on the second radiobutton group, the child created for the first would disappear, which is rightly so.
My brain is hurting of the thinking that I have been doing all day and I request anyone who has been through such a problem message me back with their ideas.
Thanks,
Sai

Hi.
You can set properties with transistions there you can set visible true/false and includeInLayout true/false depending witch grid you want to view.
Or you can try using the ViewStack component.

Similar Messages

  • A query with respect to Flex 3 States

    Hi ,
    I am new to Flex3. states
    I have started with a sample application , but i couldn't able to understand some of the things in Flex 3 States . Please help .
    This is my sample Application what i am trying :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        currentState="bad">
        <mx:states>
            <mx:State name="bad">
                <mx:SetProperty target="{label1}" name="text" value="Bad Day!"/>
                <mx:SetProperty target="{linkbutton1}" name="label" value="Go Good"/>
                <mx:SetEventHandler target="{linkbutton1}" name="click" handler="this.currentState='vgood'"/>
            </mx:State>
            <mx:State name="vgood" >
                    <mx:SetProperty target="{linkbutton1}"  name="label" value="Go Good"/>
            </mx:State>
        </mx:states>
        <mx:Label
            x="255" y="191"
            text="Good Day !"
            fontWeight="bold"
            fontSize="22" id="label1"/>
        <mx:Button
            x="255" y="98"
            label="Go To Bad Day" 
            click="this.currentState='bad'" id="linkbutton1"/>
    </mx:Application>
    Please see the above code , It is working fine , but i am having some questions related to it .
    Please tell me whether  Is it possible to know under what state the Application is currently in ??
    Thnaks in advance .

    Okay fine , i will do that .
    I am having one more question related to flex 3 states . That is :
    Refering to the above program  posted , in case if i need to change the current state , i am depending on this
                <mx:SetEventHandler target="{linkbutton1}" name="click" handler="this.currentState='vgood'"/>
    Is it not possible to achive the above requirement using <mx:Property>
                <mx:SetProperty target="{linkbutton1}" name="label" value="Go Good" handler="this.currentState='vgood'"/>
    (I have tried with  this , but its not working , the mx:property is not accepting the handler attribute ) )
    seems Flex learning curve is so big .

  • Changing state of application from within a custom component

    Hello, I have several custom components all of which are included in the parent application.
    When I try to change state from a custom component, I get an error  saying "undefined state: state name". How do I change the state of the  application from within a custom component ? All the states are defined in the parent application.

    @linrsvp,
    If you are using Flex3 try Application.application.currentState = "somestate";
    If you are using Flex4 try FlexGlobas.topLevelApplication.currentState = "somestate";
    Don't forget to import the corresponding namespaces for the above.
    Thanks,
    Bhasker

  • 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

  • Complex View State handling

    Hi,
    I am trying to solve the following problem in Flex3:
    I have layout with 4 quadrants ["Ch" for Child component
    class]:
    Ch1 Ch2
    Ch3 Ch4
    If I click a button in ch4 [i.e. state ch4a], it is supposed
    to expand and cover Ch2, i.e.
    Ch1
    Ch4a
    Ch3
    Class Parent1 [inside Accordion]:
    VBox
    HBox1
    <view:Ch1 width="60%" />
    <view:Ch2 width="40%" />
    /HBox1
    HBox2
    <view:Ch3 width="60%" />
    <view:Ch4/>
    /HBox2
    /VBox
    So in class Ch4 I created a view stateA which is based on
    BaseState.
    A) What makes more sense, fire event in class Ch4 on that
    button click,
    capture it in Parent1 and somehow [how?] change a layout so
    that Ch2 is not there
    but twice higher Ch4a is instead of it and no second part in
    HBox2 ?
    I would guess, ActionScript instead of MXML or is there a way
    to express that in MXML?
    Or how should that ActionScript look like ?
    B) The other [easier] possibility is to get a handle to
    Parent1 [parent container]
    from the viewstateA of Ch4 and do something like:
    <SetProperty target={this.parent} name="y" value="0">
    Is it feasible? So far that didn't work for me. Any
    suggestions?
    Few other details:
    1) it's all in Cairngorm AIR app;
    2) that button in Ch4 is on one side a toggle button between
    view states,
    on the other side processing is completely different, but I
    can handle that through calling
    2 different private functions. I am saying only in one
    state[BaseState] that event should be fired.
    3) Background: Ch1 and Ch3 have lots of dropdowns, and what
    user selected would be displayed
    in Ch4A [that top portion], so user "Signs" that info, that's
    a point of the whole screen.
    Is there easy way to pass these selections to Ch4 ?
    As of now, it's all buried deep inside some complex obscure
    VOs .
    Any help is very appreciated.
    Thank you in advance,
    Oleg.

    The robot method is quite slow, and it can only capture images that are actually on the screen in the foreground. In any case, I stumbled on this article: [Performance Improvement Techniques for JavaFX Applications|http://javafx.com/docs/articles/performance/] that mentions the 'cache' member variable of a Node/Group can be used to tell the system to convert the Node to a bitmap (internally) for performance improvement. I haven't done any testing of my own, but it's an easy addition if you have a performance sensitive app.

  • And/or if statement in rtf templates.

    Hi all,
    I'm using XML Publisher 4.5.
    I have created a word template file (rtf) for my reports. I need to be able to show some content in the template file by using and and/or if statement.
    fx. <?if:doc_type='STANDARD'?> OR <?if:doc_type='DEFAULT'?>
    How can I do this?
    In advance thank you.
    Best regards
    Kenneth

    Hi D,
    Thank you for your answer.
    I have seriously thought about that solution; but I don't think it's a smart way to do it.
    If i do it like that, i need to copy the whole table and paste it inside the if statements.
    I have two xml elements that I need to make the decisions on. POH_PO_TYPE & CP_RELEASE_NUM.
    POH_PO_TYPE can be: STANDARD, RELEASE or BLANKET.
    CP_RELEASE_NUM can be: '' or N
    If POH_PO_TYPE is RELEASE AND CP_RELEASE_NUM is not ''
    OR POH_PO_TYPE is STANDARD
    OR POH_PO_TYPE is BLANKET AND CP_RELEASE_NUM is ''
    THEN show table (which contains the whole PO).
    It shall show the content of the PO in any of these cases.
    BR Kenneth

  • Filename in import statement

    Hi srinivas bobbala,
    Thank you for your response.But I think my quesition was not clear.My ques... is for suppose there is one datafile for importing like.. "datafile_21" Here my intention is it takes file from datafile_21 only but it appears in import statement like datafile_21<<curmon>>.
    import database sample.sample data from data_file "c:\\ABC\datafile_21_AUG.txt" using server rules_file datafile on error abort;
    In this it takes datafile from datafile_21.But it appears like datafile_21_AUG in import statement.This AUG coming from batch file.
    Essmsh c:\\ABC\loadmxl.mxl %curmon%

    No it is not possible.
    I assume the data file "datafile_21" is first renamed to datafile_21_${CurrMth} in the batchscript.
    After that this data file *datafile_21_${CurrMth}* is pointed in the import statement.
    In the logs you will see this file as datafile_21_Aug.

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • When would I use an if, for or while statement in Small Basic and what is the difference between the three?

    I have a Y9 Computer Science Exam next week and I know that this will probably be one of the questions on it so I need to know the answer. What is the difference?

    An If statement executes once IF the statement is true:
    If 1 = 2/2 Then
    Textwindow.writeline("True")
    EndIf
    A While statement executes WHILE the statement is true:
    While 4 = 2+2
    'Will keep looping while it is true
    EndWhile
    A For statement loops a number in increment:
    For i = 1 to 10
    'Every time through, i gets bigger by one until it equals 10
    EndFor
    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

  • If statement in sql

    regarding the following sql:
    SELECT a.lname, a.fname, a.user_id, c.address, c.city,
    c.zip, c.addresstypeid, d.descriptor as state
    FROM users a, address c, maintstatetype d
    WHERE a.user_id = c.user_id(+)
    AND c.statetypeid = d.statetypeid(+)
    AND c.addresstypeid in (1,2,3,4)
    I have a database of users and addresses. Each user can
    have multiple addresses and the addresses are
    designated by addresstypeid. In plain english, what I want
    to pull is "If they have an addresstypeid of 1, pull that one
    only, if not, check if they have a 2 and use that, if not, check
    for a 3, etc..".
    Any help with this?

    What you want, then, is to pull the address with the minimum addresstypeid ..
    SELECT a.lname, a.fname, a.user_id, c.address, c.city,
    c.zip, c.addresstypeid, d.descriptor as state
    FROM users a, address c, maintstatetype d
    WHERE a.user_id = c.user_id(+)
    AND c.statetypeid = d.statetypeid(+)
    AND c.addresstypeid =
    (select min(c2.addresstypeid)
    from address c2
    where c2.userid=a.userid
    I'm not sure what this will do to your outerjoin, though. You might have to get funky with a union ...
    SELECT a.lname, a.fname, a.user_id, c.address, c.city,
    c.zip, c.addresstypeid, d.descriptor as state
    FROM users a, address c, maintstatetype d
    WHERE a.user_id = c.user_id
    AND c.statetypeid = d.statetypeid
    AND c.addresstypeid =
    (select min(c2.addresstypeid)
    from address c2
    where c2.userid=a.userid
    Union all
    SELECT a.lname, a.fname, a.user_id, to_char(null), to_char(null),
    to_char(null), to_char(null), to_char(null)
    FROM users a
    WHERE not exists
    (select 1
    from address c
    where c.userid=a.userid
    )

  • 'IF' statement in a select statment?

    I have the following cursor in a package specification;
    cursor c_sales_code is
    select sales_condition||' MC '||sales_option
    from sales;This will return something like: 'T300 MC 9'
    MC means 'multiple choice' for when there are multiple options. Although, sales_option is sometimes null and in this case I just want 'T300' to be returned, not 'T300 MC'.
    How would I go about doing this?
    Thanks,
    fakelvis

    Use
    CASE and DECODE
    to add the functoinality of Conditional Statements in Your SQL Statements..
    These two CASE / DECODE will help you to get your desired output

  • IF Statement in Select

    I need to choose between value1 and value2 within a select statement.
    TableA
    Flag (char)
    Value1
    Value2
    ItemDesc
    pseudo code
    select ItemDesc, (if Flag = 'y' then Value1 else Value2) as Price from TableA;
    How can this be done?

    select   itemdesc,
             sum (case
                     when flag = 'y'
                        then (case
                                 when value1 < 10
                                    then value1 * 1.2
                                 else value1
                              end)
                     else value2
                  end
                 ) as price
        from tablea
    group by itemdesc;

  • If statement in select statement alias

    I have the following select statement. It has the alias Survivors, Deaths and "All Cases". Is it posible to use :P_LANGUAGE variable to say that -- IF :P_LANGUAGE = FRENCH THEN alias are Survivants for survivors, Décès for Deaths, Tous_les_cas for All Cases. Please advise
    SELECT ALL T_NTR_MULTIBAR.CAT, T_NTR_MULTIBAR.NUM_CASES_LEFTBAR AS Survivors,
    T_NTR_MULTIBAR.NUM_CASES_MIDDLEBAR AS Deaths, T_NTR_MULTIBAR.NUM_CASES_RIGHTBAR AS "All Cases"
    FROM T_NTR_MULTIBAR
    WHERE INSTANCE_NUM = :P_INSTANCENUM
    order by ORDERS

    You may not be able to add this condition inside the SQL Statement. But you can add this condition outside the statement, if you're using PL/SQL...
    IF :p_language = french THEN
    SELECT ALL t_ntr_multibar.cat,
      t_ntr_multibar.num_cases_leftbar AS survivors,
      t_ntr_multibar.num_cases_middlebar AS deaths,
      t_ntr_multibar.num_cases_rightbar AS "All Cases"
    ELSE
    END IF;

  • If Statement in PLD

    I'm trying to set up a formula similiar to an If then statement with the PLD, and not having any luck.   I need to create a formula on a sales order that says if  there is no frieght on the order display "0.00". 
    Thanks.
    Eric

    Hi,
    Create a field with empty value (Say field ID is 100).
    Create a formula field which equals fields 100 and 186 (Say field ID is 101).
    Create a formula field which has "not equals" as relation, within fields 100 and 186 (Say field ID is 102).
    Create a field with the text 0. Link it with the field 101. Put it in the same place as the 186.
    Link the 186 field with the 102.
    Result: 0 will be shown when 186 is empty, value of 186 when is not empty.
    Hope is clear,
    Ibai Peñ

  • If statement in Custom Calculation Script

    I have 16 fields and if even one of them ="1" I have to list it in another field.  I do not want to count or sum.  If one of those fields has a 1 in it I just want the other field to display Y and if none have a 1 I want that field to display N.
    Please help.
    Thank you in advance~mjc

    You need to write a compound logical statement to evaluate all of the values and that statement needs to evaluate to true or false.
    Do you know how to write JavaScript?
    Do you know how to enter JavaScript calculations into a form field?
    For custom calculation of the text field I could write something like:
    // define an array of the field names to check
    var aNames = new Array("Text1", "Text2", "Text3", "Text4",
    "Text5", "Text6", "Text7", "Text8",
    "Text9", "Text10", "Text11", "Text12",
    "Text13", "Text14", "Text15", "Text16");
    // define a logical variable that is true if any field has a value of 1 - default is false or no field has a value of 1
    var bMatch = false;
    // value for text field
    var TextValue = 0;
    // logical value of field being equal to 1 test
    var FieldIs1 = false;
    // loop through all the fields and test the fields value
    for(i = 0; i < aNames.length; i++) {
    // logically OR the result of field i value equal to true with bMatch
    // get the value of field
    TextValue = this.getField( aNames[i] ).value;
    // test the value of the field
    FieldIs1 = Number(TextValue) == 1
    // logically OR the 2 values
    bMatch = FieldIs1 | bMatch;
    } // end field processing
    // set the field value
    if(bMatch == true) {
    event.value = "Y";
    } else {
    event.value = "N";
    You will need to change the field names to match your fields. You can add more field name or remove field names as needed and the script will adjust for the number of field names.

Maybe you are looking for

  • HP Laserjet P1102w - Right side margin cut off when printing in Internet Explorer 9! URGENT PROBLEM*

    Hi, I have just purchased a new printer (HP Laserjet P1102W), and when I print a web page in Internet Explorer 9, the footer (I set to the URL) does not print at all and the header will print though the right hand edge of my entire web page is cut of

  • Self Assigned IP Mayhem

    Hi Everyone, I've fallen prey to the dreaded Self Assigned IP Problem. After spending the majority of the day scouring this community and a few others, I've come to realize it's a common (if not exasperating) issue. Here are the specifics: - MacBook

  • Email accounts now showing

    Since the ios7 update one or two of the email accounts I have on my iPhone 4s are not showing up in mail, however when I go into Settings>Mail, the accounts are there. I have tried deleting the accounts and setting them up again but it still happens.

  • After upgrade from 11.5.10 to 12.1.3 unable to view picture in people form

    After upgrade from 11.5.10 to 12.1.3 unable to view picture in people form An error msg "You do not hava access to perform this action" is displayed Can anyone pls help me to resolve this issue Thanks

  • How to get WRT54GS2 to assign a static IP?

    I have a PAP2 VOIP adapter plugged into my Linksys WRT54GS2 router. The problem is the router assigns the PAP2 a new dynamic IP every couple days, which messes up my port forwarding settings. So I need to tell the router to assign the PAP2 a static I