Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disable a text field after it's first use.. JSP + Struts

843840Sep 3 2008
Hi,

In my code I have a jsp page, with text fields, buttons and a list box, myDetails.jsp, the information entered here is all
read/verified in ProcessMyDetailsAction.java. (I am also using Struts)

If the list box is populated, I want one of the text fields to be grayed out.(disabled or readonly)
(ie, after the first batch on info is entered, the details are displayed in the list box and the fields are empty, so more information can be entered, but I want the date textfield to be disabled, as I don't want to allow the user to change the date.)

I have a boolean variable set up in my java code, which is set to true if the list box is not empty,
and I am trying to read it on the jsp page to set the text field disabled property to true or false

here is the code i am using:
myDetails.jsp

<html:text name="myDetailsActionForm" maxlength="3" size="3" property="myDetails.textBox" styleId="TxBox" dsabled="#{ProcessMyDetailsAction.listBoxPopulated}" />


ProcessMyDetailsAction. is my Java class and
listBoxPopulated is my boolean variable, which gets set to true.

If anyone has any suggestions, I would be greatful..

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 1 2008
Added on Sep 3 2008
0 comments
174 views