Is there a way to use EL to get the current value of a field h: inputText?

advertisements

I'm new to JSF and EL, and was wondering if there is a way to use EL to get the current value of an h:inputText field. Am I doing it wrong, or is it possible at all?

Thanks, -Ben


(Based on your comment) If you want to validate it server-side then you should look at an Ajax library like Richfaces.

You can then easily add an ajax call to your input field

<h:inputText id="myInput" value="#{myBean.myValue}">
   <a4j:support event="onchange" ajaxSingle="true"/>
</h:inputText>

When you change the text the Ajax call will update your model on the Server-side. If you have a validator then you can add it to the inputText tag or use the action attribute on the support tag to call another method.