At 7:34 AM -0500 2/10/05, CRANFORD, CHRIS wrote:
I have a form which needs to display several dropdown combo boxes, one in
particular is to be populated with values as follows:

  Today
  Yesterday
  This Week
  Last Week
  This Month
  Last Month
  Last 3 Months
  This Year
  Last Year
  series of Month/Day/Year values
  All

I wanted to ask others opinion on which is the better approach to populating
this combo-box values?  I could use a taglib similar to the following:

  <ss:TransactionDateSelectBox name="transactionForm" property="date"/>

The above would do a bean lookup for transactionForm with property date and
output the necessary HTML select/option tags needed to show the form's
selection box.

Or my action which forwards to the JSP could populate a collection of
LabelValueBean objects and then the JSP could iterate over the collection
using html:options.

For a menu like this (which appears as though it might be constant in the scope of the application), I would suggest making the list of LVBs in a ServletContextListener or PlugIn and storing them in application scope; then you may not even need a prep-action.


You can use the Digesting PlugIn and the stock "lvb-digester-rules.xml" and do this very easily. See http://svn.apache.org/repos/asf/struts/apps/trunk/shared/src/webapp/WEB-INF/struts-config.xml for an example of how to configure, and other files near that in the SVN repository for examples of the XML for the menu options and the digester rules.

Joe


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


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



Reply via email to