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

  • Home
  • SEARCH
  • 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 6856497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:53:37+00:00 2026-05-27T01:53:37+00:00

Here is the problem: actionlistener does not want to be fired @ManagedBean(name=hotelsController) @SessionScoped public

  • 0

Here is the problem: actionlistener does not want to be fired

@ManagedBean(name="hotelsController")
@SessionScoped
   public class HotelsController implements Serializable {
      public void requestHotelAvail(ActionEvent event) {
         request = new Request(df.format(arrivalDate), df.format(departureDate));
      }
   }

and xhtml

<h:panelgroup id="rooms"/>
<h:form  id="hotelSearch">
            <p:commandButton actionListener="#{hotelsController.requestHotelAvail}" value="submit" update="rooms" />
</h:form>

I have tried everything I could search of changed @managedbean to @component set import to import javax.faces.event.ActionEvent;

But it still does not fire anything.

Form is in a p:accordion and when used with h:commandbutton it works fine

EDIT: sorry for mislead. rooms updates after click but actionListener is not fired. so rooms will not get any new data. Important code in requestHotelAvail needs to be fired before updating rooms and its not.

EDIT2: PrimeFaces 2.2.1 – I’ve read whole manual to primefaces but theres no explanation to this as I’ve done all that it states

I’ve tried using action instead of actionListener without ActionEvent but it never do anything. using <h:commandbutton action="#{hotelscontroller.requestHotelAvail}"/> works great but I want that ajax engine to refresh only that rooms panelgroup

UPDATE: Now it works. Form couldn’t be in <p:accordion> but why and how to enable it there? Form now I’ll work without it.

  • 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-27T01:53:38+00:00Added an answer on May 27, 2026 at 1:53 am

    I suspect the different behavior from h:commandLink comes from ajax/non-ajax processing.

    By default – if you don’t use f:ajax – h:commandLink is non-ajax and entire page is rerendered. Primefaces p:commandLink is using ajax and you indicate rooms as component to be updated. In your case rooms is outside form so it should rather be addressed as :rooms (mind the colon) instead of just rooms.

    update: have you tried ajax with h:commandLink? It would be:

    <h:commandButton action="#{hotelscontroller.requestHotelAvail}" value="submit">
      <f:ajax render=":rooms"/>
    </h:commandButton>
    

    Also I’m not that familiar with primefaces but maybe you can try to explicitly indicate the component to process with additional process="@this" – although I would assume this to be default as in basic library.

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

Sidebar

Related Questions

I have a problem here. My Zend_Forms do not render in view script. Via
Here is my Problem: Backing bean is @SessionScoped I have a p:dataTable with selectionMode
I have this timer here: timer = new Timer(delay, new ActionListener() { @Override public
The problem here is how to add an NSPopUpButton in Xcode 4's Interface Builder
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
date here my problem: String datetime = 2012-03-24 23:20:51; I know that that string
Super weird problem here. I'm having trouble getting jQuery to bind any selectors except
I have a problem here im trying to upload a file first time it
Im having a problem here. i downloaded jake wharton. He gave an example of
What is the problem here? (Besides having redundant code). $.getJSON works as expected. However

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.