webtier@glassfish.java.net

jsf - dataTable and requestscope

From: daniela noll <baba69_at_gmx.de>
Date: Sun, 21 Jun 2009 19:11:05 +0200

Hello,

I have a question about JSF and hope that this is the right mailing list. It is my first JSF-project and coming from action oriented frameworks I probably miss relevant points.

I want to present a list of elements to the user which he can edit, delete or select. As a new user I am trying to get this to work with h:dataTable and h:commandLink-tags. This displays correctly but when I click edit I am shown the same page again - though this time without the table. I guess that it is because of the request scope of the backing bean. To verify this, I tried to return a dummy set all the time - and then it works fine. This set contains the elements over which the dataTable runs.

To me the need to return the same set from the backing bean doesn't seem to be useful. I select the elements for the table from the db. I use the table to display the rows but do not need the content of this table afterwards. It even might have changed when the user uses this page again. I just want to get the id of the selected element and display the edit page. This is easy with action frameworks but I do not know how to do this with JSF - without session scope or querying the db again and again.

I am no native speaker but I hope you understand my problems. And probably can even anwser the question or point me in the right direction ;-) I am sure there is a proper JSF-way to do this.

Thx,

Daniela

-- 
GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und Telefonanschluss
für nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02