You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Amaris Nieves <da...@gmail.com> on 2008/09/23 00:59:38 UTC

How to change the active tab in Tomahawk ?

 I want to be able to have a form inside one of the tabs of a
<t:panelTabbedPane> and when a button is clicked the active tab changes to
the next tab. How can I do this?
Can have an example of how to achieve this?

Thank you.

Re: How to change the active tab in Tomahawk ?

Posted by Leonardo Uribe <lu...@gmail.com>.
On Tue, Sep 23, 2008 at 2:53 PM, Amaris Nieves <da...@gmail.com>wrote:

> Thank you guys.
>
> Leonardo:
>
> For what I understand myFaces_showPanelTab is a JavaScript function.*Is**
> ** this function documented somewhere?* I tried to search the docs
> provided at the project (
> http://myfaces.apache.org/tomahawk-project/tomahawk/) site but I didn't
> find it.
>

It is a javascript file, so in the generated docs this part is not referred.
If you want more info, you have to take a look at this files
(dynamicTabs.js) inside tomahawk source code.

You can use svn at:

http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/

to get the latest code.

regards

Leonardo Uribe


>
> On Tue, Sep 23, 2008 at 4:13 AM, Bruno Aranda <br...@gmail.com>wrote:
>
>> Hi,
>>
>> Another solution could be to play with the "disclosed" attribute for
>> each tab. In your backing bean you could have some variable that
>> changes
>>
>> <tr:panelTabbed>
>>  <tr:showDetailItem text="Tab 1"
>> disclosed="#{myBackingBean.disclosedTab == 'myTab1'}">
>> ...
>>  </tr:showDetailItem>
>>  <tr:showDetailItem text="Tab 2"
>> disclosed="#{myBackingBean.disclosedTab == 'myTab2'}">
>> ...
>>  </tr:showDetailItem>
>> </tr:panelTabbed>
>>
>> Probably there are more elegant ways too, but that could do the trick,
>>
>> Bruno
>>
>> 2008/9/23 Leonardo Uribe <lu...@gmail.com>:
>> >
>> >
>> > On Mon, Sep 22, 2008 at 5:59 PM, Amaris Nieves <da...@gmail.com>
>> > wrote:
>> >>
>> >> I want to be able to have a form inside one of the tabs of a
>> >> <t:panelTabbedPane> and when a button is clicked the active tab changes
>> to
>> >> the next tab. How can I do this?
>> >> Can have an example of how to achieve this?
>> >
>> > There is not a clean solution for this issue. It depends if you are
>> using
>> > client side or server side tab switch.
>> >
>> > on client side tab switch it renders something like this:
>> >
>> > <input type="submit" name="_idJsp0:panelTabbedPane1:_idJsp2.0"
>> value="Tab1"
>> >
>> > onclick="return
>> >
>> myFaces_showPanelTab(0,'_idJsp0:panelTabbedPane1:_idJsp2_indexSubmit','_idJsp0:panelTabbedPane1:tab1_headerCell','_idJsp0:panelTabbedPane1:tab1.content',panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FHeadersIDs,panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FIDs,null,null,null,null);"
>> > />
>> >
>> > so call this java method should do the trick. but on server side tab
>> switch
>> > it is rendered like this:
>> >
>> > <input type="submit" name="_idJsp0:panelTabbedPane2:_idJsp37.0"
>> value="Tab1"
>> > />
>> >
>> > You can render the same in other part to get the same effect.
>> >
>> > Maybe there are other alternatives (create a custom component that do
>> the
>> > previous is a more cleaner form.....), the previous one is ugly but
>> works.
>> >
>> > regards
>> >
>> > Leonardo Uribe
>> >
>> >>
>> >> Thank you.
>> >
>> >
>>
>
>

Re: How to change the active tab in Tomahawk ?

Posted by Amaris Nieves <da...@gmail.com>.
Thank you guys.

Leonardo:

For what I understand myFaces_showPanelTab is a JavaScript
function.*Is** **this function documented somewhere?
* I tried to search the docs provided at the project (
http://myfaces.apache.org/tomahawk-project/tomahawk/) site but I didn't find
it.

On Tue, Sep 23, 2008 at 4:13 AM, Bruno Aranda <br...@gmail.com> wrote:

> Hi,
>
> Another solution could be to play with the "disclosed" attribute for
> each tab. In your backing bean you could have some variable that
> changes
>
> <tr:panelTabbed>
>  <tr:showDetailItem text="Tab 1"
> disclosed="#{myBackingBean.disclosedTab == 'myTab1'}">
> ...
>  </tr:showDetailItem>
>  <tr:showDetailItem text="Tab 2"
> disclosed="#{myBackingBean.disclosedTab == 'myTab2'}">
> ...
>  </tr:showDetailItem>
> </tr:panelTabbed>
>
> Probably there are more elegant ways too, but that could do the trick,
>
> Bruno
>
> 2008/9/23 Leonardo Uribe <lu...@gmail.com>:
> >
> >
> > On Mon, Sep 22, 2008 at 5:59 PM, Amaris Nieves <da...@gmail.com>
> > wrote:
> >>
> >> I want to be able to have a form inside one of the tabs of a
> >> <t:panelTabbedPane> and when a button is clicked the active tab changes
> to
> >> the next tab. How can I do this?
> >> Can have an example of how to achieve this?
> >
> > There is not a clean solution for this issue. It depends if you are using
> > client side or server side tab switch.
> >
> > on client side tab switch it renders something like this:
> >
> > <input type="submit" name="_idJsp0:panelTabbedPane1:_idJsp2.0"
> value="Tab1"
> >
> > onclick="return
> >
> myFaces_showPanelTab(0,'_idJsp0:panelTabbedPane1:_idJsp2_indexSubmit','_idJsp0:panelTabbedPane1:tab1_headerCell','_idJsp0:panelTabbedPane1:tab1.content',panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FHeadersIDs,panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FIDs,null,null,null,null);"
> > />
> >
> > so call this java method should do the trick. but on server side tab
> switch
> > it is rendered like this:
> >
> > <input type="submit" name="_idJsp0:panelTabbedPane2:_idJsp37.0"
> value="Tab1"
> > />
> >
> > You can render the same in other part to get the same effect.
> >
> > Maybe there are other alternatives (create a custom component that do the
> > previous is a more cleaner form.....), the previous one is ugly but
> works.
> >
> > regards
> >
> > Leonardo Uribe
> >
> >>
> >> Thank you.
> >
> >
>

Re: How to change the active tab in Tomahawk ?

Posted by Bruno Aranda <br...@gmail.com>.
Hi,

Another solution could be to play with the "disclosed" attribute for
each tab. In your backing bean you could have some variable that
changes

<tr:panelTabbed>
  <tr:showDetailItem text="Tab 1"
disclosed="#{myBackingBean.disclosedTab == 'myTab1'}">
...
  </tr:showDetailItem>
  <tr:showDetailItem text="Tab 2"
disclosed="#{myBackingBean.disclosedTab == 'myTab2'}">
...
  </tr:showDetailItem>
</tr:panelTabbed>

Probably there are more elegant ways too, but that could do the trick,

Bruno

2008/9/23 Leonardo Uribe <lu...@gmail.com>:
>
>
> On Mon, Sep 22, 2008 at 5:59 PM, Amaris Nieves <da...@gmail.com>
> wrote:
>>
>> I want to be able to have a form inside one of the tabs of a
>> <t:panelTabbedPane> and when a button is clicked the active tab changes to
>> the next tab. How can I do this?
>> Can have an example of how to achieve this?
>
> There is not a clean solution for this issue. It depends if you are using
> client side or server side tab switch.
>
> on client side tab switch it renders something like this:
>
> <input type="submit" name="_idJsp0:panelTabbedPane1:_idJsp2.0" value="Tab1"
>
> onclick="return
> myFaces_showPanelTab(0,'_idJsp0:panelTabbedPane1:_idJsp2_indexSubmit','_idJsp0:panelTabbedPane1:tab1_headerCell','_idJsp0:panelTabbedPane1:tab1.content',panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FHeadersIDs,panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FIDs,null,null,null,null);"
> />
>
> so call this java method should do the trick. but on server side tab switch
> it is rendered like this:
>
> <input type="submit" name="_idJsp0:panelTabbedPane2:_idJsp37.0" value="Tab1"
> />
>
> You can render the same in other part to get the same effect.
>
> Maybe there are other alternatives (create a custom component that do the
> previous is a more cleaner form.....), the previous one is ugly but works.
>
> regards
>
> Leonardo Uribe
>
>>
>> Thank you.
>
>

Re: How to change the active tab in Tomahawk ?

Posted by Leonardo Uribe <lu...@gmail.com>.
On Mon, Sep 22, 2008 at 5:59 PM, Amaris Nieves <da...@gmail.com>wrote:

> I want to be able to have a form inside one of the tabs of a
> <t:panelTabbedPane> and when a button is clicked the active tab changes to
> the next tab. How can I do this?
> Can have an example of how to achieve this?
>

There is not a clean solution for this issue. It depends if you are using
client side or server side tab switch.

on client side tab switch it renders something like this:

<input type="submit" name="_idJsp0:panelTabbedPane1:_idJsp2.0" value="Tab1"
onclick="return
myFaces_showPanelTab(0,'_idJsp0:panelTabbedPane1:_idJsp2_indexSubmit','_idJsp0:panelTabbedPane1:tab1_headerCell','_idJsp0:panelTabbedPane1:tab1.content',panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FHeadersIDs,panelTabbedPane_5F_5FidJsp0_3ApanelTabbedPane1_3A_5FidJsp2_5FIDs,null,null,null,null);"
/>


so call this java method should do the trick. but on server side tab switch
it is rendered like this:

<input type="submit" name="_idJsp0:panelTabbedPane2:_idJsp37.0" value="Tab1" />

You can render the same in other part to get the same effect.

Maybe there are other alternatives (create a custom component that do the
previous is a more cleaner form.....), the previous one is ugly but works.

regards

Leonardo Uribe


>
> Thank you.
>