• 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

Loss of context variables in Seam

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I used a factory for preparing a datamodel, I noticed that the factory is correctly invoked only one time while the page is rendered. But then someone accidentally changed a tag attribute in JSF from value="something" to zzvalue="something" (probably a Ctrl-Z gone wrong ). This caused the entire JSF lifecycle to repeat and the factory was invoked 2 times in one request. This caused mayhem as all the variables of the component were cleared after the first invocation. And when the second invocation occurred the parameters which were passed using the pages.xml were not injected into the component. Can anyone shed some light on why there was no error shown or why seam would not inject the context parameters the second time around? It took many days to find out the problem
 
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your scope on the factory (and it's containing component). If it was a POJO then by default it's EVENT scoped and that would cause your problem. Seen it many times with people new(er) to Seam.

Remember: Default POJO component scope is EVENT.
 
Ashok C. Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. The scope is EVENT. We use List and Home classes which extend from EntityQuery and EntityHome. The default scope of List is EVENT and of Home is CONVERSATION. But the problem is not with the scope. It works fine when the JSF tag is written correctly. I am curious to know why there was no error. Instead the factory was invoked two times and the second invocation was without any injections.
 
Jason Porter
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is strange, I would have figured facelets would have complained. Have to think about that one, maybe some one else has run across this before.
 
A tiny monkey bit me and I got tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic