This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Seam In Action - 2nd Question  to Dan Allen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Seam In Action - 2nd Question  to Dan Allen" Watch "Seam In Action - 2nd Question  to Dan Allen" New topic

Seam In Action - 2nd Question to Dan Allen

Wayne Hatayama

Joined: Jan 31, 2002
Posts: 12

Presently, I am working on a single screen web application. There are two panels. On the left panel, there is a list of items. When the user selects one of the items, the right panel will display the details of that item. This similar to your open18 project, except you go to another screen when you make an item selection. How do I modify open18 to do this? Or can you direct me to example of this? I know how to do this with javascript and struts but its a big hassle. It would be much simpler if I could generate a CRUD and modify it with AJAX4JSF. Any suggestion would be greatly appreciated.


Jason Porter
Ranch Hand

Joined: Apr 26, 2007
Posts: 120
As you said this should be easy to do with A4J / RichFaces. Personally I'd say go take a look at ICEfaces ( their AJAX is easier to use (it's already baked into the components).

What you should be able to do is have a form in one column, do an AJAX submit of that form to the backing bean, then have the elements in your other column bound to the objects the form is updating then simply refresh the second column (in a4j an update region, should cascade down).
Dan Allen
Ranch Hand

Joined: Mar 05, 2003
Posts: 164
Here's a quick implementation. First, create a data table with a collection of items perhaps outjected by @DataModel. In each row, you will define an Ajax4jsf command link, which performs a data model selection exception does so using an Ajax request (similar to what I talk about in chapter 12)

Now let's say that the select() method does @DataModelSelection then outjects the result. I always recommend outjecting under a different variable name because of some quirkness with @DataModelSelection and outject (trust me on this).

Now, in the right hand column, you have an output panel that is Ajax rendered (the other approach is to use reRender="detailPanel" on the <a:commandLink>) .

There are tons of other ways to populate the context variable holding a reference to the selected record. But I think the interaction of the Ajax should be clear now.
[ October 10, 2008: Message edited by: Dan Allen ]

Dan Allen | | Author of Seam in Action -
Wayne Hatayama

Joined: Jan 31, 2002
Posts: 12
Thanks Dan!

If I can get this to work, I will have saved a huge amount of time over coding the old way. It's going take awhile to understand this process.

Thanks again,

I agree. Here's the link:
subject: Seam In Action - 2nd Question to Dan Allen
It's not a secret anymore!