Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Problem passing params using managed-propertys

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

Having trouble today trying to utilise JSF's param's & injectors features. But without any success.

What I have is a button on Page1 which has a f:param that I want to be automatically injected into Page2. However the injection never takes place.. the value passed always appears to be null.

So on Page1 I have the following..




The action above relates to the following navigation rule...




The managed bean definition with the managed property for Page 2 is..






So from what I've read online.. the f:param should be automatically injected into the Page2 bean.. However as said, I put a little debugging in the setter of my source field and when thats called, the source is always null.

Any thoughts/advice appreciated.. I really want to understand this method of passing data rather than having to stick things in the session bean all the time..

Thanks
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This will help you understand better
Communications in JSF
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kavita Tipnis wrote:This will help you understand better
Communications in JSF



Thanks for that link, I've bookmarked it, its a good article.

Unless I'm missing something though, my approach should be working.. I'll give the alternative method of using hidden form elements a go rather than the f:param...
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After playing around a little I've discovered something which I'm not sure is standard behaviour of JSF or not.. hopefully you might be able to shed some light..

My parameter is passed perfectly when I used a <input type="hidden"> tag AND ONLY if I specify the action directly on the command button definition.. E.G..



However, if I want to perform a little extra processing when the button is clicked and specify a backing bean method as the action, the parameter does not get through to Page2..

I.E this doesn't work..:





I can only assume whats happening is the parameter is getting through to the call to the backing bean method.. But not forwarded on to Page2 after that...

Shouldn't that be the case ?

Rgds,
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic