wood burning stoves 2.0*
The moose likes Struts and the fly likes dynamic html form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamic html form" Watch "dynamic html form" New topic
Author

dynamic html form

jyothi nalam
Greenhorn

Joined: Oct 25, 2006
Posts: 24
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

Joined: Feb 15, 2005
Posts: 4864
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
Consultant, Sima Solutions
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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

Joined: Feb 03, 2004
Posts: 456
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

Joined: Oct 25, 2006
Posts: 24
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

Joined: Feb 03, 2004
Posts: 456
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 ]
 
 
subject: dynamic html form
 
Similar Threads
Is it good to have MCAD.NET?
Why Scripting ?
Query regarding SCJP
JAVA's fame
EJBProxy or something similar