PDA

View Full Version : problem in my tabpanel



kd21
2 Feb 2007, 7:07 AM
hi
i have create one tabpanel with four tabs
when i click history tab then through ajax another page be come on this tabpanel but
this coming file is a jsp file, which already have another tabs
but i have seen only text data not full original page with all tabs...

my code are like this....

tabs = new YAHOO.ext.TabPanel('tabs');
tabs.addTab('createorder', "Create Order");
var newtab =tabs.addTab('history', "History");
var updater = newtab.getUpdateManager();
updater.setDefaultUrl('tabs.jsp');
newtab.on('activate', updater.refresh, updater, true);
......................................................................................
tabs.jsp

<%@ page import="java.util.*;"%>
<% response.setContentType("text/html");%>
<html>
<head>
<title>Layout</title>
<head>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/utilities_2.1.0.js"></script>
<link rel="stylesheet" type="text/css" href="yui-ext.0.33/resources/css/yui-ext.css" />
<script type="text/javascript" src="yui-ext.0.33/yui-ext.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body scroll="no" id="layout">

<div id="tabs1">
<div id="innertab">
inner tab
<div id="in1">inner tab 1 content </div>
<div id="in2">inner tab 2 content </div>
</div>
<div id="tab2">second </div>
<div id="tab3">third </div>
I want to add tab pannel here
</div>
<div id="tree-view"></div>



</body>
</html>
----------------------------------------------------------
i know i hv doing some silly mistake plz guide me
thanks in advanced
kd21

tryanDLS
2 Feb 2007, 7:19 AM
Read the UpdateManager doc - scripts are not processed by default in the loaded content.

EDIT:
Also, you can NOT use the this in your code
src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/utilities_2.1.0.js"

You need to download the yui code from yahoo and host it yourself.

Animal
2 Feb 2007, 7:25 AM
To make it process the scripts, see the UpdateManager documentation

Take out this bit:



<html>
<head>
<title>Layout</title>
<head>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/utilities_2.1.0.js"></script>
<link rel="stylesheet" type="text/css" href="yui-ext.0.33/resources/css/yui-ext.css" />
<script type="text/javascript" src="yui-ext.0.33/yui-ext.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body scroll="no" id="layout">


It's not a full document.

It's just a fragment to be loaded using innerHTML.

It's not valid to have <html> and <body> tags loaded into innerHTML.

Include script files on the main page - you don't want yui-ext to be reloaded every time you load a page through the UpdateManager!

If you want script to execute inside that page, just code in <script type="text/javascript">dothis();...</script> in your page... and don't forget to read the docs on how to make them execute!

And take out this



</body>
</html>

kd21
3 Feb 2007, 1:28 AM
thanks
i will try ....
kd21

kd21
5 Feb 2007, 5:47 AM
hi
one query is here
how to add image or button in contentPanel's tab.

my tabs is generated automatic when i m create the contentPanel.....

layout.add('center', new YAHOO.ext.ContentPanel('center1', {title: 'Home', closable: false}));

is here any other properties or method for this.....
plz give me response
kd21