1 Reply Latest reply on Oct 30, 2008 8:51 AM by Justin Birch

    what determines which script elements are included in a page

    Andrew Fuqua Newbie

      I have demo code for an application (based on Fiji) that I am trying to get to work in an existing project. The demo code generates several more script elements (e.g. for PrototypeScript.js and others) that my code does not. My question is what determines which .js files are included in a page? It doesn't look like it's done manually, so how is it done? See the different head sections of the demo code and my code below. I need my code to have the same scripts as the demo code.

      Thanks,

      Andrew

      demo code's header:

      <head>
      <link class="component" rel="stylesheet" type="text/css" href="/fiji-demo/a4j/s/3_2_2.CR3org/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAFb-IhhU-jyGdIAE0wD5Q__.jsf">
      </link>
      <link class="component" rel="stylesheet" type="text/css" href="/fiji-demo/a4j/s/3_2_2.CR3org/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAFb-IhhU-jyGdIAE0wD5Q__.jsf">
      </link>
      <link class="component" rel="stylesheet" type="text/css" href="/fiji-demo/a4j/s/3_2_2.CR3css/panel.xcss/DATB/eAFb-IhhU-jyGdIAE0wD5Q__.jsf">
      </link>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org.ajax4jsf.javascript.AjaxScript.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org.ajax4jsf.javascript.PrototypeScript.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org.ajax4jsf.javascript.ImageCacheScript.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org/richfaces/renderkit/html/scripts/browser_info.js.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org/richfaces/renderkit/html/scripts/utils.js.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3scripts/panelbar.js.jsf" type="text/javascript">
      </script>
      <link class="component" rel="stylesheet" type="text/css" href="/fiji-demo/a4j/s/3_2_2.CR3css/panelbar.xcss/DATB/eAFb-IhhU-jyGdIAE0wD5Q__.jsf">
      </link>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3com/exadel/fiji/renderkit/html/AC_OETags.js.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3scripts/scriptaculous/effects.js.jsf" type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org/richfaces/renderkit/html/script/processEffect.js.jsf" type="text/javascript">
      </script>
      <link class="component" rel="stylesheet" type="text/css" href="/fiji-demo/a4j/s/3_2_2.CR3css/highlight.xcss/DATB/eAFb-IhhU-jyGdIAE0wD5Q__.jsf">
      </link>
      <link class="component" rel="stylesheet" type="text/css" href="/fiji-demo/a4j/s/3_2_2.CR3META-INF/skins/laguna.xcss/DATB/eAFb-IhhU-jyGdIAE0wD5Q__.jsf">
      </link>
      <script type="text/javascript">
      </script>
      <script src="/fiji-demo/a4j/g/3_2_2.CR3org/richfaces/renderkit/html/scripts/skinning.js.jsf" type="text/javascript">
      </script>
      <link class="user" rel="stylesheet" type="text/css" href="/fiji-demo/css/common.css">
      </link>
      <link class="user" rel="stylesheet" type="text/css" href="/fiji-demo/css/styles.css">
      </link>
      <meta content="text/xhtml; charset=UTF-8" http-equiv="Content-Type"/>
      <title>Fiji. Feature. Access Flex API</title>
      <link type="text/css" href="/css/footer_ff.css" rel="stylesheet">
      </link>
      <style>
      </style>
      <style>
      </style>
      </head>
      


      My header:
      <head>
      <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3org/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__">
      </link>
      <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3org/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__">
      </link>
      <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3css/toolBar.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__">
      </link>
      <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3css/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__">
      </link>
      <script type="text/javascript" src="/ds2/a4j/g/3_2_2.CR3org.ajax4jsf.javascript.AjaxScript">
      </script>
      <script type="text/javascript" src="/ds2/a4j/g/3_2_2.CR3com/exadel/fiji/renderkit/html/AC_OETags.js">
      </script>
      <script type="text/javascript">
      </script>
      <script type="text/javascript" src="/ds2/a4j/g/3_2_2.CR3org/richfaces/renderkit/html/scripts/skinning.js">
      </script>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      <title>ds2</title>
      <link href="stylesheet/theme.css" rel="stylesheet" type="text/css">
      </link>
      </head>
      


        • 1. Re: what determines which script elements are included in a
          Justin Birch Newbie

          For ajax; during rendering response the AjaxViewHandler traverses the viewroot searching for renderers which are instances of org.ajax4jsf.renderkit.HeaderResourceProducer.

          For each of these renderers getHeaderScripts is called which calls getScripts on the componentrenderer.

          The scripts returned are inserted into HEAD. I assume any other scripts are inserted using similar methodology.

          See org.ajax4jsf.context.ViewResources.processHeadResources