You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by James Richards <ja...@northps.com> on 2006/06/08 18:30:25 UTC

panelTabbedPane question

I have a tabbed pane with a tabChangeListener attached 

<h:form id="dealForm">
	<x:panelTabbedPane id="dealTabbedPane"
		    selectedIndex="#{dealForm.activeTab}"
		    bgcolor="#eeeeee" 
 		    width="980" 
   		    activeTabStyleClass="tabActive" 
   		    inactiveTabStyleClass="tabActive"
                    serverSideTabSwitch="true">
		<x:tabChangeListener type="com.foo.listener.TabListener"/>	 
...
</h:form>

but on MyFaces 1.1.1, the TabListener's 

  public void processTabChange(TabChangeEvent event) {
//...
  }

is not being invoked.  Is there something additional that need to be done to enable the tab listener?

Thanks for any help,

James


Re: [Tomahawk] TabbedPane does not remember position - solved

Posted by Andreas Heidrich <An...@toyota-fs.com>.
Hi Mike,
thanx for the input on that.

The immediate="true" onclick="bCancel=true" had no effect on my site. I
solved the problem with the button with the a4j lib and made it a
a4j:commandButton.

                              <a4j:commandButton value="Ă„ndern"
                                    action="
#{contractBankConnectionWebController.bankConnectionChangeWebController.save}"
                                    reRender="bankResult">
                              </a4j:commandButton>

then I solved the problem with the dataTable in the tabbedPane with ajax
too. Surrounding the tableData with a a4j:form did the job.

            <a4j:form id="dataTableForm" ajaxSubmit="true" reRender=
"tableData">
                  <t:dataTable id="tableData" var="postingWebServiceBean"
                        value="
#{dataScrollerListPostingWebController.data}" rows="15"
                  ...
                  </t:dataTable>

                  <h:panelGrid columns="1" styleClass="scrollerTable2"
                        columnClasses="standardTable_ColumnCentered">
                        <t:dataScroller id="scroll_1" for="tableData"
fastStep="10"
                        ...
                        </t:dataScroller>
                  </h:panelGrid>
            </a4j:form>

Kind Regards
Andreas



                                                                           
             mikebgx                                                       
             <mikeb2@mycosyste                                             
             ms.co.uk>                                                  An 
                                        users@myfaces.apache.org           
             26.06.2007 22:48                                        Kopie 
                                                                           
                                                                     Thema 
              Bitte antworten           Re: TabbedPane does not remember   
                    an                  position                           
                 "MyFaces                                                  
                Discussion"                                                
             <users@myfaces.ap                                             
                 ache.org>                                                 
                                                                           
                                                                           





I use client side switching, the one button I have that makes it reset to
the
first tab has the following:
immediate="true" onclick="bCancel=true"

hth
Mike



Andreas Heidrich wrote:
>
> Hi everybody,
> i use a tabbedPane in my application. I contains a page that shows a
> t:dataTable. When I scroll a page in the table, the focus of the
> tabbedPane
> switches to the first page og the pane. This also happens when I invoke
> some functionality that  is bound to an command button on another page.
> Is there a way to customize the tabbedPane so that i will not loose it
> pane
> position.
> I looked for a way to remember the position and added the
> serverSideTabSwitch="true" paramter, but the code in the
TabChangeListener
> class never gets called.
>
> Anyone any idea how to solve that ?
>
> Thanx
> Andreas
>


Toyota Financial Services (UK) PLC, Company Registration Number 
02299961, Great Burgh, Burgh Heath, Epsom, Surrey, KT18 5UZ, 
registered in England.  

Lexus Financial Services and Redline Finance are trading styles 
of Toyota Financial Services (UK) PLC.
 
Authorised and regulated by the Financial Services Authority. 
This correspondence is for the intended recipient only. It may 
contain confidential or legally privileged information or both. 
No confidentiality or privilege is waived or lost by any 
mistransmission or unauthorised alteration during transmission. 
If you are not the intended recipient, any disclosure, copying, 
distribution or any action taken or omitted to be taken in 
reliance on it, is prohibited and may be unlawful. If you receive 
this correspondence in error, please immediately delete it from 
your system and notify the sender. Any views expressed in this 
message are those of the individual sender, except where the 
sender expressly, and with authority, states them to be the views 
of Toyota. This message has been checked for viruses but the 
recipient is strongly advised to rescan the message before 
opening any attachments or attached executable files. 

Re: TabbedPane does not remember position

Posted by mikebgx <mi...@mycosystems.co.uk>.
I use client side switching, the one button I have that makes it reset to the
first tab has the following:
immediate="true" onclick="bCancel=true"

hth
Mike



Andreas Heidrich wrote:
> 
> Hi everybody,
> i use a tabbedPane in my application. I contains a page that shows a
> t:dataTable. When I scroll a page in the table, the focus of the
> tabbedPane
> switches to the first page og the pane. This also happens when I invoke
> some functionality that  is bound to an command button on another page.
> Is there a way to customize the tabbedPane so that i will not loose it
> pane
> position.
> I looked for a way to remember the position and added the
> serverSideTabSwitch="true" paramter, but the code in the TabChangeListener
> class never gets called.
> 
> Anyone any idea how to solve that ?
> 
> Thanx
> Andreas
> 
> 
>                                                                            
>              mikebgx                                                       
>              <mikeb2@mycosyste                                             
>              ms.co.uk>                                                  An 
>                                         users@myfaces.apache.org           
>              19.06.2007 16:23                                        Kopie 
>                                                                            
>                                                                      Thema 
>               Bitte antworten           RE: panelTabbedPane question       
>                     an                                                     
>                  "MyFaces                                                  
>                 Discussion"                                                
>              <users@myfaces.ap                                             
>                  ache.org>                                                 
>                                                                            
>                                                                            
> 
> 
> 
> 
> 
> I have exactly the same problem with MyFaces 1.1.4 (Appfuse 1.9.4 for
> JSF),
> whereby my processTabChange is not being called.
> 
> I notice some related stuff in tomahawk.taglib.xml has been commented out.
> 
> Has anyone managed to make this work?
> 
> 
> James Richards-2 wrote:
>>
>> Plz disregard the "serverSideTabSwitch="true"" below as it's not
>> applicable to 1.1.1.
>>
>> Thanks,
>>
>> James
>>
>>
>>
>> -----Original Message-----
>> From: James Richards [mailto:james_richards@northps.com]
>> Sent: Thu 6/8/2006 12:30 PM
>> To: users@myfaces.apache.org
>> Subject: panelTabbedPane question
>>
>>
>> I have a tabbed pane with a tabChangeListener attached
>>
>> <h:form id="dealForm">
>>            <x:panelTabbedPane id="dealTabbedPane"
>>                            selectedIndex="#{dealForm.activeTab}"
>>                            bgcolor="#eeeeee"
>>                            width="980"
>>                            activeTabStyleClass="tabActive"
>>                            inactiveTabStyleClass="tabActive"
>>                     serverSideTabSwitch="true">
>>                        <x:tabChangeListener
> type="com.foo.listener.TabListener"/>
>> ...
>> </h:form>
>>
>> but on MyFaces 1.1.1, the TabListener's
>>
>>   public void processTabChange(TabChangeEvent event) {
>> //...
>>   }
>>
>> is not being invoked.  Is there something additional that need to be done
>> to enable the tab listener?
>>
>> Thanks for any help,
>>
>> James
>>
>>
>>
>>
>>
> 
> --
> View this message in context:
> http://www.nabble.com/panelTabbedPane-question-tf1756166.html#a11195840
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> 
> 
> Toyota Financial Services (UK) PLC, Company Registration Number 
> 02299961, Great Burgh, Burgh Heath, Epsom, Surrey, KT18 5UZ, 
> registered in England.  
> 
> Lexus Financial Services and Redline Finance are trading styles 
> of Toyota Financial Services (UK) PLC.
>  
> Authorised and regulated by the Financial Services Authority. 
> This correspondence is for the intended recipient only. It may 
> contain confidential or legally privileged information or both. 
> No confidentiality or privilege is waived or lost by any 
> mistransmission or unauthorised alteration during transmission. 
> If you are not the intended recipient, any disclosure, copying, 
> distribution or any action taken or omitted to be taken in 
> reliance on it, is prohibited and may be unlawful. If you receive 
> this correspondence in error, please immediately delete it from 
> your system and notify the sender. Any views expressed in this 
> message are those of the individual sender, except where the 
> sender expressly, and with authority, states them to be the views 
> of Toyota. This message has been checked for viruses but the 
> recipient is strongly advised to rescan the message before 
> opening any attachments or attached executable files. 
> 
> 

-- 
View this message in context: http://www.nabble.com/panelTabbedPane-question-tf1756166.html#a11313440
Sent from the MyFaces - Users mailing list archive at Nabble.com.


TabbedPane does not remember position

Posted by Andreas Heidrich <An...@toyota-fs.com>.
Hi everybody,
i use a tabbedPane in my application. I contains a page that shows a
t:dataTable. When I scroll a page in the table, the focus of the tabbedPane
switches to the first page og the pane. This also happens when I invoke
some functionality that  is bound to an command button on another page.
Is there a way to customize the tabbedPane so that i will not loose it pane
position.
I looked for a way to remember the position and added the
serverSideTabSwitch="true" paramter, but the code in the TabChangeListener
class never gets called.

Anyone any idea how to solve that ?

Thanx
Andreas


                                                                           
             mikebgx                                                       
             <mikeb2@mycosyste                                             
             ms.co.uk>                                                  An 
                                        users@myfaces.apache.org           
             19.06.2007 16:23                                        Kopie 
                                                                           
                                                                     Thema 
              Bitte antworten           RE: panelTabbedPane question       
                    an                                                     
                 "MyFaces                                                  
                Discussion"                                                
             <users@myfaces.ap                                             
                 ache.org>                                                 
                                                                           
                                                                           





I have exactly the same problem with MyFaces 1.1.4 (Appfuse 1.9.4 for JSF),
whereby my processTabChange is not being called.

I notice some related stuff in tomahawk.taglib.xml has been commented out.

Has anyone managed to make this work?


James Richards-2 wrote:
>
> Plz disregard the "serverSideTabSwitch="true"" below as it's not
> applicable to 1.1.1.
>
> Thanks,
>
> James
>
>
>
> -----Original Message-----
> From: James Richards [mailto:james_richards@northps.com]
> Sent: Thu 6/8/2006 12:30 PM
> To: users@myfaces.apache.org
> Subject: panelTabbedPane question
>
>
> I have a tabbed pane with a tabChangeListener attached
>
> <h:form id="dealForm">
>            <x:panelTabbedPane id="dealTabbedPane"
>                            selectedIndex="#{dealForm.activeTab}"
>                            bgcolor="#eeeeee"
>                            width="980"
>                            activeTabStyleClass="tabActive"
>                            inactiveTabStyleClass="tabActive"
>                     serverSideTabSwitch="true">
>                        <x:tabChangeListener
type="com.foo.listener.TabListener"/>
> ...
> </h:form>
>
> but on MyFaces 1.1.1, the TabListener's
>
>   public void processTabChange(TabChangeEvent event) {
> //...
>   }
>
> is not being invoked.  Is there something additional that need to be done
> to enable the tab listener?
>
> Thanks for any help,
>
> James
>
>
>
>
>

--
View this message in context:
http://www.nabble.com/panelTabbedPane-question-tf1756166.html#a11195840
Sent from the MyFaces - Users mailing list archive at Nabble.com.




Toyota Financial Services (UK) PLC, Company Registration Number 
02299961, Great Burgh, Burgh Heath, Epsom, Surrey, KT18 5UZ, 
registered in England.  

Lexus Financial Services and Redline Finance are trading styles 
of Toyota Financial Services (UK) PLC.
 
Authorised and regulated by the Financial Services Authority. 
This correspondence is for the intended recipient only. It may 
contain confidential or legally privileged information or both. 
No confidentiality or privilege is waived or lost by any 
mistransmission or unauthorised alteration during transmission. 
If you are not the intended recipient, any disclosure, copying, 
distribution or any action taken or omitted to be taken in 
reliance on it, is prohibited and may be unlawful. If you receive 
this correspondence in error, please immediately delete it from 
your system and notify the sender. Any views expressed in this 
message are those of the individual sender, except where the 
sender expressly, and with authority, states them to be the views 
of Toyota. This message has been checked for viruses but the 
recipient is strongly advised to rescan the message before 
opening any attachments or attached executable files. 

RE: panelTabbedPane question

Posted by mikebgx <mi...@mycosystems.co.uk>.
I have exactly the same problem with MyFaces 1.1.4 (Appfuse 1.9.4 for JSF),
whereby my processTabChange is not being called.

I notice some related stuff in tomahawk.taglib.xml has been commented out.

Has anyone managed to make this work?


James Richards-2 wrote:
> 
> Plz disregard the "serverSideTabSwitch="true"" below as it's not
> applicable to 1.1.1.
> 
> Thanks,
> 
> James
> 
> 
> 
> -----Original Message-----
> From: James Richards [mailto:james_richards@northps.com]
> Sent: Thu 6/8/2006 12:30 PM
> To: users@myfaces.apache.org
> Subject: panelTabbedPane question
>  
> 
> I have a tabbed pane with a tabChangeListener attached 
> 
> <h:form id="dealForm">
> 	<x:panelTabbedPane id="dealTabbedPane"
> 		    selectedIndex="#{dealForm.activeTab}"
> 		    bgcolor="#eeeeee" 
>  		    width="980" 
>    		    activeTabStyleClass="tabActive" 
>    		    inactiveTabStyleClass="tabActive"
>                     serverSideTabSwitch="true">
> 		<x:tabChangeListener type="com.foo.listener.TabListener"/>	 
> ...
> </h:form>
> 
> but on MyFaces 1.1.1, the TabListener's 
> 
>   public void processTabChange(TabChangeEvent event) {
> //...
>   }
> 
> is not being invoked.  Is there something additional that need to be done
> to enable the tab listener?
> 
> Thanks for any help,
> 
> James
> 
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/panelTabbedPane-question-tf1756166.html#a11195840
Sent from the MyFaces - Users mailing list archive at Nabble.com.


RE: panelTabbedPane question

Posted by James Richards <ja...@northps.com>.
Plz disregard the "serverSideTabSwitch="true"" below as it's not applicable to 1.1.1.

Thanks,

James



-----Original Message-----
From: James Richards [mailto:james_richards@northps.com]
Sent: Thu 6/8/2006 12:30 PM
To: users@myfaces.apache.org
Subject: panelTabbedPane question
 

I have a tabbed pane with a tabChangeListener attached 

<h:form id="dealForm">
	<x:panelTabbedPane id="dealTabbedPane"
		    selectedIndex="#{dealForm.activeTab}"
		    bgcolor="#eeeeee" 
 		    width="980" 
   		    activeTabStyleClass="tabActive" 
   		    inactiveTabStyleClass="tabActive"
                    serverSideTabSwitch="true">
		<x:tabChangeListener type="com.foo.listener.TabListener"/>	 
...
</h:form>

but on MyFaces 1.1.1, the TabListener's 

  public void processTabChange(TabChangeEvent event) {
//...
  }

is not being invoked.  Is there something additional that need to be done to enable the tab listener?

Thanks for any help,

James



RE: panelTabbedPane question

Posted by James Richards <ja...@northps.com>.
Please disregard the below as I found the following Jira issue:

http://issues.apache.org/jira/browse/MYFACES-746

So, it looks like moving to 1.1.2 [or the latest] is a better choice!

Thanks,

James


-----Original Message-----
From: James Richards [mailto:james_richards@northps.com]
Sent: Thu 6/8/2006 1:28 PM
To: MyFaces Discussion
Subject: RE: panelTabbedPane question
 
Julian,

Thanks for the suggestion.  I changed the type to reference a backing bean which I had caused to implement TabChangeListener, unfortunately the listener tag's type attribute is expecting a classname:

// snip
  if (componentTag.getCreated())
        {
            //Component was just created, so we add the Listener
            UIComponent component = componentTag.getComponentInstance();
            if (component instanceof HtmlPanelTabbedPane)
            {
                String className;
                if (UIComponentTag.isValueReference(type))
                {
                    FacesContext facesContext = FacesContext.getCurrentInstance();
                    ValueBinding valueBinding = facesContext.getApplication().createValueBinding(type);
                    className = (String) valueBinding.getValue(facesContext);
                } else
                {
                    className = type;
                }
                TabChangeListener listener = (TabChangeListener) ClassUtils.newInstance(className);
                ((HtmlPanelTabbedPane) component).addTabChangeListener(listener);
            } else
            {
                throw new JspException("Component " + component.getId() + " is no HtmlPanelTabbedPane");
            }
        }
// end snip

accordingly a reference to a backing bean instance will not resolve to a proper String classname and will cause a class cast exception.  

The source code does make it clear that it is correct to place the tabChangeListener as a child of the HtmlPanelTabbedPane so I think that the problem is somewhere else.

Does anyone have an input as to why no tab change event is fired in 1.1.1?  

Thanks for the suggestion.

James

-----Original Message-----
From: Julian Ray [mailto:julianjray@yahoo.com]
Sent: Thu 6/8/2006 12:38 PM
To: 'MyFaces Discussion'
Subject: RE: panelTabbedPane question
 
try using a value binding for the tabChangeListener handler eg.
<x:tabChangeListener type="#{myBackingBean}">
 
 

  _____  

From: James Richards [mailto:james_richards@northps.com] 
Sent: Thursday, June 08, 2006 12:30 PM
To: users@myfaces.apache.org
Subject: panelTabbedPane question




I have a tabbed pane with a tabChangeListener attached

<h:form id="dealForm">
        <x:panelTabbedPane id="dealTabbedPane"
                    selectedIndex="#{dealForm.activeTab}"
                    bgcolor="#eeeeee"
                    width="980"
                    activeTabStyleClass="tabActive"
                    inactiveTabStyleClass="tabActive"
                    serverSideTabSwitch="true">
                <x:tabChangeListener type="com.foo.listener.TabListener"/>

...
</h:form>

but on MyFaces 1.1.1, the TabListener's

  public void processTabChange(TabChangeEvent event) {
//...
  }

is not being invoked.  Is there something additional that need to be done to
enable the tab listener?

Thanks for any help,

James






RE: panelTabbedPane question

Posted by James Richards <ja...@northps.com>.
Julian,

Thanks for the suggestion.  I changed the type to reference a backing bean which I had caused to implement TabChangeListener, unfortunately the listener tag's type attribute is expecting a classname:

// snip
  if (componentTag.getCreated())
        {
            //Component was just created, so we add the Listener
            UIComponent component = componentTag.getComponentInstance();
            if (component instanceof HtmlPanelTabbedPane)
            {
                String className;
                if (UIComponentTag.isValueReference(type))
                {
                    FacesContext facesContext = FacesContext.getCurrentInstance();
                    ValueBinding valueBinding = facesContext.getApplication().createValueBinding(type);
                    className = (String) valueBinding.getValue(facesContext);
                } else
                {
                    className = type;
                }
                TabChangeListener listener = (TabChangeListener) ClassUtils.newInstance(className);
                ((HtmlPanelTabbedPane) component).addTabChangeListener(listener);
            } else
            {
                throw new JspException("Component " + component.getId() + " is no HtmlPanelTabbedPane");
            }
        }
// end snip

accordingly a reference to a backing bean instance will not resolve to a proper String classname and will cause a class cast exception.  

The source code does make it clear that it is correct to place the tabChangeListener as a child of the HtmlPanelTabbedPane so I think that the problem is somewhere else.

Does anyone have an input as to why no tab change event is fired in 1.1.1?  

Thanks for the suggestion.

James

-----Original Message-----
From: Julian Ray [mailto:julianjray@yahoo.com]
Sent: Thu 6/8/2006 12:38 PM
To: 'MyFaces Discussion'
Subject: RE: panelTabbedPane question
 
try using a value binding for the tabChangeListener handler eg.
<x:tabChangeListener type="#{myBackingBean}">
 
 

  _____  

From: James Richards [mailto:james_richards@northps.com] 
Sent: Thursday, June 08, 2006 12:30 PM
To: users@myfaces.apache.org
Subject: panelTabbedPane question




I have a tabbed pane with a tabChangeListener attached

<h:form id="dealForm">
        <x:panelTabbedPane id="dealTabbedPane"
                    selectedIndex="#{dealForm.activeTab}"
                    bgcolor="#eeeeee"
                    width="980"
                    activeTabStyleClass="tabActive"
                    inactiveTabStyleClass="tabActive"
                    serverSideTabSwitch="true">
                <x:tabChangeListener type="com.foo.listener.TabListener"/>

...
</h:form>

but on MyFaces 1.1.1, the TabListener's

  public void processTabChange(TabChangeEvent event) {
//...
  }

is not being invoked.  Is there something additional that need to be done to
enable the tab listener?

Thanks for any help,

James





RE: panelTabbedPane question

Posted by Julian Ray <ju...@yahoo.com>.
try using a value binding for the tabChangeListener handler eg.
<x:tabChangeListener type="#{myBackingBean}">
 
 

  _____  

From: James Richards [mailto:james_richards@northps.com] 
Sent: Thursday, June 08, 2006 12:30 PM
To: users@myfaces.apache.org
Subject: panelTabbedPane question




I have a tabbed pane with a tabChangeListener attached

<h:form id="dealForm">
        <x:panelTabbedPane id="dealTabbedPane"
                    selectedIndex="#{dealForm.activeTab}"
                    bgcolor="#eeeeee"
                    width="980"
                    activeTabStyleClass="tabActive"
                    inactiveTabStyleClass="tabActive"
                    serverSideTabSwitch="true">
                <x:tabChangeListener type="com.foo.listener.TabListener"/>

...
</h:form>

but on MyFaces 1.1.1, the TabListener's

  public void processTabChange(TabChangeEvent event) {
//...
  }

is not being invoked.  Is there something additional that need to be done to
enable the tab listener?

Thanks for any help,

James