Hi.
The JSF beans have a "scope" of either "request", "session" or
"application" configured in the faces-config.xml file. Request scope
beans are created to process one http request and then destroyed.
I think the seqeuence you are seeing is:
HTTP request received
New JSF backing bean instansiated.
Requested process loading data into bean.
HTML response rendered with data from bean etc.
Bean destroyed
HTTP request received for "Save"
New JSF backing bean instansiated with null values.
Form elements in bean populated from HTML form.
Save request processed.
...
Hope this helps.
David Bernard
contact1981 wrote:
I am using Appfuse with JSF. I generated DAOs, xhtml pages, Managers
and much more using Appfuse. I have a backing bean for a form webpage.
Using sample-data.xml, I load up pre-existing data. Therefore, there
will be a backing bean containing pre-existing data for that
particular form webpage. Most of the attributes of the backing bean
are primitive data types(i.e int, boolean) or java class types(i.e
Integer, String). However, I also have attributes that are
application-specific class types. These objects of
application-specific class types do not need to be shown on the
screen. They are just associated with the backing bean as attributes.
I stepped through the code using MyEclipse Debugger, and loading up
the webpage worked out fine. In other words, all the fill-in boxes had
the correct pre-existing data. I also noticed that the backing bean’s
application-specific objects contain the correct information. When I
clicked on the save button, I decided to continue tracing through the
code. As I stepped through the code, I noticed that at some point all
the attributes of the backing bean are reset to null, and again
refreshed with the latest values in the fill-in boxes of the webpage.
All attributes of primitive data types and java class types are
restored with legitimate data. However, any attributes of
application-specific class types remain as null. In other words,
somewhere between edit and save, I lose all objects of
application-specific class types. Moreover, I don’t even see why
appfuse nulls out all the attributes of the backing bean in the first
place. How can I prevent losing all the attributes that are of
application-specific class types?
------------------------------------------------------------------------
View this message in context: JSF Backing bean's application-specific
class type attributes get nulled
<http://www.nabble.com/JSF-Backing-bean%27s-application-specific-class-type-attributes-get-nulled-tf2867641s2369.html#a8014806>
Sent from the AppFuse - User
<http://www.nabble.com/AppFuse---User-f2370.html> mailing list archive
at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]