• 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

Populating request scope managed bean

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a managed bean in the request scope that I'm using in a form screen. I tend to favor the request scope as it reduces all the trouble with the back button, reload, etc.

When clicking "edit" on an existing object, I get the data from the database, and stuff it into the request map. The navigation case goes to the edit screen. I don't have "redirect" set, and the url in the browser stays the same, so I assume it isn't redirecting. Yet, the data doesn't get into the form.

If I put the object in the session map, it shows up in the form.

I also tried checking the managed bean right after I set it in the request map by calling...

app.createValueBinding("#{"+ key +"}").getValue(facesContext);

Running this in the debugger (with the correct key) returns the object I set.

So, somewhere in there its dropping my object. Does it consider this a new request, even though it hasn't left the server? I guess I should try a scriptlet in the jsp page next, just to see if the object is available by the time it gets there.

While I'm on the subject, one of the biggest issues I've always had with jsf is the session and server storage of the view. Seems like we've given up on back button support, but I'm not sure users have. Any thoughts on that?
 
Kevin Galligan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tried the scriptlet on the form page. The value is in the request attribute collection.

So, its available, and I can get it with that call to the faces application object, yet its not showing up in the form. Any thoughts?

I'm using myfaces 1.1.1 and standard components.
 
Kevin Galligan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hate to bump, but I still can't get this to work. I had been stuffing the value into the session to get around the issue for the short term, but I'd really like to get this back into the request. Any thoughts? I put it into the request, but it just doesn't hold onto it. By the time the page logic is being executed, the object is gone.

Any help would be great because I'm lost. This should work, and it looks simple, but it just doesn't.

Thanks in advance.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your code for the JSF page that you are having a problem with ?
[ May 10, 2006: Message edited by: g madhava ]
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic