Using basic-ajax2 example of jsf2.0 distribution (binary dist has several examples), I added component binding to class Echo for an HtmlInputText standard jsf component.
@ManagedBean(name = "echo")
@SessionScoped
public class Echo implements Serializable {
HtmlInputText inputTextBinding;
public HtmlInputText getInputTextBinding()
{
if (inputTextBinding!=null)
System.out.println(" bean="+this+" get inputTextBinding="+this.inputTextBinding+" id="+this.inputTextBinding.getValue());
else System.out.println("getter is null");
return inputTextBinding;
}
public void setInputTextBinding(HtmlInputText inputTextBinding)
{
this.inputTextBinding = inputTextBinding;
if (inputTextBinding !=null)
System.out.println(" bean="+this+" SET inputTextBinding="+this.inputTextBinding+" id="+this.inputTextBinding.getValue());
else System.out.println("it's null");
}
....
and modify the following in echo1.xhtml:-
Output: <h:outputText id="out1" value="#
{echo.str}"/>
<br/>
Input: <h:inputText id="in1" value="#{echo.str}
" binding="#
{echo.inputTextBinding}
"/>
You can then see that jsf2.0 in Session scope allows component binding when a full form submit is done. If using <f:ajax> tag, I wasn't able to get the component binding to return the correct value. If using View scope, a different instance of the bean is used each time so no component binding is returned to the backing bean. (just keep getting a new one).
Similar results when modifying the input Text example of component-showcase.
Also,
ICE-5219depends on this