wood burning stoves 2.0*
The moose likes JSF and the fly likes TextBox enable and disable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "TextBox enable and disable" Watch "TextBox enable and disable" New topic

TextBox enable and disable

Arup choudhury

Joined: May 30, 2012
Posts: 1
I have one JSF Page. In this page two text fields are there. Initially they are set disabled. If I double click on those fields they become enabled. Can anyone tell me how to do this in JSF or using Javascript. I am sending my code. Early response requested.


<trh:cellFormat valign="middle" styleClass="tdbg">
<trutputText value="Proposer First Name"/>
<tr:inputText value="#{backing_ProposalUpdateForm.proposerFirstName}" id="proposerFirstName" maximumLength="50" />

<trh:rowLayout><tr:spacer height="5"/></trh:rowLayout>

<trh:cellFormat valign="middle" styleClass="tdbg">
<trutputText value="Proposer Last Name"/>
<tr:inputText value="#{backing_ProposalUpdateForm.proposerLastName}" id="proposerLastName" maximumLength="50" />

<trh:rowLayout><tr:spacer height="5"/></trh:rowLayout>

Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

You can use EL tags to set the enabled attribute for the inputText controls from false to true, but why do that through a double click event? You'd probably be better off using some other control, like a checkBox, in a component library that uses AJAX to enable those fields. In any case you'll probably have to override part of the JSF life cycle to accomplish what you're trying to do.
It is sorta covered in the JavaRanch Style Guide.
subject: TextBox enable and disable
Similar Threads
java.lang.IllegalStateException at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType
Partial page refresh during page onload
Polish characters are gets changed to ? in websphere6.1 environment
ValueChangeEvent fires for every datatable changed value, cannot reset.
tr:commandButton actionListener not invoking managed bean method