• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using f:setPropertyActionListener

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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?

Regards,
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:


 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply Yeray.
I finally went on to use f:param which works well in my case.
J.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic