Fwd: Panel Tabbed Pane

2007-11-06 Thread Hasnain Badami
Any suggestions please ?

-- Forwarded message --
From: Hasnain Badami [EMAIL PROTECTED]
Date: Nov 1, 2007 6:26 PM
Subject: Fwd: Panel Tabbed Pane
To: MyFaces Discussion users@myfaces.apache.org

There is an other issue, related to the earlier one, which I think is weird.
Possibly I am doing something wrong. When I
execute the code

 %@ page contentType=text/html;charset=UTF-8 language=java %

%@
taglib prefix=f uri =http://java.sun.com/jsf/core; %

%@
taglib prefix=h uri =http://java.sun.com/jsf/html; %

%@
taglib prefix=c uri =http://java.sun.com/jstl/core; %

%@
taglib uri=http://myfaces.apache.org/tomahawk  prefix=t%








f:view



html



head



f:loadBundle basename=com.prytania.resource.Messages  var=messages/



title



h:outputText value=#{messages['portfolio']} /

h:outputText value=#{portfolioUI.portfolioName} /



/title



t:stylesheet path=/report.css /



t:stylesheet path=/tablepresentation.css /

/head



body class=mainBody 



h:form id=portfolioFatherForm 

t:saveState value=#{portfolioTabIndex} /

t:panelTabbedPane

styleClass=levelOneTabbedPane

width=100%

bgcolor=#CC

activeTabStyleClass=levelOneActiveTab

inactiveTabStyleClass=levelOneInactiveTab

activeSubStyleClass=levelOneActiveSub

inactiveSubStyleClass=levelOneInactiveSub

tabContentStyleClass=levelOneTabContent

serverSideTabSwitch=true

id=pDetailTab



t:panelTab label=#{messages['snapshot_view']} 

c:if test=${portfolioTabIndex==null || portfolioTabIndex.index==0} 

f:subview id=tabportfoliodetailsnapshotview 



h:outputText value=snapshot /



/f:subview



/c:if

/t:panelTab

t:panelTab label=#{messages['time_series_view']} 

h:outputText value=timeseries /



/t:panelTab

t:panelTab label=#{messages['documents']} 

c:if test=${portfolioTabIndex.index==2} 

h:outputText value=documents /



/c:if

/t:panelTab

t:panelTab label=#{messages['analysis']} 

c:if test=${portfolioTabIndex.index==3} 

f:subview id=tabportfoliodetailanalysisview 

h:outputText value=analysis /



/f:subview

/c:if

/t:panelTab

t:tabChangeListener type=
com.prytania.model.backingbeans.PortfolioDetailTabManager  /

/t:panelTabbedPane

/h:form



/body



/html

/
f:view
PortfolioDetailTabManager.java


package com.prytania.model.backingbeans;


import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;

import org.apache.log4j.Logger;
import org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane;
import org.apache.myfaces.custom.tabbedpane.TabChangeEvent;
import org.apache.myfaces.custom.tabbedpane.TabChangeListener ;



public class PortfolioDetailTabManager implements TabChangeListener
{

 private static final long serialVersionUID = 1L;
 private static final Logger log = Logger.getLogger(
PortfolioDetailTabManager.class);

 public PortfolioDetailTabManager()
 {
  log.info(Executing PortfolioDetailTabManager());
  log.info(Exiting PortfolioDetailTabManager());
 }
 public void processTabChange(TabChangeEvent event) throws
AbortProcessingException
 {
  log.info(TabSupport:processPortfolioDetailTabChange() called  +
event.getNewTabIndex());
  PortfolioTabIndex tabIndices =
(PortfolioTabIndex)FacesContext.getCurrentInstance().getApplication().getVariableResolver().resolveVariable(
FacesContext.getCurrentInstance(), portfolioTabIndex);
  HtmlPanelTabbedPane tabbedPane =
(HtmlPanelTabbedPane)event.getComponent();

  if(tabIndices!=null)
   tabIndices.setIndex(event.getNewTabIndex());
  if(tabbedPane!=null)
   tabbedPane.setSelectedIndex(event.getNewTabIndex());
 }
}

PortfolioTabIndex

package com.prytania.model.backingbeans;

import java.io.Serializable;

import org.apache.log4j.Logger;

/**
 *
 * @author hbadami
 * @jsf.bean
 *  name=portfolioTabIndex
 *  scope=request
 */

public class PortfolioTabIndex implements Serializable
{
 private static final long serialVersionUID = 1L;
 private static final Logger log = Logger.getLogger(PortfolioTabIndex.class
);

 private int index=0;
 public int getIndex() {
  return index;
 }
 public void setIndex(int index)
 {
  log.info(The old index is  + this.index +  the new index is  + index);
  this.index = index;
 }

 public PortfolioTabIndex()
 {
  log.info(Executing PortfolioTabIndex());
  log.info(Exiting PortfolioTabIndex());
 }

}


now when I execute this code, only the code in the selected tab gets
executed, but the tabbed pane creates additonal tabs automatically when you
move between tabs back and forth. Any idea why is this happening? Thanks in
advance

-- Forwarded message --
From: Hasnain Badami  [EMAIL PROTECTED]
Date: Oct 31, 2007 5:06 PM
Subject: Panel Tabbed Pane
To: MyFaces Discussion  users@myfaces.apache.org


HI

I am trying to use the panel tabbed pane with server side tab switching. I
am using myfaces 1.1.6 Snapshot and tomahawak 1.1.7. snapshot. Consider the
following code snippet
portfolioDetailUI backing bean is in request scope.


t:panelTabbedPane

styleClass=levelOneTabbedPane

width=100%

bgcolor=#CC

Fwd: Panel Tabbed Pane

2007-11-01 Thread Hasnain Badami
There is an other issue, related to the earlier one, which I think is weird.
Possibly I am doing something wrong
Copy this code and execute

 %@ page contentType=text/html;charset=UTF-8 language=java %

%@ taglib prefix=f uri=http://java.sun.com/jsf/core; %

%@ taglib prefix=h uri=http://java.sun.com/jsf/html; %

%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %

%@ taglib uri=http://myfaces.apache.org/tomahawk; prefix=t%







f:view



html



head



f:loadBundle basename=com.prytania.resource.Messages var=messages/



title



h:outputText value=#{messages['portfolio']} /

h:outputText value=#{portfolioUI.portfolioName} /



/title



t:stylesheet path=/report.css/



t:stylesheet path=/tablepresentation.css/

/head



body class=mainBody 



h:form id=portfolioFatherForm 

t:saveState value=#{portfolioTabIndex}/

t:panelTabbedPane

styleClass=levelOneTabbedPane

width=100%

bgcolor=#CC

activeTabStyleClass=levelOneActiveTab

inactiveTabStyleClass=levelOneInactiveTab

activeSubStyleClass=levelOneActiveSub

inactiveSubStyleClass=levelOneInactiveSub

tabContentStyleClass=levelOneTabContent

serverSideTabSwitch=true

id=pDetailTab



t:panelTab label=#{messages['snapshot_view']} 

c:if test=${portfolioTabIndex==null || portfolioTabIndex.index==0}

f:subview id=tabportfoliodetailsnapshotview 



h:outputText value=snapshot /



/f:subview



/c:if

/t:panelTab

t:panelTab label=#{messages['time_series_view']} 

h:outputText value=timeseries /



/t:panelTab

t:panelTab label=#{messages['documents']} 

c:if test=${portfolioTabIndex.index==2}

h:outputText value=documents /



/c:if

/t:panelTab

t:panelTab label=#{messages['analysis']} 

c:if test=${portfolioTabIndex.index==3}

f:subview id=tabportfoliodetailanalysisview 

h:outputText value=analysis /



/f:subview

/c:if

/t:panelTab

t:tabChangeListener type=
com.prytania.model.backingbeans.PortfolioDetailTabManager /

/t:panelTabbedPane

/h:form



/body



/html

/f:view

PortfolioDetailTabManager.java


package com.prytania.model.backingbeans;


import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;

import org.apache.log4j.Logger;
import org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane;
import org.apache.myfaces.custom.tabbedpane.TabChangeEvent;
import org.apache.myfaces.custom.tabbedpane.TabChangeListener;



public class PortfolioDetailTabManager implements TabChangeListener
{

 private static final long serialVersionUID = 1L;
 private static final Logger log = Logger.getLogger(
PortfolioDetailTabManager.class);

 public PortfolioDetailTabManager()
 {
  log.info(Executing PortfolioDetailTabManager());
  log.info(Exiting PortfolioDetailTabManager());
 }
 public void processTabChange(TabChangeEvent event) throws
AbortProcessingException
 {
  log.info(TabSupport:processPortfolioDetailTabChange() called  +
event.getNewTabIndex());
  PortfolioTabIndex tabIndices =
(PortfolioTabIndex)FacesContext.getCurrentInstance().getApplication().getVariableResolver().resolveVariable(
FacesContext.getCurrentInstance(), portfolioTabIndex);
  HtmlPanelTabbedPane tabbedPane =
(HtmlPanelTabbedPane)event.getComponent();

  if(tabIndices!=null)
   tabIndices.setIndex(event.getNewTabIndex());
  if(tabbedPane!=null)
   tabbedPane.setSelectedIndex(event.getNewTabIndex());
 }
}

PortfolioTabIndex

package com.prytania.model.backingbeans;

import java.io.Serializable;

import org.apache.log4j.Logger;

/**
 *
 * @author hbadami
 * @jsf.bean
 *  name=portfolioTabIndex
 *  scope=request
 */

public class PortfolioTabIndex implements Serializable
{
 private static final long serialVersionUID = 1L;
 private static final Logger log = Logger.getLogger(PortfolioTabIndex.class
);

 private int index=0;
 public int getIndex() {
  return index;
 }
 public void setIndex(int index)
 {
  log.info(The old index is  + this.index +  the new index is  + index);
  this.index = index;
 }

 public PortfolioTabIndex()
 {
  log.info(Executing PortfolioTabIndex());
  log.info(Exiting PortfolioTabIndex());
 }

}


now when I execute this code, only the code in the selected tab gets
executed, but the tabbed pane creates additonal tabs automatically when you
move select tabs back and forth. Any idea why is this happening? Thanks in
advance

-- Forwarded message --
From: Hasnain Badami [EMAIL PROTECTED]
Date: Oct 31, 2007 5:06 PM
Subject: Panel Tabbed Pane
To: MyFaces Discussion users@myfaces.apache.org


HI

I am trying to use the panel tabbed pane with server side tab switching. I
am using myfaces 1.1.6 Snapshot and tomahawak 1.1.7. Consider the following
code snippet
portfolioDetailUI backing bean is in request scope.


t:panelTabbedPane

styleClass=levelOneTabbedPane

width=100%

bgcolor=#CC

activeTabStyleClass=levelOneActiveTab

inactiveTabStyleClass=levelOneInactiveTab

activeSubStyleClass=levelOneActiveSub

inactiveSubStyleClass=levelOneInactiveSub

tabContentStyleClass=levelOneTabContent

serverSideTabSwitch=true

id

Panel Tabbed Pane

2007-10-31 Thread Hasnain Badami
HI

I am trying to use the panel tabbed pane with server side tab switching. I
am using myfaces 1.1.6 Snapshot and tomahawak 1.1.7. Consider the following
code snippet
portfolioDetailUI backing bean is in request scope.

t:panelTabbedPane

styleClass=levelOneTabbedPane

width=100%

bgcolor=#CC

activeTabStyleClass=levelOneActiveTab

inactiveTabStyleClass=levelOneInactiveTab

activeSubStyleClass=levelOneActiveSub

inactiveSubStyleClass=levelOneInactiveSub

tabContentStyleClass=levelOneTabContent

serverSideTabSwitch=true

id=pDetailTab

binding=#{portfolioDetailUI.panelTabbedPane}



t:panelTab label=#{messages['snapshot_view']} 

f:subview id=tabportfoliodetailsnapshotview 

jsp:include page=portfoliodetailsnapshotview.jsp /

/f:subview

/t:panelTab

t:panelTab label=#{messages['time_series_view']} 

f:subview id=tabportfoliodetailtimeseriesview 

jsp:include page=portfoliodetailtimeseriesview.jsp /

/f:subview

/t:panelTab

t:tabChangeListener type=
com.prytania.model.backingbeans.PortfolioDetailTabManager /

/t:panelTabbedPane

I am a little bit confused. When the page loads the selected index for this
tab is 0. This means only portfoliodetailsnapshotview.jsp should be
included, but both of these files are loaded. Similary when second tab is
clicked only portfoliodetailtimeseriesview.jsp should be included, but again
both are included. Any pointers as to why is this happening. I shall
appreciate any help

Thanks


panel tabbed pane index

2007-01-16 Thread Joseph T. Ersinghaus

Hello,

Is it possible to retrieve the index on the selected tab in a 
t:panelTabbedPane control?




Thanks,
Joe


Re: Panel Tabbed Pane

2006-11-15 Thread K. Johnson
The rendered attribute is processed at render-time. My guess is that it is 
processed after both jsp:includes are already processed.


  ---Original Message---
  From: Hasnain Badami [EMAIL PROTECTED]
  Subject: Panel Tabbed Pane
  Sent: 14 Nov '06 12:55
  
  Hi
  
  
  I have written the following code:
  
  
  t:panelTabbedPane
  
  styleClass=levelOneTabbedPane
  
  width=100%
  
  bgcolor=#CC
  
  activeTabStyleClass=levelOneActiveTab
  
  inactiveTabStyleClass=levelOneInactiveTab
  
  activeSubStyleClass=levelOneActiveSub
  
  inactiveSubStyleClass=levelOneInactiveSub
  
  tabContentStyleClass=levelOneTabContent
  
  serverSideTabSwitch=true
  
  id=pDetailTab
  
  
  
  t:panelTab label= #{messages['snapshot_view']} 
  
  f:subview id=tabportfoliodetailsnapshotview
  rendered=#{tabIndices.portfolioTabIndex==0} 
  
  jsp:include page=portfoliodetailsnapshotview.jsp  /
  
  /f:subview
  
  /t:panelTab
  
  t:panelTab label= #{messages['time_series_view']} 
  
  f:subview id=tabportfoliodetailtimeseriesview
  rendered=#{tabIndices.portfolioTabIndex==1} 
  
  jsp:include page=portfoliodetailtimeseriesview.jsp  /
  
  /f:subview
  
  /t:panelTab
  
  
  t:tabChangeListener type
  =com.prytania.model.backingbeans.PortfolioDetailTabManager /
  
  /t:panelTabbedPane
  
  
  There are two separate backing beans each for the
  portfoliodetailsnapshotview.jsp and portfoliodetailtimeseriesview.jsp. At
  a single point in time, the tabIndices.portfolioTabIndex can either be 0
  or 1 which means either  portfoliodetailsnapshotview.jsp and
  portfoliodetailtimeseriesview.jsp should be included. But in the logs, I
  can see the code of both the backing beans being executed (constructors
  being called),. Why is that so? If the rendered attribute equals to false
  why would the framework still include the jsp. Is there any solution to
  the above mentioned problem. I mean if rendered is false then the included
  jsp should not be processed.
  
  
  Thanks in advance
  
  
  Best Regards
  
  Hassnain


Re: Panel Tabbed Pane

2006-11-15 Thread Hasnain Badami
Hi

Is there any way through which, depending on tabIndices.portfolioTabIndex, I can include the appropriate jsp.
HB.
On 11/15/06, K. Johnson [EMAIL PROTECTED] wrote:
The rendered attribute is processed at render-time. My guess is that it is processed after both jsp:includes are already processed.
---Original Message---From: Hasnain Badami [EMAIL PROTECTED]Subject: Panel Tabbed PaneSent: 14 Nov '06 12:55
HiI have written the following code:t:panelTabbedPanestyleClass=levelOneTabbedPanewidth=100%
bgcolor=#CCactiveTabStyleClass=levelOneActiveTabinactiveTabStyleClass=levelOneInactiveTabactiveSubStyleClass=levelOneActiveSub
inactiveSubStyleClass=levelOneInactiveSubtabContentStyleClass=levelOneTabContentserverSideTabSwitch=trueid=pDetailTab
t:panelTab label= #{messages['snapshot_view']} f:subview id=tabportfoliodetailsnapshotviewrendered=#{tabIndices.portfolioTabIndex==0
} jsp:include page=portfoliodetailsnapshotview.jsp  //f:subview/t:panelTabt:panelTab label= #{messages['time_series_view']} 
f:subview id=tabportfoliodetailtimeseriesviewrendered=#{tabIndices.portfolioTabIndex==1} jsp:include page=portfoliodetailtimeseriesview.jsp
  //f:subview/t:panelTabt:tabChangeListener type=com.prytania.model.backingbeans.PortfolioDetailTabManager /
/t:panelTabbedPaneThere are two separate backing beans each for theportfoliodetailsnapshotview.jsp and portfoliodetailtimeseriesview.jsp. Ata single point in time, the 
tabIndices.portfolioTabIndex can either be 0or 1 which means eitherportfoliodetailsnapshotview.jsp andportfoliodetailtimeseriesview.jsp should be included. But in the logs, Ican see the code of both the backing beans being executed (constructors
being called),. Why is that so? If the rendered attribute equals to falsewhy would the framework still include the jsp. Is there any solution tothe above mentioned problem. I mean if rendered is false then the included
jsp should not be processed.Thanks in advanceBest RegardsHassnain


Panel Tabbed Pane

2006-11-14 Thread Hasnain Badami

Hi

I have written the following code:

t:panelTabbedPane
styleClass=levelOneTabbedPane
width=100% 
bgcolor=#CC 
activeTabStyleClass=levelOneActiveTab 
inactiveTabStyleClass=levelOneInactiveTab
activeSubStyleClass=levelOneActiveSub 
inactiveSubStyleClass=levelOneInactiveSub 
tabContentStyleClass=levelOneTabContent
serverSideTabSwitch=true
id=pDetailTab

t:panelTab label=
#{messages['snapshot_view']}  
f:subview id=tabportfoliodetailsnapshotview 
rendered=#{tabIndices.portfolioTabIndex==0}

jsp:include page=portfoliodetailsnapshotview.jsp
 /
/f:subview
/t:panelTab
t:panelTab label=
#{messages['time_series_view']}  
f:subview id=tabportfoliodetailtimeseriesview 
rendered=#{tabIndices.portfolioTabIndex==1}

jsp:include page=portfoliodetailtimeseriesview.jsp
 /
/f:subview
/t:panelTab

t:tabChangeListener type
=com.prytania.model.backingbeans.PortfolioDetailTabManager /
/t:panelTabbedPane

There are two separate backing beans each for the portfoliodetailsnapshotview.jsp and portfoliodetailtimeseriesview.jsp. At a single point in time, the tabIndices.portfolioTabIndex can either be 0 or 1 which means either
portfoliodetailsnapshotview.jsp and portfoliodetailtimeseriesview.jsp should be included. But in the logs, I can see the code of both the backing beans being executed (constructors being called),. Why is that so? If the rendered attribute equals to false why would the framework still include the jsp.Is there any solution to the above mentioned problem. I mean if rendered is false then the included jsp should not be processed.


Thanks in advance

Best Regards
Hassnain