File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes textbox values with dynamic datas with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "textbox values with dynamic datas with struts" Watch "textbox values with dynamic datas with struts" New topic
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: 3274
    
    5

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: textbox values with dynamic datas with struts
 
Similar Threads
Help me about html:select
Textbox values from struts 2
Problem of insert data into database
values for select tag from the database
Iterator inside iterator