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 how to make a text box readonly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to make a text box readonly" Watch "how to make a text box readonly" New topic
Author

how to make a text box readonly

Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
i am developing an application in struts 1.x

i want to declare one o textbox as readonly & to fix a value in it like this


if i update to

then my textbox is not readonly

please help me

thank you
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
if i print the value of id then its correct according to my table
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1448
    
    6

Does this help?


Swastik
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
thank you for your reply but i have found another method to display it

but still i would like to ell you that in struts it will give an error
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1448
    
    6

Aditi,

Could you please clarify, why it will give error? Because if it allows you to write scriplets, whats wrong in using a java method inside that?
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
sure swastik
i can explain you uptil where i understand


i think struts tag library donot accept the default value which we have specified in my first post for this problem only i have mentioned the root cause error

please check it

thank you
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1448
    
    6

Thanks Aditi, I don't know much about struts, but if it does not accept default values, then how come this was working in your case
value=""
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1448
    
    6

I don't this anything is wrong with the setValue method, it does exist, only thing is it is expecting a String, not an int. So my logic should have worked as well.

You may wish to go through the api doc.

http://struts.apache.org/1.0.2/api/org/apache/struts/taglib/html/BaseInputTag.html#value
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
hey thanks swastik

for the reply might be that is the reason you have specified for my form not taking the default value

thanks

mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69

are you successful in your readonly textbox ? if not then try this one readonly="true"
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
thanks for your reply but this is also not working i have tried it alreay

thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make a text box readonly
 
Similar Threads
No tag "form" defined in tag library imported with prefix "html"
doubt regarding <html:select>
File "/tags/struts-bean" not found
HTTP Status 500 -org.apache.jasper.JasperException: /Success.jsp(35,52) quote symbol expected
Unable to display the Data from SQL SERVER 2005 on a JSP through <c:forEach> tags