Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:17:46+00:00 2026-06-17T19:17:46+00:00

I’m writing an application in Java EE 6 and using Primefaces 3.4.1 for the

  • 0

I’m writing an application in Java EE 6 and using Primefaces 3.4.1 for the user interface.

I have something like that.

genericPage.xhtml

<ui:composition template="mainApplicationTemplate.xhtml" [...]>
    <p:tabView id="tabView" dynamic="false"cache="false">
        <p:tab id="tab1" title="Tab 1">
            <h:form id="form1">
                ...
            </h:form>
        </p:tab>
        <p:tab id="tab1" title="Tab 1">
            <h:form id="form2">
                ...
            </h:form>
        </p:tab>
    </p:tabView>
<ui:composition >

child1.xmtml

<ui:composition template="genericPage.xhtml" ...>
    <ui:param name="actionBean" value="#{actionBeanA}"/>
</ui:compisition>

child2.xmtml

<ui:composition template="genericPage.xhtml" ...>
    <ui:param name="actionBean" value="#{actionBeanB}"/>
</ui:compisition>

The idea behind that is that child1.xhtml and child2.xhtml share the same jsf code, all contained in the genericPage.xhtml, but they have different backend bean (parametrised by “actionBean”)

So far that works really well. It gets complicated when I put the ui parameter inside an <p:ajax/> element.

From the backend bean, I need to programmatically update the active tab, leaving the other untouched. In order to that, I need to store the active tab in the action bean, When certain external events occur, the action bean updates the active tabs.

Note that due to some other factors:

  • I cannot set dynamic="true" in the tabView
  • I cannot have a global form around the tabView and thus cannot use the ‘activeIndex’ property (which I am doing in an other part of the application) to manage the active tab.

What I want to do

To solve this issue, I want to use the tabChange event of the tabView element:

<p:tabView id="tabView" dynamic="false"cache="false">
        <p:ajax event="tabChange" listener="#{actionBean.listen}"
        <p:tab id="tab1" title="Tab 1">
            <h:form id="form1">
                ...
            </h:form>
        </p:tab>
        <p:tab id="tab1" title="Tab 1">
            <h:form id="form2">
                ...
            </h:form>
        </p:tab>
    </p:tabView>

action bean

@Named
@WindowScoped
public class ActionBeanA implements Serializable{
    public void listen(TabChangeEvent event){
        ...
    }

}

What doesn’t work

When I do that, I’m getting the error

Target Unreachable, identifier 'actionBean' resolved to null: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'actionBean' resolved to null

This seems to indicate that the <p:ajax> element has not been passed the action bean and therefore doesn’t know what actionBean is.

However if I change the signature of the listener method like that

<p:ajax event="tabChange" listener="#{actionBean.listen(anything)}"

and change the backend bean to something like:

public void listen(TabChangeEvent event){
    System.out.println(event.toString());
}

Doing that, I am not getting the target unreachable error but a null pointer exception in the listen method (because I haven’t assigned a value to “anything”). That shows that in this case, the <p:ajax/> elements knows what actionBean is and manages to call the method in the bean.

Questions

How could I get around this problem? I’d like to be able, on a tab change event, to send to my backend bean the new active tab.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:17:47+00:00Added an answer on June 17, 2026 at 7:17 pm

    I was also having this problem and found the solution in Primefaces issue tracker: Solution found in the post #20

    To summarise, this is a known problem in Primefaces. The semi-fix is found in the release 3.4.2 and requires some changes to the code. At the moment you have:

    public void listen(TabChangeEvent event){
        System.out.println(event.toString());
    }
    

    Which does not work. You should change your code to:

    public void listen(AjaxBehaviorEvent event){
        System.out.println(event.toString());
    }
    

    And if you need to use specific methods of TabChangeEvent then you need to do the casting: (TabChangeEvent)event.

    It has a status fixed on the issue tracker so it may require this as a permanent solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have been unable to fix a problem with Java Unicode and encoding. The
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.