• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question on struts page design

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am a newbie to struts. I have something like this:
-2 dropdown lists:
college:[college list]
school:[school list]
-search results: once college and its scholl are selected, its departments will be displayed at the bottom of the page. The results may displyed across sevaral pages if number of depts is huge, users can
get more results using next/previous links.

How should I design this page? Should I use frames, or use tables to do
this? As for two dropdown lists (criteria), shouls I write oneactionForm or two?
Thanks,
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Guys:
I really need your insights on this. Do you think it will be nice to choose frames to do the job? I am not very clear about the struts tags, if I have two dropdown lists as stated above, do I need two actionForms to achieve what needs to be done? One html:form corresponds to one actionForm, right? I am
so eager to know these basics.
Thanks,
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
just create one form class which contains two collections. One for schools and one for the other. Then use the tags
<html:select ....>
<html ptions ..../>
</html:select>
To use these options tag you must insert a LabelValueBean into the collection (when you use
Struts 1.1 there should be one included).
Then you just need a single form. And if you need this selection on different pages you can also think about putting the form into the session.
Hope that helped
Oliver
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much, Oliver,
I am just very new to this. So, how do I use these two collections in my JSP page? Just do something like the following twice? As for labelValueBean, any sample I can follow?
regards,

Originally posted by Oliver Refle:
Hi,
just create one form class which contains two collections. One for schools and one for the other. Then use the tags
<html:select ....>
<html ptions ..../>
</html:select>
To use these options tag you must insert a LabelValueBean into the collection (when you use
Struts 1.1 there should be one included).
Then you just need a single form. And if you need this selection on different pages you can also think about putting the form into the session.
Hope that helped
Oliver

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rick: I had a similar problem recently.. but I've found that one has better luck if you separate "design" type questions away from "implementation" type questions. (i.e. how to design such a thing is a very different sort of beast than the actual mechanics of doing it with forms or valuebeans).
Having said that, I had a similar problem recently.. and took the approach of a single form with the collections as Oliver was suggesting. But in my case rather than using forms, the other option was to use a "open in another window" (i.e. the results of my query were going to be used as in put in another form, and people didn't want to track "back" to that form once they found what they've looked up -- so opening the query page in a separate window worked better). So that's another option.
For your case, you have to have a single form that displays the collection dispatches to an action that does the query, and populates a result set in the form. If you use the pager or display tags, then you'll be able to automatically paginate the result set. See.
<a href= "http://jsptags.com/tags/navigation/pager/pager-taglib-2.0.html">Pager</a>
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, Sundar:
The idea of using pager is cool, I will look into it closely. Thanks.
 
I want my playground back. Here, I'll give you this tiny ad for it:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic