On Wed, Jul 12, 2000 at 12:13:50PM -0700, Jon Stevens wrote:
> > 1) I have a drop down list. The has several options (ie: contacts)
> > listed from about 200-300. These contacts (or options if we stick to
> > the abstract) are their most recently used/most frequently used ones.
> > Then there will also be an option in the list for Search. If the user
> > clicks on search it should open up a new 400x400 window with a search
> > form. Then the contact is passed back to original form and set. (is it
> > possible to add an option to a drop down list dynamically? Otherwise it
> > could be set in a hidden field) This same scenario could be played out
> > with an Input box and search button also. Now how would one do this in
> > a servlet?
This one of the scenarios I envisage a ScreenStack being useful for,
although that would work without the javascript - the option for Seach
links to an Action that pushes the current screen's state on the stack
and "calls" the search screen. That then puts the id of the chosen
contact - in your example - somewhere like the current webcontext, or
the user's temp hash table and pops the original screen state and
restores it.
I haven't progressed designing the ScreenStack yet - Daniel if you're
reading did you have any thoughts?
> > 2) Form Validator: When a user clicks submit this checks to verify that
> > all the fields are filled. There could be a FormValidator utility class
> > and you could do:
> >
> > FormValidator.addCheck(InputBox1);
> > FormValidator.addCheck(InputBox2);
> > FormValidator.addCheck(SelectBox, Check that it isn't option #1);
> > FormValidator.finalAction(goto page blah);
> > Submit.onClick(FormValidator.Execute);
> >
> > This could be very useful. I have at least 20-30 places that this could
> > be used.
>
> Right, we already have this type of system with
> ParameterParser.setProperties(). You can stick your bean object into there
> to do the validation. There are also examples of the way that I'm doing in
> in Scarab...
I don't think Dan is talking about exactly the same thing. Jon, I think,
is referring to a pattern I use in Actions that goes:
MyObj obj = new MyObj();
data.getParameters().setProperties(obj);
obj.validate(data);
That way the Action is decoupled from the data. Jon does something
similar in Scarab by having the objects be able to populate and validate
themselves from the RunData object:
obj.populate(data);
I like my way because it's less typing in the business object :-) but
Jon's way is a bit less "magic", they're much of a muchness.
But both methods are validation once the form is submitted. I think Dan
is talking about auto-generating Javascript that validates the data
before the form is submitted. I think something like a webmacro context
tool that can do this would be cool - Dan, I have a fairly good sense of
how that Javascript goes, I've never actually implemented it. Do you
have a working example, then I could think about working up a context
tool that does it...
> > A dynamic JavaScript Generator
>
> huh? Simply use WM to do this.
But context tools that spit out whole little globules of Javascript
would be cool :-)
> > A new windowing framework (One that is swing-like)
>
> gag. This has already proven to not work well. SPFC is a dead project.
Indeed. Hugely elegant idea, a bitch in practice.
--
Sean Legassick
[EMAIL PROTECTED]
homo sum: humani nihil a me alienum puto
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]