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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:22:16+00:00 2026-05-30T06:22:16+00:00

I am stuck with a problem that doesnt make any sense to me. I

  • 0

I am stuck with a problem that doesnt make any sense to me. I have a listbox which fires selectionChange-Events with simple Ajax. The idea is that the edit-button isnt enabled until a item in the list is selected. So I created the following code.

<h:form>
    <h:selectManyListbox value="#{bean.selectedIds}">
        <f:selectItems value="#{bean.listOfItems}" />
        <f:ajax render="edit"
            listener="#{bean.selectionChanged}" />
    </h:selectManyListbox>
    <br />

    <h:commandButton id="add" value="#{msgs.add}"
        action="#{bean.addNew}" />

    <h:commandButton id="edit" value="#{msgs.edit}"
        disabled="#{bean.editButtonDisabled}"
        action="#{bean.edit}" />
</h:form>

The button is enabled and disabled as I wish but as it turns out, the edit-button isnt triggering any action (I added some sysout to the add- and edit-method in the bean and the edit-method is never called)…instead the html changes. The above code is nested in a simple div. When I click edit, the whole form is outside of that div.

When I add this ajax-behavior to the add-button, the same happens there and vice versa, when I remove the disabled-attribute from the edit-button everything works???

I already had a look at BalusC answer here but I couldnt find any mistake related to that list. No nested forms and so on…its just a simple page with a template.

I am using Mojarra 2.1.2 on JBoss 7.1.Final.

Any help is appreciated. Thanks

  • 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-05-30T06:22:17+00:00Added an answer on May 30, 2026 at 6:22 am

    This issue is covered by point 5 of the answer which you’ve linked.

    The rendered attribute of the component and all of the parent components should not evaluate to false during the apply request values phase of the form submit request. JSF will namely recheck it then as part of safeguard against tampered/hacked requests. Putting the bean in the view scope and/or making sure that you’re preinitializing the condition in (post)constructor of the bean should fix it. The same applies to the disabled attribute of the component, which should not evaluate to true during processing the form submit.

    I suggest to change @RequestScoped on BikeManagementPanelBean to @ViewScoped.

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

Sidebar

Related Questions

I'm stuck on a RegEx problem that's seemingly very simple and yet I can't
I'm stuck on an aggregation problem that I can't get to the bottom of.
I am stuck on this problem which I am studying for an exam tomorrow.
Does anyone know if the problems that have been affecting Stack Overflow with regards
I am stuck with a problem when testing my controllers with RSpec - the
I got stuck in this problem for an hour. I am thinking this is
I've got stuck in a problem with gflags when trying to find some memory
I'm currently stuck on this problem. I've hooked into the method_missing function in a
I'm hoping someone can help me as I've been stuck on this problem for
Im working on an ASP.Net app with c#. I am stuck on a problem

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.