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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:17:43+00:00 2026-06-12T10:17:43+00:00

I am using JSF 2.0, tomahawk, and some f:ajax thing in my development. I

  • 0

I am using JSF 2.0, tomahawk, and some f:ajax thing in my development. I am trying make some magic word to my JSF application. When you click on the word, it will change to the other, and click on it again will change it back again. To make it more clear, here is a scenario. Original word showing XX, when click on the XX, the XX will change to YY. When click on the YY, will change back to XX. Do you feel the magic? 😛

This is how I make it. I create 2 h:panelGroup. One will contain a XX word and the other one will contain YY word, like this:

<h:panelGroup id="Panel_X">
   <h:outputText value="XX" />
</h:panelGroup>

<h:panelGroup id="Panel_Y">
   <h:outputText value="YY" />
</h:panelGroup>

To make it clickable, I use commandLink. Modify from the code above and become this:

<h:panelGroup id="Panel_X" rendered="#{magicBean.show_X == true}">
   <h:commandLink action="#{myBean.doFunc}">
      <f:ajax event="action" render="Panel_Y"/>
      <h:outputText value="XX" />
   </h:commandLink>
</h:panelGroup>

<h:panelGroup id="Panel_Y" rendered="#{magicBean.show_X == false}">
   <h:commandLink action="#{myBean.doFunc}">
      <f:ajax event="action" render="Panel_X"/>
      <h:outputText value="YY" />
   </h:commandLink>
</h:panelGroup>

Here is the backing bean:

@ManagedBean(name = "magicBean")
@SessionScoped
public class MagicWordBean {

   public boolean show_X = true;

   /** getter and setter of show_X **/

   public String doFunc() {

      showX = !showX;
      return "";
   }
}

I am not sure whether I am doing it correctly but one thing I am sure it doesn’t work. Initially when the page is loaded, it shows XX word. When clicking on the XX word, YY word doesn’t show, and XX word remain there.

Any clue on this?

  • 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-12T10:17:43+00:00Added an answer on June 12, 2026 at 10:17 am

    I think that the render="Panel_Y" is your problem: you are trying to render something that is not rendered on the page in the first place. Try to render the parent/container (i.e. the h:form containing both panels) which will re-evaluate the rendered="#{magicBean.show_X == false}" in your second panel.
    I can also suggest changing the later to rendered="#{magicBean.show_Y}" for readability…

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

Sidebar

Related Questions

two days ago i started using tomahawk ExtensionsFilter components im my jsf application. i
Using jsf I want to edit a employee profile, when user will click on
I am trying to create the world most simple dataTable using JSF tomahawk like
I'm using JSF/Facelets, and I'm trying to iterate over some Document objects (custom object)
I am trying to implement Pagination in JSF using Tomahawk. When the page is
I'm using JSF 1.2 with Richfaces and Facelets. I have an application with many
i'am using JSF and Spring in a web application. If the Spring Controller throws
I'm using JSF (Mojarra 1.2) with Richfaces (3.3.2) within some facelets which are used
I am using JSF 1.2 without tomahawk and other libraries. The JSF Applicatin works
I am using JSF 1.2 + Facelets + Apache My Faces without Tomahawk or

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.