• 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

advice on design is needed

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys!
For last two days I am trying to figure out how to implement one functionallity in struts. It would be great if you could help me out just a little bit.
I need to fill out protocol form. There are some easy fields such as title, version, authors etc. Those fit in a single page.
What troubles me is the protocol's body.
To support at least minimal formatting I decided to divide the body into
'subtitle' and 'subbody' pairs. There are theoretically should be no limits to how many of those will be in a protocol. This part can go on multiple pages.
The idea is that the user fills first page (title, authors etc), press 'continue' button and 'subtitle-subbody' textarea appears. After filling those out the user has two possibilities: by pressing 'continue' button he/she is getting next 'subtitle-subbody' page, by pressing 'Save', he/she submits this form and it goes to db in xml format so that when i want to present the protocol, i have hooks for necessary formatting.
I can't formulate the design clearly. I understand that I need one underlying bean that will be filled from the form and sent to the db. But how many forms should i have:
1. Should 'subtitle-subbody' section be as a separate form? So that I do not have limits on how many times the user pressess 'continue' button.
2. Or should i have one big form, but how i can implement unboundness of 'subtitle-subbody' part?
3. Probably in lights of having at least two diff. buttons i need LookupDispatchAction?
Any advice will be greatly appreciated.
The thing is that i have no experience and nobody to ask to. I was thinking that maybe there is just more or less tested and routine way of doing such things. I'm afraid that anything i come up with may be clumsy and amateurish.
:roll:
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds to me like the subtitle-subbody portions need to be backed by an indexed property. See these links: http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=struts+indexed+properties for more info
 
Svetlana Koshkina
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure, it is not a problem, although it cannot be done in a form bean.
I looked at some suggestions on the web. It is said that it's better to have single form bean on multiple pages, but then i have to make fixed quantity of subtitle-subbody, and in order it is being sufficient most of the times it have to be fairly big, say 15-20. DynaForms are better, but still, you have to declare them in struts-config.
I decided to split form on general part and sub-part. Sub-part will be indexed in backing bean. I see that i will be able to traverse the bean easily back and forth by keeping track of the views.
:-)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic