Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hiding / Showing t:div Tomahawk component  RSS feed

ved gunjan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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.

Patricio Hervas
Posts: 16
  • Mark post as helpful
  • send pies
  • 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 "" you would have to use ""

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

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!