• 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

How to do a page wizad ???

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I appreciate your time and helps,

I have 8 pages, each one has a form, the user has to fill up :
Page1(form1 ,Next) --> Page2(form2 ,Next,Prvious)-->Page3(form3 Next,Previous)
......-->Page8(form8 ,Previous)

each form has a data that will be stored in a table.

Please I want to learn from you on how to do it .

Thank you
 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when ever I have to collect data over multiple pages, I create a "container object". Something I can fill as I go and store in my session.

Let's say you are collecting member data.
create a class called Member. Add the needed properties - firstName, lastName, phone, email...

That's all you'd need. No need for any methods (other than getters and setters if your properties are private) unless you want some utility methods that clear the data or validate the data.

When you click �Next� in the wizard, you actually submit to an action class. That action class grabs the �container� from the session, fills it with the additional data that was just submitted, then puts the �container� back in the session.

you repeat the process for each page you have.

At the end of your wizard, your object will be filled and ready to process. It also gives you the ability to summarize all the data that was entered on one screen.

make sense?
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
yes It make sense,

BUT we have two problems here :
1) the session will be too big.
2) each data will go to a different table.

Thanks
 
Chris Montgomery
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since I don�t know the data you are collecting, I still think most of your session data can be housed in the session.

It sounds like you have organized your wizard so that each screen fills a unique table. Yes?

If it�s easier, create a �container object� for each page of your wizard. Then store each object as it�s very own session variable

Store the large pieces of data in a database table and use the auto generated sessionId as your unique id. Then clean the data when you're done.

When you submit the completed wizard, assemble the data from both your session and the database table and process them as one.

I also would need to know more about what you�re doing to understand why filling multiple tables is an issue. If you are using a transaction, it shouldn�t matter:

Check out the JDBC forum if you aren�t sure how to do this.
reply
    Bookmark Topic Watch Topic
  • New Topic