[Webwork-user] Need Clarification on Workflow
Brought to you by:
baldree,
rickardoberg
From: Tim W. <tl...@us...> - 2000-11-27 21:46:27
|
OK. I'm grasping the framework pretty well now, but there are a few things I'm still unsure on. I'm going to walk through my app model, and match webwork to it. Let me know where I go astray. Log In: Provide username and password to access application. <webwork> Not sure how this fits in. Search For People: Provide a search string and receive a list of People. <webwork> Form Bean that takes a search string as a parameter, finds appropriate beans, and puts them in a Collection attribute. The JSP iterates over the collection and prints the list. I could go direct SQL here for performance, I suppose. Edit Person: Click on a Person from the search list and edit that Person's info. <webwork> Form Bean that takes a PersonId as a parameter, looks up the right Entity Bean, and attaches it to an attribute. The JSP then pulls out the attributes into an edit form. Save Person: Submit changes to a person made on the edit form. <webwork> I couldn't find a good example of this in EBS. Only the fields that were changed should be changed on the Entity Bean. Validiation and error checking has to occur. So I have a Form Bean that takes each and every attribute of the person as parameters (setters for each). Rather than individual attributes, each setter sets an attribute of a PersonData attribute. Then Person.setData is called with the data object. Voila, the data is changed. The problem is, if not all the parameters are specified, the data class ends up nulling those fields from the Entity Bean. :( I'd like to avoid brute-force listing each parameter and comparing it. For the dependent objects (accounts, etc.) I'm thinking separate frames and Form Beans. I'm worried that I should be using a stateful session bean, or some other method to hold onto the Person Entity Bean here, rather than looking it up over and over. But since I don't have direct access to the ServletContext, or some other stateful repository with the basic webwork model, I'm wondering how this could be accomplished. I'm sure I'm missing something... For example, if an error occurs, I have to look the bean up again to print the error and go back to the edit screen. What do you think? Thanks, Tim White |