The way we do it is to 'reuse' the action class for most if not all the
functions on a form since there is so much similiarity.  We defined a
class ActionButtons which ActionForms use as a base class if they are
going to reuse the action class.

If no button has been pressed, i.e. the first time through the action we
go to an actionform defined lookup section (getDefaultInfomation) and
then forward to a 'lookup' jsp which could be you regular entry form if
so desired or a record selection.

This seems to be a natural way to handle the issue.

Edgar Dollin
Blue Moose Software

-----Original Message-----
From: Ian Tomey [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 30, 2002 9:25 AM
To: >
Subject: Re: SURVEY: Proper Way To Pre-populate ActionForms



Well we have a system for doing lookups that is triggered through a
custom tag in the jsp just after the <html:form> and is configured by an
xml description. The actual lookups can be made directly against our
service ejbs or from front end only 'helper' objects (which can also do
some caching if required). something along these lines (ignore names in
these, for example only!)
 
<bean-setup name="userForm">
   <property-lookup name="departments" lookup="myHelper.getDepartments">
       <param value="internal" type="java.lang.String"/>
   </property-lookup>
<bean-setup>

all our forms are derived off a derivation of ActionForm that adds a map
called lookup, that the looked up values are added into.
 
sometimes some of the lookups need information from the form to which
they are attached to get the correct list, in this case we have
something like:
 
<bean-setup name="userForm">
   <property-lookup name="employees" lookup="ejb_user.getEmployees">
       <param property="userId" />
   </property-lookup>
<bean-setup>


which takes the property userId from the userform and passes it into
getEmployees. The lookup code is also clever enough to spot if the
function takes an HttpServletRequest and automagically appends this to
the method calls.
 
this is enough to deal with everything we need at the moment.
 
Ian
 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to