Passing variable to an outside component

I intent to create a web site of products. Since there will
be too many lines of code to work only with one file, I decided to
create component for each state. Those component are simply VBox
component including everything necessary to display the nature of
the state. For an example, calling the state local:stateContactComp
will show the state for contact (equivalent to a page of contact
from the web 1.0 philosophy if I can say it in that way).
Now, the problem I encounter at this moment is the current
product. The home page is designed to navigate through the products
available and once the user click on one product, he/she will be
redirected to the state of product where the system will call the
stateProductComp.mxml based on a VBox (but followed by many
component inside to show the details of the product). This is basic
but what I don't know yet is how to pass the current product (the
one that the user clicked on) to the component which is called. At
the beginning I sort of though that the component called was
automatically binded to the main component but it seems to not. I
alreay declared a public var currentProduct:Product in my
stateProductComp.mxml but I still searching how to transfer the
information.
Preferably, I would prefer to use the main variable which
have a similar line (public var currentProduct:Product) associated
to a class to define the Product. I would prefer to use the main
variable for memory worry but maybe there is no way to take care of
the memory in this case (which I doubt!).
Anyway, what I need to know is the best practice to work with
separate files (for lenght of code source issue) while we are
working with states.
I hope I was enough clear to understand my problem, if not,
please let me know.
Keywords should be: passing a variable to a component in
another file.

I knew it was possible to do it and I found how!!!
Simply by adding the value through the call of the component.
In my case, I was calling the component while changing state
so the line of code was as follow:
1) <mx:State name="stateProduct">
2) <mx:RemoveChild target="{menu2Items}"/>
3) <mx:AddChild relativeTo="{pageContent}"
position="lastChild" creationPolicy="all">
4) <mx:VBox id="pageContent2" width="100%"
height="100%">
5) <local:stateLampeComp
currentProduct="{vCurrentProduct}"/>
6) </mx:VBox>
7) </mx:AddChild>
8) </mx:State>
So the line 5 show my call to the component containing all
the layout to display the details of the product pre-clicked and by
indicate currentProduct (variable from the stateLampeComp
component) = {vCurrentProduct} (variable from the caller
component), the system can now inter-connecting the values from one
component to the other.
Voilà!

Similar Messages

  • Passing variables using the URL

    in the past I have alsways used internal navigation methods
    within Flex - i.e. viewStacks, and linkBars etc... but I need to
    use an (existing) external menu and link (communicate) it to my
    Flex Application.....
    is it possible to pass variable to (into) a flex 2
    application using a URL
    e.g.
    http://...............
    ?page=homepage
    picking this variable ("page") up and getting its value (in
    this case "homepage")
    and then use the variable in the Flex application to display
    the relevent component...... ???
    basically, I am trying to navigate through a Flex application
    using an external menu system etc...... and displaying the
    particular components within the Flex application relevent to the
    select links (within the external menu system) communicating the
    two using a URL etc......
    thanks,
    Jon.

    Passing data into a Flex app using the url on startup
    requires working with the html handler, causing it to build
    flashvars in the Embed or Object tag. Inside Flex, these are
    accessed using the Application.parameters array.
    But it sounds like you want ongoing communication between the
    Flex app and the browser. For this you should use
    ExternalInterface. I have not used it at all, so I can't be any
    specific help.
    Tracy

  • Passing variables to hyperlink

    Hi,
    Can you pass variables to the Cp7 hyperlink feature ?
    I am looking at some cases where I would like to create the link dynamically
    rgds Renovator

    Not AFAIK. Use of variables outside of text containers and advanced actions is pretty lilmited. Even if you populate a variable associated with a TEB, or one associated with checkboxes/dropdown/radiobuttons interactions using an (advanced) action it will never show up (except with Jim's extended widgets). Could you please enter a feature request, I did already several like that. Same for advanced action: if we could concatenate strings with variables to create an action, a lot more would be possible or at least lot of long conditional actions could be avoided.
    Lilybiri

  • Passing variables from Report to Form

    Hi, I need pass a couple of variables from the REPORT to two fields in the FORM for save in a table. Somebody knows how do I do this?. Any suggestions?
    Thanks a lot!
    I think that this situation is different that pass variables from FORM to REPORT.

    You need to use a Link component to your Form that you then attach to one of the data columns in the Report. When you edit the link in the report, you can specify the fields to pass.

  • Passing variable values to the navigation block

    Hi WAD Experts,
      I have a requirement regarding passing variable values to the navigation block. User requirement is first give the selections on the selection screen and then after executign output should display in browser. In the output page we have a navigation block. So when user gives selections those selections should also populate in the navigation block. Your help will be appreciated.
    Prasad.

    Hi,
    if your variable is 'Changeable at Query Navigation' the chosen values will appear in the Navigationblock.
    Variables which are 'Not Changeable at Query Navigation'
    will not appear.
    You can set this Property when you create a Variable.
    Kind Regards,
    Alican Polat

  • How can I pass variables from one project to another using Javascript?

    Hi all, I am trying to do this: let learners take one course and finish a quiz. Then based on their quiz scores, they will be sent to other differenct courses.
    However, I wish keep track on their previous quiz scores as well as many other variables.
    I found this nice widge of upload/download variables by CPguru (http://www.cpguru.com/2011/05/18/save-and-load-data-widget-for-adobe-captivate-4-and-adobe -captivate-5/). However, this widget works by storing variables from one project in local computer and then upload it to another project.
    My targeted learners may not always use the same computer though, so using this widget seems not work.
    All these courses resided in a local-made LMS which I don't have access to their code. Therefore, passing variables to PHP html files seems not work.
    Based on my limited programing knowledge, I assume that using Javascript to pass variables may be the only possible way.
    Can someone instruct me how to do this?
    Thank you very much.

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • Error when executing query without passing variable selection

    Hi Gurus
    I am getting an error while executing a query with out passing values for variables
    When executing the query by passing the filter values report returns the data
    When executing the query with out passing variable selections the error message is
    Unknown error in SQL interface
    Error reading the data of Info Provider ZCRM_O08
    Error while reading data; navigation possible
    System error in program SSAPLRS_EXCEPTION and form
    RS_EXCEPTION_TO_MESSAGE
    No Data Available
    can any one please help me in resolving this
    Thank you

    Hi Srini
    Thanks for your quick response
    When i am executing the query with selection it is returning the data
    giving error when executing with out passing the selection
    is there any other cause for this problem
    like any particular info object causes this sort of problem
    Thank you

  • Passing variable having value as whole SOAP request to command while invoking ODI WS call

    When passing variable in place of soap request message (variable value is whole SOAP request message prepared using procedure) in ODI Invoke WebService command like -->
    OdiInvokeWebService "-URL=url...." "-PORT_TYPE=..." "-OPERATION=..." "-RESPONSE_MODE=NEW_FILE" "-RESPONSE_FILE_CHARSET=UTF8" "-RESPONSE_XML_ENCODING=UTF-8" "-RESPONSE_FILE=..." "-RESPONSE_FILE_FORMAT=SOAP" "-HTTP_USER=..." "-HTTP_PASS=..."
    #SOAPREQUESTMESSAGE
    Gives error :
    ODI-1226: Step OdiInvokeWebService 1 fails after 1 attempt(s).
    ODI-1241: Oracle Data Integrator tool execution fails.
    Caused By: com.sunopsis.wsinvocation.SnpsWSInvocationException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '#' (code 35) in prolog; expected '<'
    at [row,col {unknown-source}]: [1,1]
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.loadFromXML(AbstractMessageImpl.java:333)
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.loadFromString(AbstractMessageImpl.java:348)
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.fromString(AbstractMessageImpl.java:403)
        at com.sunopsis.wsinvocation.client.impl.AbstractJWSDLParserImpl.fromXML(AbstractJWSDLParserImpl.java:272)
        at com.sunopsis.wsinvocation.client.impl.AbstractJWSDLParserImpl.getWebServiceRequestByOperation(AbstractJWSDLParserImpl.java:260)
        at com.sunopsis.dwg.tools.common.WebserviceUtils.getSOAPMessage(WebserviceUtils.java:94)
        at com.sunopsis.dwg.tools.common.WebserviceUtils.invoke(WebserviceUtils.java:138)
        at com.sunopsis.dwg.tools.InvokeWebService.actionExecute(InvokeWebService.java:327)
        at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3437)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1509)
        at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:44)
        at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
        at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
        at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
        at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
        at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
        at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
        at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
        at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
        at java.lang.Thread.run(Thread.java:662)
    Thanks in anticipation...

    the used variable 'SOAPREQUESTMESSAGE' is being created in a procedure using jython.
    1. Can we use this variable (SOAPREQUESTMESSAGE) value in the next step that is while invoking web service request (can it persist) ?
    2. If not then how can we use this variable value to invoke ws request in next step ?
    Would like to appreciate help.
    Pls reply.

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • Error produced when trying to pass variables to a Matlab script

    For some reason, LabVIEW produces an Error 1047 (Unable to pass variable to the script server) whenever I create an input variable to a Matlab code block.
    Outputs work fine (for example, connecting an output "a" to a Matlab code block that says "a=rand(50)" correctly produces a 50x50 array of random numbers that can be displayed in LabVIEW). However, creating any kind of input node, whether or not the associated variable is mentioned in the MATLAB script, brings up an error 1047.
    Any ideas what could be causing this? I'm using LabVIEW 7.0 and MATLAB 7 (R14). I've read the article
    >here and that's not the problem, and I've also updated my matscript.dll to the latest version, 7.0.0.2, which also made no difference.

    For what its worth,
    I work in a company with a lot of Matlab users, and I,m programming in Labview and Matlab.
    When I create a testrig measurement I always have to convert data into Malab format, so I used the script server a lot... exept we have a limited pool of Matlab
    licenses so my work was halted whenever the licences where gone.
    So I wrote a Write2Matlab vi.
    This vi can log data from a measurement and write it in a Matlab readable file format (Matlab6 R12).
    After logging you can append more data. It works with(Double,Single,Int32,Int16,U16,U8,String) matrix see for yourself in an example (Write2matlab_test.vi).
    Perhaps this is an alternative solution for your problem.
    Please send me a reply if you find it usefull.
    John
    Attachments:
    Write2Matlab.llb ‏1145 KB

  • How to pass variable form javacript to java BackingBean

    Hello,
    I am trying to pass variable from Javascript method (which is written in jspx) page to a Java BakingBean.
    here is the Javascript code:
    <SCRIPT type="text/javascript">
    function OnSave() {
    alert("The signature you have taken is the following data: " + SigPlus1.SigString);
    </SCRIPT>
    of course, this method will be called after the use press save button as follow:
    <INPUT id="submit1" name="Save" type="submit" value="Save" onclick="OnSave()"/>
    As you can see this Javascript will alert the result to the user. Instead I want to pass the object ( SigPlus1) to a Java Bean.
    I am using ADF technology with JDveloper 11.1.2.3

    here is the answer:
    ADF RichClient API - af:serverListener

  • Passing variables to loaded external movie

    Ok, this problem has beaten me for the last 2 days. It seems
    to be extremely simple, I am on main movie and I am using
    MovieClipLoader class to load external movie callMe.swf into movie
    holder called holder_MC, then from main using onLoadInit or
    onLoadProgress listeners I can target dynamic text inside
    callMe.swf as holder_MC.myTXT.text = "blablabla" or I can change
    frames in callMe.swf by holder_MC.gotoAndStop(5). But HOW TO PASS
    VARIABLE myVar to callMe.swf so it executes something there? Using
    holder_MC.myVar DOESN'T WORK!!!!!!!!!!!!!!
    Thanks for any help,
    Zbynek

    UPDATE... I copied the link to another page with my variables in the image attributes as I posted above. And it works using the values that are cached for those items. Is there any way to do this on the same page as my original link without my users having to change to a different page?

  • How to pass variables between loaders

    Hi,
    I am trying to load an image, with descriptive text and a back button on the click of a thumbnail of the image. I am using a MovieClipLoader instance to do this.
    Here are my problems:
    1. I tried loading the image, with the text(which is within an external swf), using the same loader, but since I am placing them dynamically, depending on the dimensions of the image, I need to pass variables between the two. The image loader is taking longer than the text (obviously) but I need the dimensions of the image before I can place the text. How do I do that??
    2. I tried using two loaders, with separate listeners, and the problem once again is that the text loads before the image, and is hence placed with default values instead of the values derived from the image. The code is within onLoadInit(). Is it possible for me to get the dimensions of the image from onLoadStart()???
    3. There is a back button within the text.swf. I want the image and the text.swf to be unloaded when this button is clicked. How can I achieve that? Can I call loader.unloadClip(target), from within this? Will it recognize the variable?
    4. Is there a much easier way to do this, which I am sadly unaware of?
    Any help will be appreciated.

    Tried the onloadstart() function, but it gives target._width and _height as 0. So that is ruled out...any other suggestions?

  • How to pass variables to Skin applied with skinClass?

    Hi all,
    I'm experimenting with new skin for a SkinnableContainer, and I would like to pass variables to that skin to dynamically change some elements.
    This is how I would like it to work, but it doesn't. Is there a way to make it work? (Or something similar... like defining new stylesheet-elements in the skin.)
    <s:SkinnableContainer skinClass="skins.SkinnableContainerBackground" gradient1="0xFFF000" gradient2="0x000FFF>
    <s:RichText id="rt1" width="400" height="200"  />
    </s:SkinnableContainer>
    Skin:
    <s:Skin xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:d="http://ns.adobe.com/fxg/2008/dt"
            xmlns:ai="http://ns.adobe.com/ai/2008"
            height="100%"
            width="590">
        <s:layout>
            <s:BasicLayout/>
        </s:layout>
        <s:states>
            <s:State name="normal"/>
            <s:State name="disabled"/>
        </s:states>
        <fx:Metadata>[HostComponent("spark.components.SkinnableContainer")]</fx:Metadata>
        <fx:Script>
            <![CDATA[
                [Bindable] public var gradient1:uint;
                [Bindable] public var gradient2:uint;
            ]]>
        </fx:Script>
        <s:Group top="0"
                 bottom="0"
                 left="-11"
                 right="0">
            <s:Group x="15"
                     top="0"
                     bottom="0"
                     id="kaft">
                <!--            <s:filters>
                     <s:DropShadowFilter alpha="0.4"
                     blurX="6"
                     blurY="6"
                     distance="4.24264"
                     quality="3" />
                     </s:filters>
                -->
                <s:Rect width="586"
                        ai:knockout="0"
                        d:userLabel="kaft"
                        top="0"
                        bottom="0">
                    <s:fill>
                        <s:LinearGradient y="82.3125"
                                          scaleX="585.975"
                                          rotation="-0">
                            <s:GradientEntry color="{gradient1}"
                                             ratio="0.466667"/>
                            <s:GradientEntry color="{gradient2}"
                                             ratio="1"/>
                        </s:LinearGradient>
                    </s:fill>
                </s:Rect>
            </s:Group>
        </s:Group>
        <s:Group id="contentGroup"
                 left="20"
                 right="20"
                 top="10"
                 bottom="20">
            <s:layout>
                <s:BasicLayout/>
            </s:layout>
        </s:Group>
    </s:Skin>

    ou can also define custom CSS styles:
    MySkinnableContainer.as
        [Style(name="gradientA", type="uint", format="Color", inherit="no")]
        [Style(name="gradientB", type="uint", format="Color", inherit="no")]
        public class MySkinnableContainer extends SkinnableContainer
            public function MySkinnableContainer()
                super();
    MySkinnableContainerSkin.mxml
    <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/halo"
                 xmlns:s="library://ns.adobe.com/flex/spark">
        <fx:Metadata>
            <![CDATA[
            [HostComponent("MySkinnableContainer")]
            ]]>
        </fx:Metadata>
        <s:states>
            <s:State name="normal" />
            <s:State name="disabled" />
        </s:states>
        <s:Group bottom="0" left="-11" right="0" top="0">
            <s:Group id="kaft" x="15" bottom="0" top="0">
                <s:Rect width="586" bottom="0" top="0">
                    <s:fill>
                        <s:LinearGradient y="82.3125" scaleX="585.975" rotation="-0">
                            <s:GradientEntry color="{getStyle('gradientA')}" ratio="0.466667" />
                            <s:GradientEntry color="{getStyle('gradientB')}" ratio="1" />
                        </s:LinearGradient>
                    </s:fill>
                </s:Rect>
            </s:Group>
        </s:Group>
        <s:Group id="contentGroup" bottom="20" left="20" right="20" top="10" />
    </s:SparkSkin>
    styles.css
    @namespace local "*";
    local|MySkinnableContainer {
        gradientA: #FF0000;
        gradientB: #000FFF;
        skinClass: ClassReference("MySkinnableContainerSkin");   
    main app:
        <fx:Style source="styles.css" />
        <local:MySkinnableContainer width="590" height="100%">
            <s:RichText id="rt1" width="400" height="200" color="#000000" text="test" />
        </local:MySkinnableContainer>

  • How can I pass variable to eventdriven startElement() function?

    I am new to java and SAX. Could anybody tell me how to pass variable to eventdriven startElement function? I tried the following code but didn't work.
    public class ReadXmlSax extends DefaultHandler
    String elementName;
    String requestName;
    Vector v = new Vector();
    public Enumeration getAttribute(String sFileName, String sTagName, String sAttrName)
         Enumeration e;
         elementName=sTagName;
    requestName=sAttrName;
    File f = new File(sFileName);
    // Use an instance of ourselves as the SAX event handler
    DefaultHandler handler = new ReadXmlSax();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse(f, handler);
    } catch (Throwable t) {
    t.printStackTrace();
    e = v.elements();
    return(e);
    //===========================================================
    // SAX DocumentHandler methods
    //===========================================================
    public void startDocument()
    throws SAXException
    public void endDocument()
    throws SAXException
    public void startElement(String namespaceURI,
    String sName, // simple name
    String qName, // qualified name
    Attributes attrs)
    throws SAXException
              //System.out.println(elementName);
              if (qName.equals(elementName))
                   String serverName = attrs.getValue("",requestName);
                   v.addElement(serverName);
    }

    I attached the main call the ReadXmlSax class. I added the
    "system.out.println(elementName);" in the function getAttribute and startElement as well. I got printing out "name" for elementName from function getAttribute but got others printing out "null" for elementName from function startElement. Any suggestions? thanks
    import java.io.*;
    import java.util.*;
    import ReadXmlSax;
    public class ReadElement
         public static void main(String argv[])
              ReadXmlSax r = new ReadXmlSax();
              Enumeration e = r.getAttribute("dre.xml","server","name");
              try{
                   while (e.hasMoreElements()) {
                   System.out.println((String)e.nextElement());}
              }catch(Throwable t){
                   t.printStackTrace();
    <strong>test</strong>

Maybe you are looking for

  • How to setup the Home Screen Application

    Hi, I'm using Nokia 5630 XpressMusic. When I goto Menu->Settings->Settings->General->Personalisation->Standby Mode->Home Screen Application, there is a list of application available for selection(Mark/UnMark) as below: O Shortcut bar O Calendar O WLA

  • [Solved] Owncloud can't access remotely if not on root of server

    I installed Owncloud on a new archlinux server I have. It will be used as a firewall and router (it has 2 nics) The default owncloud package from AUR makes a config file for apache that creates a virtual host on port 80 of the server pointing to ownc

  • IMovie not communicating with camcorder

    i have a panasonic pv-gs14 and i got imovie 6. I used a firewire cable and made sure it was securely in. I tried turning the camera on and off (same in imovie), etc., etc. HELP! PowerBook G4, 12-inch   Mac OS X (10.4.8)   Puhcased in 2004

  • Please tell me whether Dev Trace can generate more than 2 generation.

    Hello Experts, Now, I would like to know whether Dev Trace (dev_disp,dev_dispatcher etc). System is 46C / AIX. We have executed daily restart due to backup. As some troubles were occurred on Friday midnight, we can't  obtain trace on Monday. I am als

  • Backups on Physical standby database?

    I am using dataguard and a physical standby database.How to assign backups on physical standby database to reduce the load on Primary database. environment: windows Database version:11.2.0.1.0 What are the pro and cons on assigning RMAN backups jobs