4 Replies Latest reply on Mar 23, 2013 4:32 AM by tremes

    embedded object tags not working in jsf

    maran_su

      Hi ,

       

            I am trying to embed the .mol files it for displaying the chemical structure,if i use the following piece of code inside <f:view > tags it is not working

      where as if i use plain HTML tags(refer the attachment) it is working what am i missing in jsf file,

       

      display.xhtml

      ___________

       

      <f:view xmlns="http://www.w3.org/1999/xhtml"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:f="http://java.sun.com/jsf/core" >

        <h:head>

        <f:verbatim>

          <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, IE=9"/>

          <link rel="stylesheet" type="text/css"

           href="#{facesContext.externalContext.requestContextPath}/chemvector/stylesheets/chemvector.css" />

          <link rel="stylesheet" type="text/css"

           href="#{facesContext.externalContext.requestContextPath}/chemvector/stylesheets/demo.css" />

          <link rel="stylesheet/chemical" type="application/json"

          href="#{facesContext.externalContext.requestContextPath}/chemvector/stylesheets/chemistry.json" />

          <script src="#{facesContext.externalContext.requestContextPath}/chemvector/lib/chemvector.js"></script>

          <script>

            chemvector.browser.ImageLoader.init({

              // startup parameters here

            });

          </script>

          </f:verbatim>

        </h:head>

        <h:body>

          <h1> Structure Display Demo</h1>

         

          <h2>Table View</h2>

          <f:verbatim>

          <table>

            <tbody>

              <tr>

                <td>

                  <div class="cell">

                    <div class="structure">

                      <object width="100%" height="100%" class="chemvector-object">

                        <param name="src" value="#{facesContext.externalContext.requestContextPath}/chemvector/data/abarelix.mol"/>

                      </object>

                    </div>

                  </div>

                </td>

                            </tr>

                            </tbody>

                            </table>

           </f:verbatim>

           </h:body>           

      </f:view>

       

       

      can any one help me please.

       

      Thanks .

        • 1. Re: embedded object tags not working in jsf
          maran_su

          Reposting the same issue, can any body help me.

          i tried display.xhtml with in <h:form> tag also but that also not loading the mol file available in the <object> tag.

          • 2. Re: embedded object tags not working in jsf
            tremes

            Hi!

            The problem is that you cannot display your .mol files, am I right? I have never worked with these files, but did you try to use h:graphicImage instead of object?? If you check your rendered html, is that path #{facesContext.externalContext.requestContextPath}/chemvector/data/abarelix.mol corect?

            • 3. Re: embedded object tags not working in jsf
              maran_su

              Thanks Tomas Remes,

               

               

              I tried <h:graphicImage> please see the attachment (output.png it is also not loading the mol files).do i need to add any other attributes in <h;graphicImage > like render etc..(please see the attached XHTML)

               

              and you said you never worked on mol files leave the mol files normally if you put any other file format iside object tag inside <f:view> it is not working.

               

              and you asked the path was correct, yes the path was absolutly correct, because the same path is working under <html> tag but it is not working under <f:view>

               

              please can you help me little bit more.

               

              i am really struck here for more than two three days.

              • 4. Re: embedded object tags not working in jsf
                tremes

                As I checked some JSF examples, I think that there is no need to specify path using facesContext. You can check for example this http://www.mkyong.com/jsf2/jsf-2-graphicimage-example/. It worked for me even inside <f:view> tag.