Edit Screens with JSF
I'm working with JSF this morning and I'm finding one thing particularly annoying. I'm working on a simple master/detail screen and I'm tweaking the detail screen to fit my needs. It's just a <form> with some form elements. I change something, run "ant deploy-web" and hit "refresh" to see my updated page. Since everything in JSF is a post, I get prompted to re-submit the form. Fine, I agree - then I'm returned to the list screen. Argggh - why can't I just view the form again?! This might just be a MyFaces nuance, I'm not sure. Anyone know of a workaround?
Wanna see the bug/feature in action? Go to http://demo.raibledesigns.com/equinox-jsf/userList.html, click on a row - and after the edit screen displays, hit refresh on your browser. In an ideal world, you'd see the form again, but nope - you get the list instead.
Posted by Gary VanMatre on November 28, 2004 at 05:42 PM MST #
My edit() method has the following to get the username from the request.
Do I have to use something else to get the "username" parameter, or is there a way to put the parameter into the "to-view-id" element?
Posted by Matt Raible on November 28, 2004 at 06:22 PM MST #
You might try using an EL in the managed bean for your detail page.
... or ....
I might handle on the details page using the prerender callback of the script collector
Base tag render example....
Posted by Gary VanMatre on November 28, 2004 at 07:10 PM MST #
Posted by 67.176.118.130 on November 28, 2004 at 07:15 PM MST #
Posted by Matt Raible on November 28, 2004 at 07:32 PM MST #
Posted by 67.176.118.130 on November 28, 2004 at 08:50 PM MST #
Posted by Genie on November 30, 2004 at 08:37 AM MST #
Posted by toto on December 01, 2004 at 01:17 PM MST #
In certain circumstances Struts chaining is useful. (The commenting mechanism makes it hard to insert the XML here.) If the OK result from page1.jsp is found the next forward action can be to servlet identified as preparePage2. An OK result from that servlet can cause page2.jsp to be emitted. Note that I assume I don't care about the Struts repopulation problem because some other page (and ActionForm) is being created.
Without this preparePage2 servlet the page2.jsp page must prepare its own database structures, or the action handling the POST of page1.jsp must know enough about navigation to prepare page2.
So, if I want to have this behavior in Faces can I convince to-view-id to go to a servlet destination? I've seen no examples of to-view-id that *didn't* involve a .jsp reference.
Posted by Jerome Mrozak on January 05, 2005 at 09:02 PM MST #