How can i pass variables from component MXML to main MXML

I have been struggling to pass some variables from my custom PanelTest.mxml to Main.mxml
In my Main.mxml, i tried:
import PanelTest;
private var newVar:String;
private var _panel:PanelTest;
_panel.thisVar = newVar;
I then bind the newVar to a Label textfield and nothing happens.
Thanks

One possibility would be to use a Login PEI to set a unique UserInfo Name/Value for the user. I think in 5.0 each guest session is unique, so would have unique UserInfo. Then you could pass this value to your portlet (by specifying it in the web service) and use it as a key into a Application-scoped hashmap where you store your info. In other words, your Application variables option, but you have a way of uniquely naming your variables via PEI-set UserInfo.

Similar Messages

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

  • Need Help ! how can I Pass Variable from JApplet to PHP?

    I think I post to the wrong forum and I don't know how to change.
    Sorry for messing thing.
    I try to send variable for applet to php but the result is no data was recorded in my database.
    I think the data did not transfer to php.
    I am familiar with php but new to java.
    Actually, I don't know how to send the variable for applet.
    For example, in PHP will receive $_POST['score'] so in applet, I need to send the variable name "score".
    In the book that I use for self-study, mention about servlet but I think PHP is much easier to me.
    So I need to know how set this request data to my applet.
    In internet, I still not get what is clear for me to understand.
    Or I may search with worng keyword or way.....
    Can someone please help me?
    public class test extends JApplet { public test(){ JButton myButton = new JButton("sendData");         myButton.setFont(new Font("Sansserif", Font.PLAIN, 14));         myButton.setSize(15, 10);                 myButton.addActionListener(new button());         add(myButton); } private class button implements ActionListener {         public void actionPerformed(ActionEvent e) {         PostMsg(10,"hello");         } } public void PostMsg(int score, String name){ try {             String data = "name=" + name + "score=" + score;                    byte[] parameterAsBytes = data.getBytes();      // Send data     URL url = new URL("http://localhost/addtest.php");     URLConnection con = url.openConnection();     ((HttpURLConnection) con).setRequestMethod("POST");          con.setDoOutput(true);          con.setDoInput(true);          con.setUseCaches(false);          OutputStream wr = con.getOutputStream();              wr.write(parameterAsBytes);     wr.flush();     // Get the response     BufferedReader rd = new BufferedReader(new InputStreamReader(con.getInputStream())); wr.close();     rd.close(); } catch (Exception e) { System.out.println("ERROR"+e.getMessage()); } } }
    <html> <title>Untitled Document</title> </head> <body> include("../connectionJAVA/connect.php"); $name = $_POST['name']; $score =$_POST['score']; //insert data $sql = "insert into java values(null,'$name','$score')"; mysql_query($sql) or die("error=$sql"); </body> </html>

    rinJava wrote:
    I think I post to the wrong forum and I don't know how to change.Yep wrong forum. This is probably a html/applet/web service sort of question.

  • How can I Pass Variable from JApplet to PHP?

    I try to send variable for applet to php but the result is no data was recorded in my database.
    I think the data did not transfer to php.
    I am familiar with php but new to java.
    Can someone help me?
    public class test extends JApplet {
         public test(){
               JButton myButton = new JButton("sendData");
                 myButton.setFont(new Font("Sansserif", Font.PLAIN, 14));
                 myButton.setSize(15, 10);
                 myButton.addActionListener(new button());
                 add(myButton);
         private class button implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                 PostMsg(10,"hello");
         public void PostMsg(int score, String name){
               try {
                      String data = "name=" + name + "score=" + score;          
                      byte[] parameterAsBytes = data.getBytes();   
                    // Send data
                       URL url = new URL("http://localhost/addtest.php");
                       URLConnection con = url.openConnection();
                       ((HttpURLConnection) con).setRequestMethod("POST");  
                      con.setDoOutput(true);  
                      con.setDoInput(true);  
                      con.setUseCaches(false);  
                      OutputStream wr = con.getOutputStream();     
                      wr.write(parameterAsBytes);
                       wr.flush();
                       // Get the response
                       BufferedReader rd = new BufferedReader(new InputStreamReader(con.getInputStream()));
    wr.close();
                       rd.close();
                   } catch (Exception e) {
                        System.out.println("ERROR"+e.getMessage());
    <html>
    <title>Untitled Document</title>
    </head>
    <body>
    include("../connectionJAVA/connect.php");
    $name = $_POST['name'];
    $score =$_POST['score'];
    //insert data
    $sql = "insert into java
    values(null,'$name','$score')";
    mysql_query($sql) or die("error=$sql");
    </body>
    </html>

    Maybe you should set the proper header according to your form encoding, should be:
    conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");And I think this encoding requires a newline after each parameter, "\n" may suffice, may need even carriage return: "\r\n" (or "\n\r" I never remeber for sure).
    Anyway why don't you use a simple GET instead, since you're sending just one parameter?
    Bye.

  • How can I pass parameters from one process flow to another process flow?

    How can I pass parameters from one process flow to another process flow (sub process) in warehouse builder? let me know the steps I have to do in warehouse builder.
    Thanks in advance,
    Kishan

    Hi Kishan,
    Please post this question to the Warehouse Builder forum:
    Warehouse Builder
    Thanks, Mark

  • HT201250 how can i pass information from one mac to another mac by using the time capsule

    how can i pass information from one mac to another mac by using the time capsule

    If you want to transfer files, settings, etc., you must open Migration Assistant (Applications > Utilities) in the Mac that you want to transfer the files and follow the instructions

  • How can I pass parameter from report to form?

    Hi :)
    Now I try to build conference room like this by using form
    and report. And i design that when users click at group report
    then i'll show page that contain questions report and add
    question form. And question form and report must receive the
    same parameter from group report.
    First Problem: is I don't know how group report send the
    same parameter to question report and add question report at the
    same time. And is it possible??? If not please suggest me what
    should I do???
    Second Problem: is I don't know how can I pass parameter from
    report to form. I don't know the way to do it.
    Please tell me!!! Please...
    I look forward to hearing from all of you.
    Thank You.

    One way is to create a link based on that form and attach that
    link with the report. Through links you can pass parameters

  • How can I pass/add these results in my Main query's column

    Hello Experts
    I’m working on a subquery. My subquery works fine and give the results what I need. But how can I pass/add these results in my Main query’s column ‘MGRNAME’. Here is my query
    select pc.c_id "Project ID",
    cn.c_id "Client ID", cn.c_last "Last Name", cn.c_first "First Name",
    pj.mgr_id "Manager ID", pj.project_name "Project", MGRNAME
    from project_consultant pc
    join consultant cn
    on (pc.c_id = cn.c_id)
    join project pj
    on (pc.p_id = pj.p_id)
    where lower(cn.c_last) = 'myers'
    and MGRNAME in
    ( select concat (substr(c_last,1,20),
    substr(c_first,1,20))
    as MGRNAME from consultant
    where c_id in (102, 103)
    When I run the above query I got error.
    Thanks a lot on advance

    I’ve join three tables to get the information about I need. I got everything working expert one part. The subquery
    ( select concat (substr(c_last,1,20),
    substr(c_first,1,20))
    as MGRNAME from consultant
    where c_id in (102, 103)
    Gives me the names of employees I need. The output comes 2 names. I’m trying to add these 2 names in my main query and show the results but I got the following error
    Error at Command Line:11 Column:4
    Error report:
    SQL Error: ORA-00904: "MGRNAME": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    I can understand there is something wrong with MGRNAME field but not sure what it is. Can somebody point it out?
    Once again this is main query with single sub query
    select pc.c_id "Project ID",
    cn.c_id "Client ID", cn.c_last "Last Name", cn.c_first "First Name",
    pj.mgr_id "Manager ID", pj.project_name "Project",
    MGRNAME
    from project_consultant pc
    join consultant cn
    on (pc.c_id = cn.c_id)
    join project pj
    on (pc.p_id = pj.p_id)
    where lower(cn.c_last) = 'myers'
    and MGRNAME in
    ( select concat (substr(c_last,1,20),
    substr(c_first,1,20))
    as MGRNAME from consultant
    where c_id in (102, 103)
    Hope it helps

  • How can I pass value from sql query to unix script

    I am new to oracle/unix.
    I want to write a simple script to find max date from a table and then pass date into a variable in a korn shell script.
    sql is select max(date) from table;
    how can I pass that value in unix shell as a variable. Thanks

    I use to code like this.
    Enjoy Scripting.
    cmd.sql
    select sysdate from dual;
    exit
    db.sh
    #! /usr/bin/ksh
    . ~oracle/.orapaths
    dbdate=$(sqlplus -S user/pwd@servicename @cmd.sql)
    echo $dbdate
    Run shell scripts
    ./db.sh
    SYSDATE --------- 19-JAN-07

  • How can I pass arguments from one MIDlet to another MIDlet

    Hi everybody !
    Can anybody help me in knowing that how can I pass the parameters from one
    MIDlets to another one in same application.
    I am devloping a application in which I am using more than two MIDlet and I
    want to transfer Parameter from one MIDlet to another one.
    I just explain what I have done....
    I made a MIDlet "A" and "B" in the same project using NetBeans IDE.
    In MIDlet "A" I create the Object of MIDlet "B" so that the constructor of
    MIDlet "B" is called and parameter can be transferred.
    But when I run the program it shows me two MIDlet on the screen, that I
    doesn't need.
    Suggestion are most welcome....
    Thanks in advance
    Regards
    Bhagwat

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

  • How can I pass data from a form guide to another form in a business process

    How do we pass data from a form guide to another form(not necessarily a guide) without having to open the form. For example we have a small form guide to capture the contract id so we can then get data from contracts table to present to the user in a form. We want the user to open the guide (either Flex guide or form guide) to enter the contract id. Upon submission we want the process to get the contract data and put it into the form that will be opened at the next step by the user without having a user interact with the form to get the data into it. In other words we need the process to get the data and populate a different form than the form guide the contract id was entered in and this new form needs to be opened in the next step by the user.

    Firstly, I'm assuming that you have a Forms ES Server if you are rendering a Guide.  This could be either version ES1, ES2/2.5 or ES3/ADEP
    If you submit the form back to the server, you can populate a second (PDF/XDP) form with the data bound to the same schema/Data Model using Forms ES. 
    You referred to the next user in the chain - If you are using Process Management, this is very easy, as you define what form is used to render the data in the "Presentation & Data" section of the Assign Task activity

  • How can I pass variable's from one frame to other

    //This is the first frame where the value in the TextField
    //tf1 and tf2 are to be passed to 2nd Frame
    import java.awt.*;
    import java.awt.event.*;
    public class del extends Frame implements ItemListener,ActionListener
    public Panel p,p1,p2;
    public Button b,n;
    public Label l1,l2;
    public TextField tf1,tf2;
    public del()
    setLayout(new FlowLayout(FlowLayout.LEFT));
    Panel p=new Panel();
    n=new Button("Submit");
    p.add(n);
    add(p);
    l1=new Label(" Enter the Temperature : ");
    tf1=new TextField(5);
    p.add(l1);
    p.add(tf1);
    add("South",p);
    l2=new Label(" Enter the Compund ");
    tf2=new TextField("N-OCTANE",15);
    p1=new Panel();
    p1.add(l2);
    p1.add(tf2);
    add("South",p1);
    setSize(600,700);
    setVisible(true);
    public void itemStateChanged(ItemEvent ie)
    repaint();
    public void actionPerformed(ActionEvent a)
    if(a.getSource()==n)
    this.setVisible(false);
    new Finalput1();
    repaint();
    public static void main(String[]args)
    del d=new del();
    //2nd Frame which will appear on clicking submit button
    import java.awt.*;
    class del1 extends Frame
    public static double T;//value in 1st text field has to be stored in variable T
    String compd=" ";//value in 2nd textField has to be stored in this string
    TextField tf;
    public del1()
    setLayout(new FlowLayout());
    setSize(800,700);
    setVisible(true);
    public void paint(Graphics g)
    g.drawString(" INPUT DATA : - ",30,120);
    g.setColor(Color.black);
    g.drawString(" Component Name ="+compd,20,160);
    g.drawString(" Temperature of the Mixture ="+T,30,250);
    public static void main(String[]args)
    new del1();
    Pls help me.
    I will be happy if anyone help's me!

    Both your classes seem to be independent applications. (they are public, and they have their public static void main)
    Is this your intention? If so, your question is how to pass data from one application to another. That can be done in many ways, and it is a complicated issue. (if one application wants to pass data to another, you first have to find the other one, and if it isnt running you might want to start... - lots of things to think about.)
    If what you want to do is simply to pass data from one Frame to another, the matter is quite more simple.
    Here is a sample:
    import java.awt.event.*;
    import java.awt.*;
    public class F1 extends Frame implements ActionListener
    private F2 theOtherFrame;
    public F1()
    Button b;
    b=new Button("Action");
    b.addActionListener(this);
    add(b);
    setSize(100,100);
    setVisible(true);
    public void actionPerformed(ActionEvent e)
    if (theOtherFrame == null)
         theOtherFrame = new F2();
         theOtherFrame.setSize(100, 100);
    theOtherFrame.setSomeData("Her you have som data");
    theOtherFrame.setVisible(true);
    public static void main(String[] args)
    new F1();
    class F2 extends Frame
    private String strData;
    private Label lab;
    public void setSomeData(String str)
    lab.setText(str);
    repaint();
    public F2()
    lab = new Label();
    add(lab);

  • How to access a variable from one mxml to another mxml?

    I have Vbox having Hbox in turn hbox has some components ...TextInput...
    I m adding this Vbox in another mxml file....iteratively ....
    I need the sum of all the enetered values in the text boxes to be displayed on the textbox in another Mxml ...
    I am taking sum in a variable and want to show tha some in another file...
    How can I get that variable in my resultant mxml??
    TIA

    In this case it is best to use custom events to pass data. Here are some resources:
    http://chikaradev.com/learning/flex3/customevents/StudentsTutoringCustomEvents1.pdf
    http://chikaradev.com/learning/flex3/customevents/CustomEvents3/CustomEvents3.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • How can i pass string from C++ DLL to Java via JNI?

    Hi everybody. I made a DLL with Borland C++. I must pass a string from this dll to Java via JNI.Namely i define a string variable in C++ DLL and i send this variable's value to Java via JNI.
    I can pass integers but i couldnt Strings. . How can i do this? is there any sample?

    Hi,
    So your function should be private static native String get_text();
    (It's often a good idea to make native methods private since when you change signatures you generally have to change java wrapper methods only).
    I know nothing about C++ strings but I'm pretty sure that you can convert it to char*, so
    do :
    char* szMyString = myString.toChar*();
    Then return from native with JNU_NewStringPlatform(env, szMyString)
    (see my 1st answer for JNU_NewStringPlatform() description).
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can I pass information from one portlet to another?

    First, some background...
    I am using Portal 5.0.2 and developing portlets using JSP/Java on a remote server.
    I need to pass information from a portlet on pageA to another portlet on pageB, but I can't do it using the traditional methods, such as query string, session, cookies, etc. due to either portal framework limitations or because of functional constraints (basically, a user will not necessarily be logged in to the portal, but he can view anything available to the GUEST user). Here are the different ways I've considered using to save state and their limitations:
    Query string: can't use this because portlets on remote servers don't have access to it
    Cookies: if user disables cookies, code will not function properly
    Session variables: limited to one user's connection with one portlet (i.e., can't access a session variable set in portletA from portletB)
    Application variables: because the user may not be logged in, I have no way of uniquely naming variables, which is a necessity in order to maintain state for EACH user
    User Settings: again, the user may not be logged in, so I can't use these
    PCC: can't access client-side variables because server-side JSP executes first
    Are my assumptions above correct? Has anyone had any success using one of these methods given the same constraints, or does anyone have an alternative solution? I'd certainly appreciate any help anyone could provide.
    Thanks,
    Jose

    One possibility would be to use a Login PEI to set a unique UserInfo Name/Value for the user. I think in 5.0 each guest session is unique, so would have unique UserInfo. Then you could pass this value to your portlet (by specifying it in the web service) and use it as a key into a Application-scoped hashmap where you store your info. In other words, your Application variables option, but you have a way of uniquely naming your variables via PEI-set UserInfo.

Maybe you are looking for

  • Display Resolution affects download speed

    Switched display to a Viewsonic VX2235wm with a resolution of 1680 x 1050, and noticed that my internet download speed went WAY down. Coincidence, or did I eat into my resources? Mac mini   Mac OS X (10.4.8)   1GB memory

  • Is there a flash player that support my mobile Nokia 110.?

    browser,flash player in the site of youjizz.com that support my mobile Nokia 110

  • Is it possible to make a shared folder between profiles?

    Hi, My e-mail is a mess with personal and work e-mail and urgent and unimportant email mixed and I am losing a lot of productivity trying to manage the onslaught. I would like to be able to create a new profile for only important work e-mail. I'm won

  • Resizing a photo ...

    I just downloaded Starter Edition and have a picture that is slightly over 3 MB that I want to make a copy of that is 1 MB or less to upload to a site. How do a make a copy with a different size in PSA Starter Edition 3.2?

  • Photo Slideshow on ATV

    I have over 12K pictures for the slideshow to pull from, but it constantly plays the same pictures. Is there a way to make it so it only shows them once?