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!

How to change a h:outputText value in the current form on key pressed event

801419Aug 21 2010 — edited Aug 21 2010
Hello Suners,

Greetings! I'm developing my first JSF web application and i'm trying to figure a way out to change outputText value when key pressed on another inputText so that when the user is typing his name for example he can see the letters showing respectively in the outputText.
I managed to do it onchange but the user must focus out of the inputText to see his name in the outputText which is not right and the form must submit onchange event which is annoying.
<h:inputText value="#{login.username}" title="name" id="name" required="true" onchange="this.form.submit()" >
                            <f:validateLength maximum="10" minimum="1"/>
                            <f:validator validatorId="myValidator"/>
                            <f:valueChangeListener type="classes.MyListener"/>
</h:inputText>
Is there any listener i can associate with the "onkeypress" attribute? Can anyone help me to do that with JSF?

King Regards,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2010
Added on Aug 21 2010
4 comments
480 views