How change application´s state from a component´s function

Hi, I´m doing an Flex application,
I have created a component "usersRegister", that have next
function:
private function comprobacionBBDD():void{
if(numero>0){
mensaje="Perfect.\n\n\n Wellcome.";
HERE I WANT CHANGE THE STATE
}else if(numero==-1){
mensaje=mensaje+"error1";
}else if(numero==-2){
mensaje=mensaje+"Error2 \n\n";
Alert.show(mensaje);
The problem is that when in my application I instances the
component, I would like to change my application´s state when
the first "if" from the function is true.
Can you help me??
thanks in advance, and excuse my bad english.

Really thanks. I have try it and works perfectly.

Similar Messages

  • Change base view state from a custom component

    I'm pretty new to flex and I'm having a small issue in change the view state from a component.
    My Application have 2 custom components called userlogin and main menu. In the main application page I have userlogin component in one state and the main menu component in another. I'm trying to change the state if the login in successful from user login to main menu. I have the following function written inside the login component.
    private function IsUserLoggedIn(evt:ResultEvent):void
                    if (evt.result.islogin.toString() == "true")
                        currentState = "MainMenu";
                    else
                        Alert.show("Login failed, please try again.", "Login Failed");
    This code worked when I had all the controls in the main page. But then I created components and included them in to components and now when the login is success, its giving the following error.
    ArgumentError: Undefined state 'MainMenu'.
        at mx.core::UIComponent/getState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UI Component.as:9908]
        at mx.core::UIComponent/findCommonBaseState()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9928]
        at mx.core::UIComponent/commitCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:9750]
        at mx.core::UIComponent/setCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\ core\UIComponent.as:9701]
        at mx.core::UIComponent/set currentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6087 ]
        at components::UserLoginForm/__btnSubmit_click()[C:\Projects\WarrantyAutomation\src\componen ts\UserLoginForm.mxml:60]
    I'm sure this has something to do with accessing the states from a custom component, but I do not know how to change the state to the main menu. Please help me with this. Any help is greatly appriciated.

    Hi dasun1981,
    private function IsUserLoggedIn(evt:ResultEvent):void
                    if (evt.result.islogin.toString() == "true")
                        currentState = "MainMenu";
                    else
                        Alert.show("Login failed, please try again.", "Login Failed");
    If I am right the above function is in your userlogin component and the two components "userlogincomponent" and "maincomponent" are in main application file and the states were also defined in main application file.
    But in the function above the currentState refers to the state of the userlogin component and not the main application ...but the states are defined in main application file...that's the reason why the exception was thrown...
    Instead you replace the line in the above function with the below line:
    Application.application.currentState = "MainMenu";
    Please mark it as answer if it helped you.
    Thanks,
    Bhasker Chari

  • Is it possible to change application state from a component?

    I was wondering if it is possible to change application state from within a custom component and if so, what would the syntax be if I had an application named "zzz" and I wanted to change the app state from "state1" to "state2" from my component?
    Thanks!

    Hi,
    you always have a static class Application.
    Application.application will be the root component. After that you can change it state.
    Application.application.currentState = "state2";
    But it's not the best way to change states. It's better to dispatch events from components and change states in listeners.

  • Shrink Log file in log shipping and change the database state from Standby to No recovery mode

    Hello all,
    I have configured sql server 2008 R2 log shipping for some databases and I have two issues:
    can I shrink the log file for these databases: If I change the primary database from full to simple and shrink the log file then change it back to full recovery mode the log shipping will fail, I've seen some answers talked about using "No
    Truncate" option, but as I know this option will not affect the log file and it will shrink the data file only.
          I also can't create maintenance to reconfigure the log shipping every time I want to shrink the log file because the database size is huge and it will take time to restore in the DR site, so the reconfiguration
    is not an option :( 
    how can I change the secondary database state from Standby to No recovery mode? I tried to change it from the wizard and wait until the next restore for the transaction log backup, but the job failed and the error was: "the step failed". I need
    to do this to change the mdf and ldf file location for the secondary databases.
    can any one help?
    Thanks in advance,
    Faris ALMasri
    Database Administrator

    1. can I shrink the log file for these databases: If I change the primary database from full to simple and shrink the log file then change it back to full recovery mode the log shipping will fail, I've seen some answers talked about using "No Truncate"
    option, but as I know this option will not affect the log file and it will shrink the data file only.
          I also can't create maintenance to reconfigure the log shipping every time I want to shrink the log file because the database size is huge
    and it will take time to restore in the DR site, so the reconfiguration is not an option :( 
    2. how can I change the secondary database state from Standby to No recovery mode? I tried to change it from the wizard and wait until the next restore for the transaction log backup, but the job failed and the error was: "the step failed". I need to do
    this to change the mdf and ldf file location for the secondary databases.
    can any one help?
    Thanks in advance,
    Faris ALMasri
    Database Administrator
    1. If you change recovery model of database in logshipping to simple and back to full Logshipping will break and logs wont be resored on Secondary server as log chain will be broken.You can shrink log file of primary database but why would you need that
    what is schedule of log backup. Frequent log backup is already taking care of log files why to shrink it and create performance load on system when log file will ultimately grow and since because instant file initilaization is not for Log files it takes time
    to grow and thus slows performace.
    You said you want to shrink as Database size is huge is it huge or does it have lots of free space. dont worry about data file free space it will eventually be utilized by SQL server when more data comes
    2. You are following wrong method changing state to no recovery would not even allow you to run select queries which you can run in Standby mode. Please refer below link to move Secondary data and log files
    http://www.mssqltips.com/sqlservertip/2836/steps-to-move-sql-server-log-shipping-secondary-database-files/
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Change the Production state of Software Component in SLD

    Hello,
    I cannot see the list of software component to add in Dev Configuration because the Production State of software component is in Planned state and to appear in the list it should be in Devlopment state.
    How do I change the state. When I login to SLD i dont see the edit mode to change it.
    Thanks
    PS: I did not realize there is separate NWDI forum.  I also asked the same question in Web Dynpro forum.

    Hi,
    if the question is about, why the custom developed software is not visible in "CMS - Landscape Configurator - Track Data tab" when pressing the button "Add SC...", then please answer:
    Did you trigger "Update CMS" after creating the software in SLD? You can do it in the CMS webui - Landscape Config - Domain Data tab.
    Best Regards,
    Ervin (http://wiki.sdn.sap.com/wiki/display/TechTSG/%28NWDI%29Home)

  • How To Execute SQL Statements From Shell Scripts?

    I need to extecute some SELECT statements from a shell scripts. Could anybody kindly tell me how to do that, or which document i should refer to ? Thank you very much!

    You can execute SQLPlus with the SQL in a file (sqlplus -s @<sql-script>).

  • How change o.s. font from applet ?????

    In the properties of desktop there is a possibility to change font System : small font and large font - 96 dpi and 120 dpi.
    When the large font is setted the labels in my applet became broken .
    How i can change this font from applet ??
    I have already seen the System.properties class but there isn't font key
    please if you know i have a big urgent.
    thank you

    In the properties of desktop there is a possibility to
    change font System : small font and large font - 96
    dpi and 120 dpi.
    When the large font is setted the labels in my applet
    became broken .
    How i can change this font from applet ??
    I have already seen the System.properties class but
    there isn't font keyYou can't change the system font from your applet, you can use fixed fonts in your applet though.
    please if you know i have a big urgent.LOLOLOLOLOL, sorry, couldn't help it, nothing personal, but just that sentence.
    thank youCheers.
    p.s. 1 hint;
    nobody cares if you're in a hurry or not, we're all busy people, mentioning it mostly tick people off, causing them not to respond or respond later.

  • How to pass multiple values from workbook to planning function ?

    Hi,
    I have created Planning function in Modeler and it has one parameter(Variable represents = Multiple single values).
    When executing the planning function by create planning seq. in the web template : I see value of variable store data like ...
        A.) input one value -> V1
        B.) input three values -> V1;V2;V3
    This function execute completely in web.
    However, I want to use the planning function in workbook(Excel).
    The value of variable can't input V1;V2;V3... I don't know how to pass multiple values from workbook to parameter(Multiple single values type) in planning function ?
    thank you.

    Hi,
    Please see the attached how to document (page no 16).
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be">how to</a>
    Hope this was helpful
    thanks

  • Changing container State from a component

    Hi, I try to change the state of an application from a button
    inside a mxml component. I found a way for this by handling click
    event inside the component and dispatch event to the container (see
    the code below). But my problem is that any click is dispatched ! I
    would like that only one button dispatch this event, or better :
    calling a container's function from the button inside my component
    ! Is this possible ?
    Thanks for your help
    Here is a part of the container code :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="570" height="360" xmlns:local="*">
    <mx:Script>
    <![CDATA[
    import flash.events.Event;
    public function handleCloseEvent(eventObj:Event):void {
    currentState='carte';
    ]]>
    </mx:Script>
    <mx:states>
    <mx:State name="liste">
    <mx:AddChild position="lastChild">
    <local:liste_vin_region click="handleCloseEvent(event);"
    id="fenetre">
    </mx:AddChild>
    </mx:State>
    <mx:State name="carte"/>
    </mx:states>
    </mx:Canvas>
    And the component code :
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="514" height="300" xmlns:local="*">
    <mx:Metadata>
    [Event(name="click", type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import flash.events.Event;
    // Redispatch event.
    private function
    handleCloseEventInternally(eventObj:Event):void {
    dispatchEvent(eventObj);
    ]]>
    </mx:Script>
    <mx:states>
    <mx:State name="liste"/>
    </mx:states>
    <mx:TitleWindow layout="absolute" left="10" top="10"
    bottom="10" right="10" id="titlewindow1"/>
    <mx:Button y="14" label="X" right="19" width="29"
    click="handleCloseEventInternally(event);" id="button1"/>
    </mx:Canvas>

    Yes ! That's exactly what I need !
    I've tried to do : this._parent like in Flash, but no
    result...
    Thanks for your help, parentApplication is right for me
    !

  • How to change Bulk Insert statement from MS SQL to Oracle

    Hi All,
    Good day, I would like to bulk insert the content of a file into Oracle db. May I know how to change the below MS SQL syntax to Oracle syntax?
    Statement statement = objConnection.createStatement();
    statement.execute("BULK INSERT [TBL_MERCHANT] FROM '" MERCHANT_FILE_DIR "' WITH ( FIELDTERMINATOR = '~~', ROWTERMINATOR = '##' )");
    Thanks in advance.
    cs.

    Oracle SQL Loader utility allows you to insert data from flat file to database tables.
    Go to SQL Loader links on following url to learn more on this utility
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96652/toc.htm
    Chandar

  • How to change Human Task state from "Completed" back to "Assigned"

    I am working with human task through BPEL Worklist API
    There is Human Task with state “completed”. We need to change the state back to “Assigned”
    In other words or get this task with “Assigned” state or get exactly the same task with the same number (that I can use as int parameter in ITaskQueryService.getTaskDetailsByNumber method invocation) .
    Is it possible?
    I tried to use ITaskService methods but without results.
    Thanks.

    Hi ,
    This request sits in table RSBKREQUEST with processing type as 2 in data elements USTATE, TSTATE and this 2 is actually "Processed Successfully" status which is obviously wrong.
    All we need is, ask your basis person to change the status to 3 in both these data elements.Then you can delete the previous bad request . Once the request is deleted, the request status gets updated as "4" in table RSBKREQUEST.
    For manually status change you can use the function  module RSBM_GUI_CHANGE_USTATE
    Hope this helps you...
    Regards,
    Debjani...

  • How to update session state from form field values without submitting page?

    Hi,
    I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
    Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
    (the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
    Any help will be greatly appreciated. Thanks in advance.

    Create a dynamic action on change and run a PL/SQL process there with the following code:
    BEGIN
       NULL;
    END;Page items to submit > your item.
    This will set the session state without submitting the form.
    Further examples here:
    http://apex.oracle.com/pls/apex/f?p=31517:229
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Simple Task - Syntax Question (how do you pass variables from one component to another component - databinding)?

    Hi all,
    I'm trying to pass some width/height/URLs from a Video Player component to a Social Bookmarking component's embed text input field. (for people to grab and share videos).
    I know this is a simple task, but it's the end of the day and I seem to be having a brain failure... What's the syntax to achieve this? Do I have to import the video player component? These widths/heights/URLs are all being dynamically generated from an XML... should I be pulling it from the XML or just reuse the variables that already exist in the Video Player component?
    Here's my code...
    Video Player:
    [Bindable]
    public var source:String = "";
    [Bindable]
    public var autoPlay:Boolean = false;
    [Bindable]
    public var fullScreenMode:Boolean = false;
    [Bindable]
    public var clipTag:String = "_movie";
    [Bindable]
    public var iag_code:String = "";
    [Bindable]
    public var officialURL:String = "http://www.movies.com/";
    [Bindable]
    public var referer:String = "unknown";
    [Bindable]
    public var gID:String;
    [Bindable]
    public var starterImageURL:String = 'http://www.movies.com/jazzmaster/images/default_starter_image.
    [Bindable]
    public var oldWidth:Number;
    [Bindable]
    public var oldHeight:Number;
    Sharing Component:
    <mx:HBox
      height="10%"
      horizontalCenter="-25"
      verticalCenter="0"
      paddingBottom="5">
      <mx:Text text="Embed Code:" paddingTop="1" color="#FFFFFF" fontSize="12"/>
      <mx:TextInput  text="{oldWidth}"/>
    </mx:HBox>
    The code above throws an error... "Attempted access of inaccessible property oldWidth through a reference with a static type com:SharingBookmarks."
    Thanks all!
    DK

    Try this..
    create a new flex project and add a folder called "src"
    create a new MXML component named "VideoComp.mxml" and copy/paste
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var videoWidth:int = 300;
    [Bindable]
    public var videoHeight:int = 300;
    ]]>
    </mx:Script>
    <mx:Label text="Vidoe" />
    <mx:TextInput text="{videoWidth}" id="w" change="this.videoWidth = int(w.text);" />
    <mx:TextInput text="{videoHeight}" id="h" change="this.videoHeight = int(h.text);" />
    </mx:VBox>
    create a new MXML component named, "SharingComp.mxml" add copy/paste this..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var videoWidth:int;
    [Bindable]
    public var videoHeight:int;
    ]]>
    </mx:Script>
    <mx:Label text="Sharing Comp." />
    <mx:Label text="{videoWidth}" />
    <mx:Label text="{videoHeight}" />
    </mx:VBox>
    and here is the main.mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:src="src.*">
        <mx:Script>
            <![CDATA[
                private function doSomething():void
                 sharingComp.videoHeight = videoComp.videoHeight;
                 sharingComp.videoWidth = videoComp.videoWidth;
            ]]>
        </mx:Script>
       <src:VideoComp id="videoComp" />
       <mx:Button click="doSomething()" label="copy" />
       <src:SharingComp id="sharingComp" />
    </mx:Application>
    Hope this helps,
    BaBo,

  • ViewObject Row doesn't change it's state from Row.STATUS_NEW after commit ?

    Hi All,
    i have the following problem:
    In my Application i have a logic which is based on View Object Row state .
    I have the following common problem scenario:
    I'm creating a new Row and putting it into state Row.STATUS_INITIALIZED.
    After modifying the Row attributes it goes in Row.STATUS_NEW (which is correct).
    After executing transaction COMMIT i'm expecting the Row state to be changed to status
    UNMODIFIED (similar as an entities). However this not happens , the Row is still in state
    Row.STATUS_NEW. The entities on which are based the View Object change their statuses
    correctly (they go from NEW to UNMODIFIED state).
    I doesn't find any details about switching View Object Row state (except from INITIALIZED to NEW and vice versa)
    in the documentation, so i'm wondering is this framework behaviour correct ?
    Thanks in advance,
    Krasimir

    You're mixing up the newRow state and the row state (which does not exist for a view row in that way).
    The newRow state can only have values STATUS_INITIALIZED and STATUS_NEW.
    The row state that you want is basically the row state of the updateable entities contained in the row.
    If you want to expose that entity state as row state then follow instructions (example 46) here:
    http://blogs.oracle.com/smuenchadf/examples/
    Sascha

  • How to get the value from textInput Component to perform calculation?

    I need some help here...I'm trying to get the value of user input from the TextInput Component which is the age, height and weight to calculate the bmr and display the result in member("result").text.
    How am i suppose to let the integer pass through in order for me to perform calculation? Would appreciate if anyone can help me out with this, thanks!
    Below are the formula :
    The Harris Benedict equation estimates BMR:
    For women: (9.56 x w) + (1.85 x h) – (4.68 x a) + 655
    For men: (13.75 x w) + (5 x h) – (6.76 x a) + 66

    Assumed that this section is only for male ...it still show error saying script error : String expected for
    on mouseDown
       member("result").text = (13.75 * value(member("weightText").text)) + (5 * value(member("heightText").text)) - (6.76 * value(member("ageText").text)) + 66
    end
    Do i have to add in "put sprite(x).text -- where x is the number of the sprite that is the text input." ?

Maybe you are looking for

  • ME21N shopping basket

    Hi Experts I have a requirement where i need to populate the me21n shopping basket with a Purchase requisition, since i have to create a PO with reference to the PR. The me21n transaction is invoked using call transaction from a workflow method. I wa

  • What package do I need to install quicktime?

    I am able to download quicktime, but I CAN NOT  install it, the message says " the installation package could not be opened". What do I need to do to install quicktime?

  • Wlc 5508 upgrade problem from 7.0.116.0 to 7.0.235.3

    We have two WLC model 5508 with the follwing information Manufacturer's Name.............................. Cisco Systems Inc. Product Name..................................... Cisco Controller Product Version.................................. 7.0.116

  • OEM DB control slightly broken after 10.2 fresh install

    People, I just installed 10.2.0.2 on Solaris x86 using instructions I found here: http://bikle.com/protected/o10gR2_solaris10x86 Everything seems to work okay except for some small areas inside of EM database control. For example, in the first page o

  • Jconsole with weblogic 10.0 MP1

    I am using weblogic 10.0 MP1 (dk150_11) and I need to generate heap dump I tried JConsole but I couldn't find the HotSpotDiagnostic node where I can generate the heap dump and there is no jmap.exe whith the jdk version I know that I can generate heap