• 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

dynamic html form

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I am working on a games project. the game has properties like name,cost,language and platform. i have few constraints that language need to be c ,c++ or java and platform windows or unix. if the property to be changed is language i want to generate a dropdown menu ,if cost to be changed, i want a text box to be generated.
Can we do this using html struts .

I hope i made myself clear.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jyothi t,

Once you've complied with the JavaRanch naming policy as Ben has already suggested to you, we may be able to help answer your question.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a little surprised that you're writing a game using Struts. Struts is best at form-submit type web applications, but I don't think it would be very good for a game. I guess one possibility would be to program the game as an applet, and then use Struts to do things like you're suggesting... setting options.

To answer your question, yes you definitely could have struts render different types of controls for different pieces of data. That could be done with no problem at all.
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i understood that jyothi is writing a web-app that stores and maintains data which itself represents games.

should that be the case, the scenario is the following:

you have a object (ActionForm) which represents the data you want to display on the jsp page. the jsp page itself can render input fields the way you want them.

so, you have to write html / jsp code that renders text input fiels as well as drop-downs.

nothing comes out-of-the-box, unfortunately.

jan
 
jyothi nalam
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jan

you are right. i want to store the properties in a database. i have a GamesForm(ActionForm). I am able to enter the info into database, what I want is i want to modify the database. for that, i want the user to select the game that he want to modify from the list of games present in the database . and also chose the property that he want to modify. when he submits the form after a selection, in the next form i want to display like if he chooses language, i want to display a dropdown box of languages . how is it possible.
Thanks.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

then it's on me to say that i did not completely understand your problem. if you are able to _write_ to the database through JSP / ActionForm / Action, but are unable to _update_: please post you concrete problem.

or do you mean that you have "external" data in the database but are unable to read / write / modify through the struts mechanism?

in this case i'd suggest that you work yourself a bit through the basics of struts first. there are many good tutorials out there (check the faq here in javaranch), and gain a basic understanding of struts.

please come back here whenever you have a concrete question.

jan
[ October 27, 2006: Message edited by: Jan Groth ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic