Bugs item #3580580, was opened at 2012-10-26 08:33
Message generated for change (Comment added) made by hansonr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379133&aid=3580580&group_id=23629

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Applet
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: Tim te Beek (timtebeek)
Assigned to: Bob Hanson (hansonr)
Summary: jsvApplet._applet remains null after Jmol.getJSVApplet

Initial Comment:
Trying to get JSpecView and Jmol to interact using the new JavaScripts, I'm 
unable to get jspecView to show and load data.

Here's a short summary of what I do:

        <script type="text/javascript" src="jmol/jquery-1.8.2.min.js"></script>
        <script type="text/javascript" src="jmol/JmolCore.js"></script>
        <script type="text/javascript" src="jmol/JmolApplet.js"></script>
        <script type="text/javascript" src="jmol/JmolControls.js"></script>
        <script type="text/javascript" src="jmol/JmolApi.js"></script>
        <script type="text/javascript" src="jmol/JmolJSV.js"></script>

//init Jmol
var jmolInfo = {width : 370, height : 370, jarPath : 'jmol', jarFile : 
'JmolApplet.jar', };
jmol = Jmol.getApplet('jmol', jmolInfo);
Jmol.script(jmol, 'load DATA \'inline\'\n ... snipped ... \nEND \'inline\'');

//init JspecView
var jspecInfo = {width : 370, height : 370};
jspec = Jmol.getJSVApplet('jspec', jspecInfo);
Jmol.jsvLoadInline(jspec, 'DATA \'inline\'\n ... snipped ... \nEND \'inline\'');

This fails because jspec._applet is null, meaning the call to loadInLine in 
JmolJSV.js#219 fails with Error calling method on NPObject.



----------------------------------------------------------------------

>Comment By: Bob Hanson (hansonr)
Date: 2012-10-26 08:48

Message:
This is not a bug. This is just not understanding how to synchronize the
loading of the two applets. Since we don't know which applet will finish
loading first, we have to issue a special command that waits for both to
load before giving a script to either:


// applet ids and commands to give only when all applets are ready;
// also sets up a script sync pathway for Jmol/JSpecView.
Jmol.setAppletSync([jsvApplet, jmolApplet], ["load acetophenone.jdx",
null], true);


Says "after these two applets are loaded, send jsvApplet its load command.
The last parameter indicates that this is a Jmol/JSpecView connection,
which is treated specially by Jmol.



See http://chemapps.stolaf.edu/jmol/jspecview/jsvtest.htm

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379133&aid=3580580&group_id=23629

------------------------------------------------------------------------------
The Windows 8 Center 
In partnership with Sourceforge
Your idea - your app - 30 days. Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to