| Author |
textbox values with dynamic datas with struts
|
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
I need a textbox where it has to show a value from a database.. Assume I have a td like below, <html:iterator value="list" > <tr> <td width="75" height="10" > <html:property value="name" /> </td> </tr> </html:iterator> In above "name" is the value which comes from the "list" from action.. So i wanted to make that field a textbox with this dynamic values.. Please adivse..
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
Hi there, This question is best off in the Struts forum, hopefully a moderator will move it shortly. In 'straight' JSP you'd simply declare an <input type="text"> and have the value for each input field set by iterating over the list.
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
Tom Rispoli
Ranch Hand
Joined: Aug 29, 2008
Posts: 349
|
|
|
The names of the tags you are using look like struts2 tags but it looks like you're trying to get them from the html tld which is a struts1 tld (unless you've renamed the tld some how or these are struts 1.3 tags that I'm not familiar with). If you you're using struts2 just change the html: in you tags to s:. Other than that it looks correct to me.
|
 |
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
I beleive html: is nothing but the prefic for the tags.. I have defined the prefix as html: instead og s:.. Will that make a difference
|
 |
Tom Rispoli
Ranch Hand
Joined: Aug 29, 2008
Posts: 349
|
|
Nope, that should work correctly if you have something like this in your jsp If thats the case it looks correct at first glance. Are you getting an error?
|
 |
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
No I am not getting any error ... but it doesnt proceed next to this line and shows the old values itself... Say <td><html:textfield name="name" size="5"value="<html roperty value="name"/>" /> </td> "Hello" It never comes to string "Hello" in the page. When I use html tag it works, <td><input type="text" size="5"value="<html roperty value="name"/>" /></td> any suggestions please
|
 |
 |
|
|
subject: textbox values with dynamic datas with struts
|
|
|