0

I am using prime face version 3.4 , The problem is with the tab view display.

<p:messages id="messages"/>
<p:tabView id="tabView" dynamic="false">

    <p:tab id="tab1" title="Navigation">

    <p:tab id="tab2" title="Email Address">

    <p:tab id="tab3" title="Password">

</p:tabView>

It's a Tabbed page with 3 Tabs(Notification , Email and Password) , If am on Email tab without entering any values i click submit , it displays the error message at the top and default to the first tab , I need to show the Email Tab

2
  • Your problem can only be reproduced when you have separate forms in each tab instead of one outside the tabview. However that wasn't visible in the code provided so far (which had at its own also severe syntax errors which I fixed, please pay more attention and love to the code so that one could reproduce your problem by just copypasting it).
    – BalusC
    Jan 23, 2013 at 12:47
  • Thanks For the Correction , I have edited the Code that i have shared.Also the When we have a global form the Error Message is addeded (such that when i move from one tab to another tab and click the save button.). If any mistakes excuse me. Jan 23, 2013 at 19:42

2 Answers 2

1

With ajax=false, the whole page gets refreshed after you click the button and tab view takes you to the first page just as if you were navigating to that page for the first time.

You could either set Ajax to true or use an integer on your bean as the selected index for the tabview (there's a property called selectedIndex on the tabview if memory doesn't fail me). The second option, however, would only work for view, session and application scoped beans.

1
  • Thanks For the Response.I tried setting the Ajax value to true , But again i am getting the same issue. also the when i move from One tab to another tab the error message appears at the top need to be removed. Jan 23, 2013 at 17:07
0

Place the <p:messages id="messages"> tag inside the <p:tab id="tab2" title="Email Address"> tag. Note that it will display messages from any validated component inside the same form (or from any of your tabs). You should use <p:message for="componentId"> to show component-specific messages.

2
  • Need to Display the Message at the top and not inside the TAB , I tried this option , It displays the error message but navigate it to the default screen. Jan 22, 2013 at 22:23
  • The Code above shows the message at the top globally , the problem is that its not showing the tab where the error message happens. Jan 23, 2013 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.