MarvinView: Visualize ByteStream

User 49e3cc9e65

27-10-2008 15:27:26

Hi,





I am building a search application using JSF and want to visualize a chemical structure with MarvinView. I use the methods as described in the documentation and if I take the output String and save it as a sdf file, MarvinView can visualize the structure.





The problem is that the structure can not be shown if I try it "on-the-fly" calling the MarvinView Applet via JavaScript.





Here is my Code:


Code:



<h:inputHidden id="cs" value="#{chemAxonList.convertForJavaScript(chemAxonList.actualStructure)}" />


                        


               <script language="JavaScript1.1" src="plugins/marvin/marvin.js"/>


               <script language="JavaScript1.1">


                  mview_name="mview";


                  mview_begin("plugins/marvin", 200, 200);


                  mview_param("mol", document.getElementById("cs").value);


                  //mview_param("mol", "img/caffeine.mol");


                    mview_end();


               </script>








I do not really know how to tell MarvinView that it should handle the input String as SDF Format.





Is there somebody who can help me?








Regards,


Ben

ChemAxon e274e1bada

27-10-2008 15:41:55

I have moved this topic from the "Structure search and chemical database" forum.

User 49e3cc9e65

27-10-2008 15:42:52

Now it works:





So the problem was that I do not need to convert the String via convertForJavaScript. This function adds some /n that could somehow not be interpreted by the Applet.





The "mol" parameter was correct to tell MarvinView that it is a SDF Format.