How can I access the dynamically inserted applet from another applet?

Discussion in 'Java' started by huyi0912@hotmail.com, Nov 19, 2007.

  1. Guest

    Hi!
    My html have 2 frames.One is control frame which have a control
    applet loaded.Another frame's content will be insert a dynamically
    generated applet.But the dynamically generated applet can not get
    access to the control applet through it's static variable.How is that?
    I found if the applet was not dynamically inserted to the dom
    tree,then it can access my control applet.I print the classloader of
    each applet and found they are loaded by different classloader(though
    their root is the same).It should work for dynamically inserted applet
    also because all the pages and applet have the same codebase.Any help
    will be appreciated!
    The dynamically inserted applet code snippet:

    <script>
    function insertApplet(){
    var div = document.getElementById("appletDiv");
    div.innerHTML = "<OBJECT ID='"+appletID+"' classid='clsid:
    8AD9C840-044E-11D1-B3E9-00805F499D93' width='300' height='300'>"+
    "<PARAM name='code'
    value='com.jaspect.applet.AppletPanel.class'> "+
    "<PARAM NAME='codebase' VALUE='http://localhost:8080/html'>
    "+
    ...
    "</OBJECT>";
    }
    </script>
    <body onLoad="insertApplet{}">
    ....
    </body>
     
    , Nov 19, 2007
    #1
    1. Advertising

  2. wrote:
    ...
    > My html have 2 frames...


    That is the 'first sign of trouble'. Frames were always quirky
    and problematic. More so as time goes by.

    >..One is control frame which have a control
    >applet loaded.Another frame's content will be insert a dynamically
    >generated applet.But the dynamically generated applet can not get
    >access to the control applet through it's static variable.How is that?


    What browser? The very fact you would not mention the
    browser (make + version), OS (make + version), and JRE
    (make + version), indicates to me that you do not have much
    experience 'wrestling with' applets in browsers, because..

    >I found if the applet was not dynamically inserted to the dom
    >tree,..


    ..besides that, there are no guarantees that applets in the
    same page, different frames of the same page, different 'tabs',
    or different browser instances, will share a VM (or not).

    It is all up to the browser/VM combo.

    (big trim...)

    You spend more words describing the whole complex
    situation, but I am going to ask something you did not
    think to mention.

    What is this all for? Or better still..
    What do these applets do for the end user?

    There may be an altogether better alternative to providing
    this functionality, but it is important to understand the point
    of it all.

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200711/1
     
    Andrew Thompson, Nov 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bijoy Naick

    ID of dynamically inserted user control

    Bijoy Naick, Nov 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    406
    Kikoz
    Nov 17, 2004
  2. lucky
    Replies:
    0
    Views:
    521
    lucky
    Jan 12, 2005
  3. John Burke

    Determining 'first load' state of a dynamically inserted control

    John Burke, May 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    248
    Victor Garcia Aprea [MVP]
    May 5, 2004
  4. gauty
    Replies:
    1
    Views:
    933
    Kashish Malhotra
    Apr 29, 2010
  5. Alvaro G Vicario

    IE: apply stylesheet in dynamically inserted nodes

    Alvaro G Vicario, Aug 30, 2005, in forum: Javascript
    Replies:
    2
    Views:
    116
    Alvaro G Vicario
    Aug 31, 2005
Loading...

Share This Page