calling tabview with tab index position

UI Components for JSF
Post Reply
mid491
Posts: 22
Joined: 21 Mar 2012, 18:44

21 Oct 2014, 10:55

Hello,

I have a MenuItem that call a jsf page that display a tabview :

Code: Select all

<p:menuitem value="run" action="/jsf/foo.jsf"
foo.xhtml :

Code: Select all

<p:tabView id="tabView">
	<p:tab id="tab1" ...
	<p:tab id="tab2" ...
	<p:tab id="tab3" ...
Each time I click on the menuItem, I want to call the foo.jsf page on the tab I was before the new call (i.e. staying on the current tab between 2 calls...)

any tips ?

thx!
PF 5.0 / JSF 2 /JBoss 6.3 EAP

soekris
Posts: 76
Joined: 29 Apr 2013, 16:54
Location: Barcelona

21 Oct 2014, 11:41

Hello

have you tried to use tabChange event?

Code: Select all

    public void onTabChange(TabChangeEvent event) {       
                   //getID is pseudoCode, I don't know wich method should be call to retrieve the current ID
                   lastTab = event.getTab().getID()); 
    }

Code: Select all

<p:tabView activeIndex="controlBean.lastTab">
Hope it helps
Primefaces 5.3.X / 6.X
NetBeans 8.1
WildFly 10
Linux Mint & freeBSD

bofafiller
Posts: 2
Joined: 22 Oct 2014, 03:33

22 Oct 2014, 04:27

"Do you believe in life after death?" the boss asked one of his employees. "Yes, Sir." the new recruit replied. "Well, then, that makes everything just fine," the boss went on. "After you left early yesterday to go to your grandmother's funeral, she stopped in to see you.

bofafiller
Posts: 2
Joined: 22 Oct 2014, 03:33

22 Oct 2014, 04:30

A security man has a dream that the plane his boss is supposed to take the next day is going to crash. When he wakes up he calls his boss at home and tells him. Insanely enough, the boss listens to him and decides not to take the plane. The next day, according to the young man's words, the plane crashes. The relieved boss calls the young man to his office and gives him a reward -- and then fires him.Curious as to why he is fired, the man asks his boss. The boss replies, "You were sleeping on the job."

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests