Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

textbox values with dynamic datas with struts

 
rahulJ james
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic