• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TextBox enable and disable

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:tableLayout>

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

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

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

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

</trh:tableLayout>
 
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic