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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:29:09+00:00 2026-06-17T17:29:09+00:00

i have a jsf file where i have selectOneMenu and a h:graphicImage.Now the problem

  • 0

i have a jsf file where i have selectOneMenu and a h:graphicImage.Now the problem is when i send onchange request through selectOneMenu and want to reRender the h:graphicImage and want to show and hide boolean in action bean.But not work properly. Actully first i investigate it very carefully that when i send action through selectOneMenu the boolean value set correctly in bean but not set the reRender value properly.If i refresh page then it work properly.Anyone who i can solve it if i want to refresh page on selectOneMenu actionlistener then how i refresh page.My code is here for more detail

    <h:selectOneMenu id="stageListID" value="#{mnpBean.stageList.defaultValue}" >
<f:selectItems  value="#{mnpBean.stageList.values}"/>
<a4j:support event="onchange" actionListener="#{mnpAction.onStageListChangeAction}" reRender="addBtn1" oncomplete="resetViewConfigs();"/>
</h:selectOneMenu>

code for grphic image

<h:graphicImage id="addBtn1"  url=""  rendered="#{mnpBean.showAddButton}" style="cursor:pointer">
<a4j:support id="addRowBtn1" event="onclick"  actionListener="#{mnpAction.addMultiNoRingFence}"/>
</h:graphicImage> 

bean code here

public void onStageListChangeAction(ActionEvent ae) {
mnpBean = getMNPBean();
if ("10".equals(mnpBean.getStatusList().getDefaultValue()) &&       "010".equals(mnpBean.getStageList().getDefaultValue())) {
 mnpBean.setShowAddButton(false);         
 }else{
 mnpBean.setShowAddButton(true);         
 }

}

Any helping regarding this appreciate

  • 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-17T17:29:10+00:00Added an answer on June 17, 2026 at 5:29 pm

    What you should do :

    1. Wrap your <h:graphicImage/> in a container like <h:panelGrid/>

      <a4j:outputPanel ajaxRendered="true" layout="none" id="imageContainer">
       <h:graphicImage id="addBtn1"  url=""  rendered="#{mnpBean.showAddButton}" style="cursor:pointer">
          <a4j:support id="addRowBtn1" event="onclick"  actionListener="#{mnpAction.addMultiNoRingFence}"/>
       </h:graphicImage> 
      <a4j:outputPanel/>
      
    2. Use the id of the container as the target of the reRender

      <a4j:support event="onchange" actionListener="#{mnpAction.onStageListChangeAction}" reRender="imageContainer" oncomplete="resetViewConfigs();"/>
      

    For the reason why the issue is happening the first place, see explanation here

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

Sidebar

Related Questions

This is the complete source code: http://www.sendspace.com/file/lwxpyf I have a problem with a JSF
I have a JSF file with a rather large form, the form consists of
We have JSF web application that generates XLS file and gives user link to
I want to upload a file with AJAX in a JSF application. The idea
I am trying to learn pickList from Primefaces . What I have jsf file,
I have a jsf component that must access to a javascript file, i added
I have some JSF-trouble using h:selectOneMenu with a list from my backend bean: My
In my JSF file I have below at the start. <h:form><h:commandLink value=Create New Staff
I have a simple file upload mechanism in one of my jsf pages. Once
We have a very complex config file for JSF managed beans that looks like

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.