-1

Actually i am using tabbed panel inside the panel named(tabs).And having menu on clicking that menu link setting viewScope variable .it will passed to " Tab open by default "there i am using code like this if(viewscope.varaiablename>"") return viewscope.varaiablename else default tab

i am printing the value passed it shows four time printed same value

please explain me how it will work ![enter image description here][1]

  • What is your exact question? Is it not switching to the tab you want or are you worried about the event executing multiple times? – Panu Haaramo Jan 31 '13 at 12:31

1 Answers1

2

You need to use:

if (viewscope.variablename != "")

Did you mean to attach an image also?

Panu Haaramo
  • 2,932
  • 19
  • 41
  • even i tried that also ma problem is when i am partial refreshing that panel .the tabbed panel inside is also get refred for three times .i printed it in log and seen .can you pleas tell me why its triggering three times – user2028918 Jan 31 '13 at 12:22
  • @ Panu it executing multiple times.why it s happening three times – user2028918 Jan 31 '13 at 12:39
  • Sounds like it's executing once for each tab. Please post your code to the question and clarify what you are asking. – Panu Haaramo Jan 31 '13 at 12:47
  • say in menu label click i m setting viewscope.activetab="1" another label viewscope.activetab="2".For the same scope variable replaceing value and partial refresh the panel containing tabbed panel .In Tab open by default i wrote code like this if (viewscope.activetab) return viewscope.activetab else some default tab. when i am printing the what value is coming here that time it printing three times that value .So can you please explain me why its printing 3 times on partial refresh that tab – user2028918 Jan 31 '13 at 12:51
  • @user2028918: The rendered property (which is used for the tab panel) is recalculated multiple times during the JSF lifecycle. That's why it is printed three times to your console. Same thing will hapen with full refreshs. – Sven Hasselbach Jan 31 '13 at 12:58