I am trying to pass two parameters i.e. (nomComposantARejouer, typeFileARejouer) to an action method (gestionnaireMessagesController.rejouerMessage) using the setPropertyActionListener (we use jsf 1.2).
Here is the relevant jsp code:
However, I always get a NPE because both parameters are null when used in the action method:
FYI, the variables and can be displayed without problem and are not null.
Also ignore the h:columnHeaderFacet tags. They are inhouse tags that I've renamed.
I am not sure what I am getting wrong. Can anyone please help?
I think that your code is doing something wrong in the getter and setter of nomComposant and typeFile. Could you write them?, what is the scope of your bean and how are you initializing the nomComposant and typeFile variables?
In my opinion you should remove the setPropertyActionListener, I think that you don't need them.
When you are clicking on commandLink "rejouer", first you are getting the value of nomComposant to assign it to nomComposantARejouer (getters and setter will be called before your code enter in rejouerMessage() method), maybe you can use directly the value of nomComposant in your backed bean when you are in rejouerMessage(), something like this:
SCJP 6 - SCWCD 5 - SCBCD 5
Joined: Apr 24, 2004
Thank you for your reply Yeray.
I finally went on to use f:param which works well in my case.