On 10/13/06, Peter L. Berghold <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi folks, I have a real newbie question here. I've looked at various on line tutorials on this subject and for whatever reason I can't seem to wrap my head around this. My questions are two fold on this, but I'll start with what I'm sure is the simpler of the two and maybe it will shed light on the harder one. I am creating an application that is going to be an events calendar. When entering the event the form looks (for starters) like this: Event name: [text ] Event Location [text] [drop down ] Event classification: [drop down] Number of days: [text]
This part seems to fit into normal properties of a form bean. and there's where things get tricky. I know the answer is a nested
form, but I'm not quite sure how. If say a user says the event is three days long I want to present them with another form (or maybe through the magic of Ajax the same form... but that's for another time) that says: Day 1 date: [ text ] start time [ text ] end time [text] Day 2 date: [ text ] start time [ text ] end time [text] Day 3 date: [ text ] start time [ text ] end time [text]
This is where you could use indexed or mapped properties. http://struts.apache.org/1.x/struts-taglib/indexedprops.html And as for generating this form.. Dont think you need full fledged AJAX.. DHTML javscript to generate the fields would do.Basically what your indexd or mapped properties would do is allow you to use an ArrayList or HashMap so that you dont need to initialize the number of elements that you expect to recieve. Why? because it is conceivable for an event to have different starting and
ending times for each day. Where I keep running into issues is how to "initialize" the nested form bean such that I have an array of 3 days (EventDate objects in my setup) between the two forms. I'm probably overlooking something rather basic here, but then I've only been playing around in Struts for just under a year... Any help, pointers, pointers to web pages or whatever will be greatly appreciated. - -- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Peter L. Berghold [EMAIL PROTECTED] "Those who fail to learn from history are condemned to repeat it." AIM: redcowdawg Yahoo IM: blue_cowdawg ICQ: 11455958 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFFL9ftUM9/01RIhaARAsNcAJ9AblUb96Y1y2/0Y+Zm5bU8THyP2QCgya2s Tu8qIuoJm1WqNFKhj8Z79OI= =QBwR -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Puneet. Hab viel Spass.