0

I am creating a dynamic tab/contentPane as below in home.xhtml file and i am trying to call a function display which is present in order.xhtml,its not getting called. what ever java script is there in order.xhtml is not getting loaded.

In home.xhtml

    if(dijit.byId('ordersummary')!=null){
        dijit.byId('ordersummary').destroy();
        }
    newTab= new dijit.layout.ContentPane({
        id : 'ordersummary',
        title : 'Order Summary',
        href : 'order.xhtml',
        closable : true
    });
    dijit.byId('tabContainer').addChild(newTab);
     dijit.byId('tabContainer').selectChild(dijit.byId("ordersummary"));

javascript in order.xhtml

<script type="text/javascript">
    //<![CDATA[
    function display(){
      alert(" I M BEING CALLED");
             }
     </script>
kumar
  • 708
  • 4
  • 15
  • 39

3 Answers3

0

While I'm not familiar with the dojo toolkit, I think you should put the JavaScript function in the main file or load the JavaScript dynamically like; How do I include a JavaScript file in another JavaScript file?

Community
  • 1
  • 1
dza
  • 1,478
  • 2
  • 13
  • 24
0

There are two ways about this, either a make the script type dojo/method. Or use the extended dojox/layout/ContentPane.

http://livedocs.dojotoolkit.org/dijit/layout/ContentPane#executing-javascript-inside-contentpane

tik27
  • 2,698
  • 1
  • 16
  • 25
0

dijit.layout.ContentPane will not support javascript,i mean it will not execute the javascript content in the input file.

dojox.layout.ContentPane is advanced one and it will support javascript.

kumar
  • 708
  • 4
  • 15
  • 39