users@javaserverfaces.java.net

JAVASERVERFACES-2972

From: Alex Landini <alex.landini_at_gmail.com>
Date: Wed, 21 Aug 2013 14:11:54 +0200

Hi all,



The case described in the issue used to work in JSF 1.2, but with JSF 2.x
doesn’t.



The behavior I would like to get is:



     - On page rendering the value is set inside the UIComponent:



*public* *void* setInputHidden(UIInput inputHidden) {

*this*.inputHidden = inputHidden;



*if* (item != *null*) {

       *this*.inputHidden.setValue(item);

}

}



The method above is called by JSF, which injects inputHidden.

Item is not null only the first time the page is rendered, in order to set
the component initial value.



2) - The component value is saved in the view state, so on post back I
can retrieve it with:

inputHidden.getValue()

But now on post back the component value is null.



I would like to know how I can make the code works for jsf 2.1, is there
some hack?



I attached the example.



Thanks in advance for the help.

Alex Landini