Have created a hack to do this, using

            <bean:define id="thisDay" name="LogFilterForm" property="day"/>
            <html:select property="day" value="<%=(String)thisDay%>">
                <html:options collection="dayList" property="value"
                            labelProperty="label"/>
            </html:select>

Surely there is a cleaner way to do it than this?!  Not least as I have to do it
 for month, year, hour and minute as well!
Seems like I already have "day" right there, but can't figure out how to access
it w/o another bean define.  What am I missing?

Thanks,

Dave

---------------------- Forwarded by David Hay/Lex/Lexmark on 04/18/2001 02:04 PM
---------------------------


David Hay
04/18/2001 12:54 PM

To:   [EMAIL PROTECTED]
cc:

Subject:  Setting Select value= dynamically?  (Document link: David Hay)

Hi.  Am aware that you can set value= on html:select tag, as "the value to
compare with for marking an option selected".  For example, in the code below,
to display "08" when jsp loads

            <bean:define id="dayList" name="LogFilterForm" property="days"/>
            <html:select property="day" value="08">
                <html:options collection="dayList" property="value"
                            labelProperty="label"/>
            </html:select>

Before this jsp, I am filtering some records and want to set the day to the
earliest one found.  How do I do this?
I set the value of "day" in my FormBean to the one found, but how do I get this
one selected when jsp displayed?
Do I need to use some kind of scriplet?

Many thanks,

Dave






Reply via email to