Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Seam In Action - 2nd Question to Dan Allen

 
Wayne Hatayama
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,

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.

Thanks,

Wayne
 
Jason Porter
Author
Ranch Hand
Posts: 126
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you said this should be easy to do with A4J / RichFaces. Personally I'd say go take a look at ICEfaces (http://www.icefaces.org) 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
Author
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Wayne Hatayama
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,

Wayne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic