Referencing 'states' in another component

Relevant file structure:
Main.mxml (main app file)
\myComponents\Login.mxml (custom component)
In my Main.mxml file I have three states:
<Base state>
Login (start)
Home
On clicking a Submit button in the Login.mxml component I
would like to have the Main.mxml's state switch to Home. How would
I go about referencing the Home state from the Login.mxml custom
component (which is placed in the Login state). The questions boils
down to targetting syntax. Any help is appreciated, thank you.

Hi,
I'm not sure to understand what you want to do but:
to have the Main.mxml's state switch to Home by clicking a
Submit button in the Login.mxml component I would do the following:
- in your Main.mxml make a public function (witch change
state) that you call from Login.mxml
Ex:
Main.mxml :
<mx:Application id="main" xmlns:mx="
http://www.adobe.com/2006/mxml">
public function changestate():void {
....//change state function
Login.mxml :
private function OnClick_submit(e:event):void {
//call main.mxml function to change state
main.changestate();

Similar Messages

  • VS2013 Update 4: TypeLoad Exception when referencing a winmd (C++) component

    Hi,
    I am experiencing problems with the latest Update (4) for VS2013.
    When an (Windows 8.1) app is compiled by the latest version of VS2013 the app crashes on a TypeLoad Exception.
    This problem is probaly occuring when referencing a winmd (C++) component, as I am using the SmoothStreaming SDK for Windows 8.1 apps.
    Do any of you experience the same problem or know when there will be a fix?
    This problem is a big issue for me and my colleages because we mostly work with SmoothStreaming projects.
    Greetings,
    Mark Hijdra 

    Hi Mark Hijdra,
    Do you mean that it worked well before you installed the VS2013 update 4? If you install it singly, maybe you could remove it, and then run your app, check the results, so we could make sure that whether it is related to the update 4.
    Or you could remove the references, and then re-add it again.
    If possible, I suggest you collect the detailed error message in your side.
    Actaully this forum is to discuss:
    Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
    If it is related to the specific app, I suggest you post this issue to the specific development forum.
    So if it is related to the Windows Store or Windows Phone app, please post this issue to this forum:
    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?category=windowsapps
    For the TypeLoad Exception, there are several possible reasons, so if possible, you'd better collect the detailed error message.
    http://stackoverflow.com/questions/18228964/wp-runtime-component-type-load-exception
    http://stackoverflow.com/questions/16880776/referencing-a-windows-phone-runtime-component-dll-winmd-from-another-project
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can I buy final pro using a Mac in one State and then install it in other State using another Mac?

    Can I buy final cut pro x , using  my mac and then install it in other State using another Mac?

    Yes, as long as both Macs meet the system requirements for it.
    (112783)

  • Reading the data from one component view into another component view

    Hi All,
    I have requirement to read the data from one component into another component while creating the service order. Here are the details.
    Main View for Service order: BT116H_SRVO in that we have two assignment blocks like Organizational data(BTORGSET) and amount allocation(BTAMNTALL).This two blocks are two different component which are associated with main component(BT116H_SRVO).
    I need to read the sales org data from component/View(BTORGSET/Orgsetdata) into Component/View(BTAMNTALL(HdrBillPlanDet) method DO_VALIDATE_INPUT.
    I searched in SDN but all the posts are related to the data exchange between two views in same component. But My scenario is different as explained above.
    Refer the attachments for the component link..
    Please let me know how we can achieve this one..
    Thanks,
    Sapsar.

    Finally I was able to fix my code...My Mistakes were need to read the parent node above three levels and need to use the relation entity name while reading the data..
    Below is the correction code
    IF iv_index IS NOT INITIAL.
         lr_iterator ?= collection_wrapper->get_iterator( ).
         lr_current ?= lr_iterator->get_by_index( iv_index ).
         lr_entity ?= lr_iterator->get_by_index( iv_index ).
       ELSE.
         lr_current = collection_wrapper->get_current( ).
       ENDIF.
    *loop back to root entity
             WHILE lr_entity->get_name( ) NE 'BTAdminH'.
               lr_entity = lr_entity->get_parent( ).
             ENDWHILE.
    *Get the related entity
             IF lr_entity IS BOUND.
               lr_collection ?= lr_entity->get_related_entities( iv_relation_name = 'BTHeaderOrgmanSet' ) .
               IF lr_collection IS BOUND.
                 lr_orgset_m = lr_collection->get_current( ).
    *            lr_orgset = lr_orgset_m->get_related_entity( iv_relation_name = 'BTOrgSet' ).
                 lr_orgset = lr_orgset_m->get_property_as_string( 'SALES_ORG' ).
               ENDIF.
             ENDIF.
    Thanks,
    Sapsar.

  • Troubles in copying a VGroup from one state to another

    Hey there!
    I am trying to build an application where the user can select whatever he wants to appear in his homepage. The user is given a list of checkboxes (with a corresponding label and image to every checkbox). I have kept all three of these items in a Vgroup and now I want to move this Vgroup from one state to another IF the checkBox is selected. Here is my code:
    protected function btn_done_clickHandler(event:MouseEvent):void
                    if (chkbox1.selected == true) {
                        this.group1.currentState = "MainWindow"
                    else if (chkbox1.selected == false) {
                        this.group1.currentState = "AddPeople";
                    this.currentState="MainWindow";
    This code does not show any errors before running but it crashes when this program is run. And it also show the following error report:
    ArgumentError: Undefined state 'MainWindow'
    Can someone please help to identify what I am doing wrong here?

    stmt.executeUpdate("INSERT INTO TABLEA(id,field2,field3,field4) SELECT id + " + x + ",field2,field3,field4 FROM TABLEB  WHERE UPLOADNUM="+upnum);  Where x is the number you have already calculated.
    Ted.

  • Getting error while another component to the same project

    I am getting the following error while including another component (JSPDynPage) in the same project. Its scope is request. If there is some .jar file to export kindly tell its path also.
    Error:The project was not built since its classpath is incomplete. Cannot find the class file for javax.servlet.http.HttpServletRequest. Fix the classpath then try rebuilding this project.     TryProject

    Hello Shilpa,
    The required jar file is <b>servlet.jar</b>, this is present on your server under
    usrsap<ID><INST>j2eecluster<NODE> in/ext/servlet/servlet.jar
    So adding this to your classpath, should solve the problem.
    Check this to know, how to set classpath:
    Getting API:s for DevStudio
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • Error: Could not resolve s:states to a component implementation.

    So I am trying to setup states on a Flex application I'm building, but it doesn't seem to want to compile. I get this error:
    $ ./build.sh
    Loading configuration file /Applications/Adobe Flash Builder 4/sdks/4.1.0/frameworks/flex-config.xml
    uploader.mxml(24): Error: Could not resolve <s:states> to a component implementation.
        <s:states>
    Here is my build command nothing special ...
    $ cat ./build.sh
    #!/bin/bash
    mxmlc -output bin/uploader.swf src/uploader.mxml
    I have a class that extends the Spark application like so ...
    package com.uploader.controllers
        import spark.components.Application;
         dynamic public class FlashUploader extends Application
    Then in my main application mxml file I use it like so ...
    <?xml version="1.0" encoding="utf-8"?>
    <c:FlashUploader xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:v="com.uploader.view"
        xmlns:c="com.uploader.controllers.*"
        minWidth="709" minHeight="400"
        skinClass="com.uploader.skins.UploaderApplicationSkin">
        <fx:Style source="styles.css" />
        <!-- states -->
        <s:states>
            <s:State name="default" />
            <s:State name="startup" />
            <s:State name="uploading" />
            <s:State name="normal" />
        </s:states>
    </c:FlashUploader>
    Now when I try to compile I get the states error. I've found several examples and even made a dummy app just using the spark application and it compiles fine. Not sure if I'm doing anything weird here but the few other flex devs I know don't seem to see anything wrong with what I'm doing that could cause this.

    When you define an object using a namespace you have to use the same namespace for its properties, so you will want to use "<c:states>" instead of "<s:states>" in this case.

  • Callinfg ALV from another component

    Hi all,
    We have a main component in which on press of a button we need to show alv which is in another component.
    I am trying to follow these steps but i need your inputs
    1. I have declared the component which calls alv in used components
    2. In the main view of my component i have placed a VCU
    3. In the window of the main component i have embedded that VCU and embedded the view of the component which calls the alv.
    Now how can i call alv on press of that button ?
    Please let me know your suggestions
    Regards
    Bhanu

    Hi,
    Aditya has the right idea in my opinion. I always do things this way (altering visibility) because 1. it's easiest and 2. you don't have initializing problems. Here's how you can do it:
    First of all, set your ViewContainer invisible in design time.
    1. Go to the Component controller of your main component (where your ViewContainer is in), go to attributes
    2. Add an attribute Z_GO_VIEW, Public, Type ref to, IF_WD_VIEW.
    3. Go to your View of the CC where the VC actually is in.
    4. Go to hook method WDDOMODIFYVIEW
    5. Add the following code:
    IF first_time = abap_true.
        wd_comp_controller->z_go_view = view.
    ENDIF.
    --> now you have the instance of your view interface.
    6. Make a button
    7. In the event handler method of the button, code something alike to this:
    DATA:
           lo_el_ui_root      TYPE REF TO cl_wd_uielement_container,
           lo_el_trans_cont1  TYPE REF TO cl_wd_uielement_container,
           lo_el_button1     TYPE REF TO cl_wd_button.
    DATA: lv_visibility TYPE WDUI_VISIBILITY.
    lo_el_ui_root ?= wd_comp_controller->z_go_view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lo_el_trans_cont1 ?= lo_el_ui_root->get_child( ID = 'TC_ONE' ).
    lo_el_button1 ?= lo_el_trans_cont1->get_child( ID = 'I_AM_THE_MIGHTY_BUTTON' ).
    lv_visibility = '02'.
    lo_el_button1->set_visible( value = lv_visibility ).
    This isn't exactly what you'll need but you get the picture: Get the View Instance, Downcast the UI tree for the Element you want to dynamically alter, use the right method for alterations.
    This should solve your problem. If it doesn't, ask us again
    regards, Lukas

  • Read GUID of profile set in another component

    Hi,
    I am trying to read GUID of one component into another. Read it like this: This is marketing scenario where we create segments. Each segment has a GUID attached to it but component SEGED_SET which is meant for segments has no such attribute.
    How system is reading GUID for a segment:
      wa_object-object_id   = lo_entity->get_key( ).
      wa_object-object_name = lo_entity->get_name( ).
      CALL METHOD cl_crm_genil_container_tools=>get_key_from_object_id
        EXPORTING
          iv_object_name = wa_object-object_name
          iv_object_id   = wa_object-object_id
        IMPORTING
          es_key         = lv_guid.
    And it works.
    Now we have another component SEGED_NOTE which is used by SEGED_SET. I need to read GUID of segment in this component. I put following code:
      lo_entity ?= me->collection_wrapper->get_current( ).
      CHECK lo_entity IS BOUND.
      lo_parent ?= lo_entity->get_parent( ).
      CHECK lo_entity IS BOUND.
      wa_object-object_id   = lo_parent->get_key( ).
      wa_object-object_name = lo_parent->get_name( ).
      CALL METHOD cl_crm_genil_container_tools=>get_key_from_object_id
        EXPORTING
          iv_object_name = wa_object-object_name
          iv_object_id   = wa_object-object_id
        IMPORTING
          es_key         = lv_guid.
    But issue here is that lv_guid is not filled as this method reads data from buffer and currently buffer has data only for SEGED_NOTE and not for its parent entity. Please note that object name and object id were correctly retreived.
    Is there any other way to read this GUID?
    Regards,
    Shikha

    Hi Shikha,
    Declare an atrribute in Component Controller and use this to exchange the value from one component to another.
    Read the GUID in the GET Method of any displayed attribute using the +ifbol_property_access ( Class/ Interface ) using the GET_property Method.+_
    Regards,
    S John

  • Buttons grouped to a a state of one MSO controlling a state of another MSO

    If you have a MSO that has the button grouped to the state so that when it is pressed a overlay pops up. Because the button is grouped you can no longer control other States in another MSO. The problem I am having is if one OL is open in one MSO and I click on another button in a different MSO I now have two OL open at the same time. I know if the button was not grouped with the state I could set each of the buttons to have two actions, first go to the off state of the opposing OL and then to the on state of that OL, but the button that is grouped does not give me the option to select states outside of its own MSO.

    Ok. Hope to see that solved one day, life will be easier :).
    BTW, just reminded me about multiple layouts support incompatibility with multi articles import (with sidecar.xml). Any idea if this will be solved? On of “selling features” for CS6 :).
    Martin

  • Prepare_dynamic_navigation to embed in another component

    Hi,
    I have two components A and B. A uses B as used component. Both A and B have  I  as used component. I is the interface component for visual components. Component VC implements interface component I.
    My requirement is to put component VC in a view container in component B. But A should act as the controlling component and should take care of creating component VC and embed the created component VC into view container of B. Is it possible using prepare_dynamic_navigation method?
    I am using the code as follows in component A:
    try.
          l_view_controller_api->prepare_dynamic_navigation(
                 source_window_name          = 'WI_MANAGECOURSE'
                 source_vusage_name          = 'MAIN_USAGE_1'
                 source_plug_name            = 'GOOUT'
                 target_component_name       = 'B'
                 target_component_usage      = 'MAIN_USAGE_1'
                 target_view_name            = 'WI_GENERICRM'
                 target_plug_name            = 'DEFAULT'
                 target_embedding_position   = 'VI_MAIN/VIEWCONTAINER' ).
        catch cx_wd_runtime_repository.
          raise exception type cx_wdr_rt_exception.
      endtry.
    Create the actual visual Component
      if wa_cmp_usage-component_usage->has_active_component( ) is not initial.
        wa_cmp_usage-component_usage->delete_component( ).
      endif.
      wa_cmp_usage-component_usage->create_component( 'VC' ).
    This code gets executed fine but some where in the ABAP frame work class, I get the error:
    "Component Usage VIEW_INTERFACE Has No Component. Application May Not Have Created an Instance "
    VIEW_INTERFACE is the component use for interface I in both components A and B.
    Regards,
    Srini.

    Hi,
    The problem is resolved after I moved the embedding on to the same component. But I doubt whether it would be possible to use prepare_dynamic_navigation to embed in another component.
    Regards,
    Srini.

  • Component referencing libraries from other component

    Hi,
    Is it possible to have a component which uses the libraries defined in another component?
    I would like to have one component with libraries only and any other component to be able to reference those libraries hence removing the need to put the libraries in each component.
    Thanks,
    Vlad

    Hi Vlad, this is perfectly possible. Make sure your library component has its class-path's set up correct and your other components should be able to reference these classes without any additional effort (as long as your library component is deployed and enabled).
    It might be wise to setup a feature in your library component (in component wizard, goto advanced build settings and fill in "Feature Extensions" field with something, ie. MyLibraryComponent). In all your other components you can than put in the required features field the same string; ie. MyLibraryComponent. This should tell anyone who disabled the library component that it is required instead of just generating a bunch of classnotfound exceptions. Setting up this feature thing is not required to make things work.
    Regards,
    Fabian

  • Trying to use a popup window as a component  in another component

    Hi guys,
    I am unable to use a popup component in another component in
    Flex .
    Its not calling the popup compopnent.
    Could anyone plz hel me.
    This is my code.
    This is the parent component TitlWindow where i want to call
    my popup
    component.
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*"
    creationComplete="showWindow();"
    title="CREATE PROFILE">
    This is my script where i am writing a function to call a
    component
    whose name is fielupload.mxml
    <mx:Script>
    private function showWindow():void
    pop =
    fileupload(PopUpManager.createPopUp(this,fileupload,true));//
    fileupload.mxml
    is called
    pop.title = "Please enter your login information.";
    pop.showCloseButton =true;
    PopUpManager.centerPopUp(pop);
    pop.addEventListener("close",removeMe);
    </mx:TitleWindow>
    This is the code for fileupload.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*" title="File Upload">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.ProgressEvent;
    import mx.controls.Alert;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.events.SecurityErrorEvent;
    import mx.controls.Button;
    import mx.controls.TextInput;
    import mx.controls.ProgressBar;
    import mx.core.Application;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import mx.core.UIComponent;
    import mx.managers.PopUpManager;
    public var fileFilterImage:FileFilter = new
    FileFilter("Images","*.png;*.gif;*.jpg");
    public var fileFilterDocument:FileFilter = new
    FileFilter("Documents", "*.txt;*.doc;*.pdf;*.rtf");
    public var fileFilterArchives:FileFilter = new
    FileFilter("Archives", "*.zip;*.tar;*.hqx");
    public var fileFilterAll:FileFilter = new
    FileFilter("All", "*.*");
    public var fileRef:FileReference;
    public var selectedId:String;
    public function init():void {
    fileRef = new FileReference();
    fileRef.addEventListener(Event.CANCEL,
    traceEvent);
    fileRef.addEventListener(Event.COMPLETE,
    completeEvent);
    fileRef.addEventListener(Event.SELECT,
    selectEvent);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR,
    traceEvent);
    fileRef.addEventListener(Event.OPEN, traceEvent);
    fileRef.addEventListener(ProgressEvent.PROGRESS,
    onFileProgress);
    fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    traceEvent);
    public function traceEvent(event:Event):void {
    var tmp:String =
    "================================\n";
    public function
    ioErrorEvent(event:IOErrorEvent):void{
    Alert.show("IOError:" + event.text);
    traceEvent(event);
    public function selectEvent(event:Event):void{
    //var selectedId:String =
    selectButton(event);
    //Alert.show("i am in id" +
    Application.application.winMyProfile.selectedId);
    btnUpload.enabled = true;
    iptFile.text = fileRef.name;
    public function
    selectButton(catchButton:Event):void{
    var newButton : Button = new Button;
    newButton = catchButton.currentTarget
    as Button
    selectedId = newButton.id;
    //Alert.show("i am in id" +
    selectedId);
    public function
    onFileProgress(event:ProgressEvent):void {
    prgBarUpload.label = "Loaded " +
    event.bytesLoaded + " of " +
    event.bytesTotal + " bytes";
    prgBarUpload.setProgress(event.bytesLoaded,
    event.bytesTotal);
    public function
    completeEvent(event:Event):void {
    Alert.show("File Uploaded
    Successfully");
    btnUpload.enabled = false;
    btnBrowse.enabled = true;
    public function uploadFile(url:String):void {
    url = url + "?
    folder="+Application.application.winLogin.userInfo.getUsername();
    var req:URLRequest = new
    URLRequest(url);
    req.method = URLRequestMethod.POST;
    var folder:String =
    Application.application.winLogin.userInfo.getUsername();
    fileRef.upload(req, folder,true);
    ]]>
    </mx:Script>
    <mx:VBox id="vbMain" width="100%" height="60">
    <mx:HBox width="100%" height="22">
    <mx:TextInput height="22" id="iptFile"
    width="100"/>
    <mx:Button id="btnBrowse" label="Browse"
    click="selectButton(event),fileRef.browse([fileFilterAll]);"
    />
    <mx:Button id="btnUpload" label="Upload"
    enabled="false"
    click="uploadFile('fileupload.do');" />
    <mx:Button id="btnCancel" label="Cancel"
    enabled="false"
    click="PopUpManager.removePopUp(this);"/>
    </mx:HBox>
    <mx:ProgressBar width="200"
    source="iptFileResume" height="5"
    id="prgBarUpload" mode="manual"/>
    </mx:VBox>
    </mx:TitleWindow>
    Its not even showing any error , i dont know whats the
    problem with
    it.
    Thanks for your help,
    Mario.

    If I understand, you want to display a popup Titlewindow from
    within another popup TitleWindow? This is possible.
    Simplify your code to get it working first.
    Tracy

  • 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)

  • Overlay a component with another component?

    Can you overlay a component with PopUp-like component that
    doesn't overlay the entire Application?
    I have a dashboard application that displays smaller
    sub-components that each call out to a WebService to retrieve data.
    I am able to create a PopUp for each and center it over the
    sub-component in order to show a Progress Bar, but each PopUp ends
    up overlaying the entire application, when I want it to simply
    overlay the individual sub-component. Is there anyway to do this
    with Flex 3? Like, some kind of layering or something?
    Thank you.

    Why not create states within the component wherin a state
    contains the pop up?
    That would make the popup a child of the component

Maybe you are looking for

  • Installation error ABAP + JAVA Stack

    Hi all, I am trying to install ABAP+Java server and i am facing the below issue.Can you please help me in resolving this. Hard Disk:-200 GB RAM:-2GB Log file 1:- ERROR      2010-01-28 17:32:12 CJSlibModule::writeError_impl() CJS-30023  Process call '

  • Can't replace lines in a downloaded template doc

    there're two lines in my document that I can edit regularly, but they just swith right back if I try to scroll down or print it. Any suggestions?

  • How to pull list in alphabetical order using #listgetat? more details in post

    I have images pulling into site but it seems to be pulling them based on most recent added, is there any way to pull by file name alphabetically? I'm not too experienced with CF but I am good with HTML/CSS trying to fix some things on a friends site

  • M401 Dne Loosing connection with Network

    We recently installed a M401Dne on our network via ethernet cable. Assigning it a fixed IP address and reserving that IP address on the network. The problem is that once in a while it simply looses it´s connection on the network... showing up as unav

  • Error message before all values are entered in Step and Repeat box

    The Step and Repeat function seems to have a problem that it didn't have before. (1st field REPEAT COUNT, 2nd field HORIZONTAL OFFSET, 3rd field VERTICAL OFFSET). It is not permitted to duplicate beyond the limits of the document or pasteboard, I und