J
Jean Lutrin
Hi everybody,
I have a Webapp where every request (even the welcome page) goes
through a controller servlet. Then some processing is done, mainly
creating beans that the jsp pages use. The "view" is really completely
decoupled from the logic (I am not the one doing the layout of this
site, btw... There's a "web designer" doing that. The guy is good, but
the problem is he's an artist, with not a single programming skill).
On one of the jsp page, there is a FORM that can later be POSTed by
the user when he clicks the Submit button (quite typical uh
This FORM is almost totally generated by the jsp, using 'for' loops.
Say my company is selling three kind of items : cubes, pyramids and spheres
(whatever) in different colors at various size and price.
What I want to do is allow the potential consumer to search through the items
currently available.
So, for example, they have a drop-down (option) list showing :
-Spheres (<option value="spheres">Spheres</option>)
-Cubes (<option value="cubes">Cubes</option>)
-Pyramids (<option value="pyramids">Pyramids</option>)
-Any (default selected choice) (<option value="any" selected>Any</option>)
and, for the colors, they have :
-Red
-Green
-Blue
-Yellow
also in a selectable drop-down list.
This is working fine, and all those "hmtl post options" are automatically
generated by the jsp.
If the user sets no restricting criteria and starts the search, I return a
page showing a thumbnail of every items in stock (well, design is more
complicated than that, because there are actually *many* items and they
definetely dont fit on one page... but our app takes care of this and
cache everything nicely etc.).
Now, what I want to do is this : if a user select "Pyramids", then only
the colors available for the pyramids item appears in the colors drop-down
list. If, say, the company sells only red and green pyramids, I want
the drop-down list to show only those two choices...
But these are not "fixed choices" : one week we may only have red and
green pyramids, but another week we may only have blue and yellow ones...
So I need the choices being restricted accordingly to our items in store.
This involves a partial client-side solution, like Javascript (I really don't
know much about Javascript, and I know this is not the right newsgroup
So how should I proceed ?
I don't want to add "kludge" to the nice design in place. This is nothing
urgent : it's just one those "wouldn't it be nice if..." things that
someone here proposed. Everything's working fine without that but it
would really be a little extra for everybody (maybe for my salary too
if
you could point me to a clean solution to this problem.
Thanks in advance and sorry for the long post,
Jean
I have a Webapp where every request (even the welcome page) goes
through a controller servlet. Then some processing is done, mainly
creating beans that the jsp pages use. The "view" is really completely
decoupled from the logic (I am not the one doing the layout of this
site, btw... There's a "web designer" doing that. The guy is good, but
the problem is he's an artist, with not a single programming skill).
On one of the jsp page, there is a FORM that can later be POSTed by
the user when he clicks the Submit button (quite typical uh
This FORM is almost totally generated by the jsp, using 'for' loops.
Say my company is selling three kind of items : cubes, pyramids and spheres
(whatever) in different colors at various size and price.
What I want to do is allow the potential consumer to search through the items
currently available.
So, for example, they have a drop-down (option) list showing :
-Spheres (<option value="spheres">Spheres</option>)
-Cubes (<option value="cubes">Cubes</option>)
-Pyramids (<option value="pyramids">Pyramids</option>)
-Any (default selected choice) (<option value="any" selected>Any</option>)
and, for the colors, they have :
-Red
-Green
-Blue
-Yellow
also in a selectable drop-down list.
This is working fine, and all those "hmtl post options" are automatically
generated by the jsp.
If the user sets no restricting criteria and starts the search, I return a
page showing a thumbnail of every items in stock (well, design is more
complicated than that, because there are actually *many* items and they
definetely dont fit on one page... but our app takes care of this and
cache everything nicely etc.).
Now, what I want to do is this : if a user select "Pyramids", then only
the colors available for the pyramids item appears in the colors drop-down
list. If, say, the company sells only red and green pyramids, I want
the drop-down list to show only those two choices...
But these are not "fixed choices" : one week we may only have red and
green pyramids, but another week we may only have blue and yellow ones...
So I need the choices being restricted accordingly to our items in store.
This involves a partial client-side solution, like Javascript (I really don't
know much about Javascript, and I know this is not the right newsgroup
So how should I proceed ?
I don't want to add "kludge" to the nice design in place. This is nothing
urgent : it's just one those "wouldn't it be nice if..." things that
someone here proposed. Everything's working fine without that but it
would really be a little extra for everybody (maybe for my salary too
you could point me to a clean solution to this problem.
Thanks in advance and sorry for the long post,
Jean