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 7831439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:43:59+00:00 2026-06-02T11:43:59+00:00

I have a complex jsf page with some widgets developed in PrimeFaces. Up to

  • 0

I have a complex jsf page with some widgets developed in PrimeFaces. Up to now, the application is completely ajaxified, meaning that there aren’t submits, but all the events and updates are handled through Ajax behavior (this is not a must, but a nice-to-have feature). I have also done a SelectOneMenu for switching the language:

<h:form>
    <p:panelGrid columns="2" >
        <h:outputText value="#{msgs.SelectLanguage}" />
        <p:selectOneMenu value="#{languageSwitcher.selectedLanguage}" >
            <f:selectItems value="#{languageSwitcher.languages}" ></f:selectItems>
        </p:selectOneMenu> 
    </p:panelGrid>
</h:form>

The switcher works well.
My problem is how to reload the translated messages when a language is selected.

I have tried these options:

Option 1

With an ajax update inside the selectOneMenu:

<p:ajax update="myFormsTobeUpdated" ></p:ajax>

This works great, and is the preferred solution because it’s Ajax, but

EDITED

this solution doesn’t ajax-update the Tab titles in the PrimeFaces TabView, and this is problem is blocking because the Tab titles need to be translated.

Option 2

With a complete reload of the page in Javascript. I have tried this but doesn’t work (can’t tell why):

<p:selectOneMenu value="#{languageSwitcher.selectedLanguage}" onchange="window.location.reload()" >

Option 3

With a complete reload of the page in Java like explained here: https://stackoverflow.com/a/1821708/870122 (to be honest I haven’t tried it yet, but will do soon!)

Any suggestions are welcome.

  • 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-02T11:44:00+00:00Added an answer on June 2, 2026 at 11:44 am

    Since with Option 1 it’s not possible to ajax-update the Tab titles in the PrimeFaces TabView, I have switched to Option 2, a complete reload of the page using JavaScript.

    The code that makes it work is:

    <h:form id="selectLanguage">
        <p:panelGrid columns="2">
            <h:outputText value="#{msgs.SelectLanguage}" />
            <p:selectOneMenu value="#{languageSwitcher.selectedLanguage}" onchange="document.getElementById('selectLanguage').submit();" >
                <f:selectItems value="#{languageSwitcher.languages}" ></f:selectItems>
            </p:selectOneMenu> 
        </p:panelGrid>
    </h:form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a complex application that contains a mix of JSF and Apache MyFaces.
I have some complex stored procedures that may return many thousands of rows, and
i have complex xslt that formats xml to html now i need to be
I have a pretty complex JSF page (we use JSF2 with facelet) in which
Richfaces 3.3.3, Jsf 1.2: I have a a4j:form that uses some simple validation, mainly
I have a complex query that's executed on every page and whose results rarely
We have complex template classes that have some methods which will not work with
I have complex GUI application written in Python and wxPython. I want it to
I have a complex .NET Remoting server app that provides a couple of services.
I have a complex command that I'd like to make a shell/bash script of.

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.