Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic html form

 
jyothi nalam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • 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: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic