0

I'm a little bit lost with a PrimeFaces program I'm trying to understand.

Basically I have a Car.xhtml page. On this page I have a

commandbutton "id=save" "actionListener="#{CarView.save}"

To me it seemed pretty obvious that if I click on the button I m supposed to launch a method called save on the CarView.java.

There is a method save, but whatever I do, it seems that it's never called.

If I change "{carView.save}" into "{carView.save2}"` it tells me save2 doesn't exist and if I change the method save(ActionEvent actionEvent) into save2(ActionEvent actionEvent), I have the same message.

I cannot find any other method with the name save. And this program actually saves everything.I've spent a few hours but I'm still lost. Where should I look ?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Jean
  • 601
  • 1
  • 10
  • 26
  • Try camel case: `actionListener="#{carView.save}`, – K.Nicholas Sep 08 '17 at 16:14
  • sorry I think I wasn't clear but this programs works, I just don't get how it works – Jean Sep 08 '17 at 16:20
  • `#{CarView.save}` and `#{carView.save}` are fundementally different. Which one is it? And how is the bean declared. Even if it works , always post a [mcve]. You have several typo's in your code above that a real mcve helps. (and a`save(ActionEvent actionEvent)` _**is**_ called, no other option... – Kukeltje Sep 08 '17 at 16:36
  • 1
    Maybe you don't build after u make changes on your bean!! this link can help understand actionListner https://stackoverflow.com/questions/3909267/differences-between-action-and-actionlistener – ziMtyth Sep 10 '17 at 12:35

0 Answers0