Tab Example doesn't seem to work right

Question: Hi, I've set up the web template tab example for reports that the BW help provides. The first tab is highlighted to show as selected, but if I select other tabs they do not show up as selected even though the reports show up for the tab selected. Can anyone tell me what might be wrong???

<script type= "text/javascript" >
<!--
/* function goto_tab: Show all items, starting with tabname, Hide all other items */
function goto_tab(tabname) {
SAPBWOpenURL(SAP_BW_URL_Get()+'&multi=X&item=TAB*&hidden=X&cmd_1=item%3d'+tabname+'*%26hidden%3d %26multi%3dX');
}

/* DHTML function to set correct span-Tag visible
For each Tab in Tab-Header (head_TAB) check, if item TABx is visible
If Item is visible set Header as selected
Otherwise set corresponding span-Tag to not visible */
function set_actual_tab() {
i=0;
do { i++;
if (document.getElementById('head_TAB'+i) != null) {
/* Check if Object tag is hidden */
var prop = SAPBWGetItemProp('TAB'+i);
var hidden=true;
if (prop != null){
for(j=1;j<prop.length;j++){
if (prop[j][0] == "HIDDEN") hidden = (prop[j][1]=='X'); }
if (hidden)
{ document.getElementById("TAB"+i).setAttribute('style', 'display:none;visibility:false;',false); }
else
{ document.getElementById("head_TAB"+i).setAttribute('className', 'SAPBEXTbsTabSel',false); }
}
}
} while (document.getElementById('head_TAB'+i) != null)
}
-->
</script>


<TABLE id=tabheader style="WIDTH: 313px; HEIGHT: 21px" cellSpacing=0 cellPadding=1 border=0>
<TR>
<TD class=SAPBEXTbsTab id=head_TAB1> <A href="javascript:goto_tab('TAB1')">Brand</A> </TD>
<TD class=SAPBEXTbsTab id=head_TAB2> <A href="javascript:goto_tab('TAB2')">Class of Trade</A> </TD>
<TD class=SAPBEXTbsTab id=head_TAB3> <A href="javascript:goto_tab('TAB3')">Sales Area</A> </TD>
<TD class=SAPBEXTbsTab id=head_TAB4> <A href="javascript:goto_tab('TAB4')">Customer</A> </TD>
</TR>
</TABLE>
_________________
What does not kill you makes you stronger...
(Unless you are bleeding profusely)

Answer:
I think (but I am just taking a quick look at the code), that instead of placing the javascript call in the HREF, you need to add it to the OnClick event and void the HREF to get the functionality you want.

Most of what I have done' in the way ot "tabbed" functionality has been done with DIV/SPAN tags, and not directly with TD tags so I am not sure if there is an issue there or not.

- Stephen
_________________
As a rule I don't answer Questions in PM.
(this is not to be a d**k, but it is to allow everyone to benefit from information. Not just one person.) Ask a question in the forum and I will answer it if I can.

Answer:
Thanks, I failed to add the span keywords. Once I did that it worked fine...

Thanks...
_________________
What does not kill you makes you stronger...
(Unless you are bleeding profusely)

Answer:
Did you copy the code exactly as written in the help text (with an extra two tabs added)?

I am confused. I thought that if you put <!-- --> around code this indicates that it is a comment. But this tag is all around the code in the help text.

When I try to execute the application in the browser I get a load of chinese/japanese characters displayed. This could be because the example is in the 3.3 help text and I am on a 3.0b system, but I can't be sure because I don't know if the code works.

Could you possibly post your complete html please?

Answer:
Don't worry about the code. I've worked out what the problem is.

A couple of HTML lines were added to the code by WAD telling it to use "unicode" and some other stuff. I removed these lines and now it appears to be working (not completely mind you!).

Answer:
In the documentation, there is some code to make tabs visible. The problem is, that initially, all web items are displayed and only after the
first tab-click, only the assigned web item appears.
Is it possible to initialy start up with the first TAB.

Second question, do I need this TAB and javascript with BW 3.5? There is a sentence in the documentation, that it is possible to use web templates; however it is not clear how i can select the web templates.

Thanks in advance for your help

Answer:
Derco,

I just used this tabs few days back and i was having the same problem. But now it works right for me. Here is what you do. The code for making the tabs visible like TAB1 and TAB2. In this the number 1 and 2 are concatenated so when i changed the names of the tabs i had the same problem. Just change the titles leaving tab1 and tab2 as it is all over the code

for example

<td class= "SAPBEXTbsTab" id= "TAB1" ><A href= "javascript:goto_tab('TAB1')" >Summary </A>
</td>
<td class= "SAPBEXTbsTab" id= "TAB2" ><A href= "javascript:goto_tab('TAB2')" >Detail </A>

Dinesh

Answer:
Do you work with BW 3.5 or less?

I used the TAB1 and TAB2, but it does not work.
I embedded a web template item (new in 3.5).

Answer:
I am workign with version 3.1c with 3.3 add on. hope that helps

Dinesh
Copyright ?2007 - 2008 www.jt77.com