• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Hiding / Showing t:div Tomahawk component

Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Experts
I'm new to the world of JSF and presently playing around with Apache MyFaces Tomahawk JSF implementation.
Im trying this scenario, which will be a requirment in my project.
I have a jsp page( main.jsp ) which contain 3 Tabs...(I have created these tabs using css) in its menu.

Now when the user clicks on any one of the tab, i want to display the content of that tab in the same page(i.e main.jsp)
Im planning to include the content of these tabs as
<jsp:include />

So in the main.jsp, i have used <t:div> tag and inside this i have placed the individual <jsp:include >

Sumthing like this...

<t:div id="tab1">
<f:subview id="opt_1">
<jsp:include page="optionsPanel.jsp"/>
<t:div id="tab2">
<f:subview id="opt_2">
<jsp:include page="optionsPanel_2.jsp"/>
<t:div id="tab3">
<f:subview id="opt_3">
<jsp:include page="optionsPanel_3.jsp"/>

So when the user clicks on any of the tabs, i'm calling a _javascript, through which i'm displaying the respective <t:div> and hiding the other two.

This is my java script...

funtion toggleTab(sTab)


The problem is im not able to get the desired results.There is no action only.
Please guide me as to what im doing wrong and more importantly wht is the more proper approach to acheive the scenario.

Any help will be great.

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think you probably have some issues in your jscript.

first, unless you use the "forceId=true" property in your tomahawk
tags, the id's of your tags would be "form:id", so instead of refering
in the script of "div1.style" you would have to use "form1:div1.style"

then, i think (im not that sure though) that you might want to use
"document.getElementById('form1:div1').style.display" to change the
display properties

if you set the "forceId=true" then it would be

hope that helps

Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic