Consider following scenario.
Have a page with some persistent object obj
:
public class SomePage {
@Persistent
@Property
SomeBean obj;
@Property
@PageActivationContext
private SomeActivation actObj;
...
void onValidateFromForm() { ... }
}
This obj
is edited on a page:
<t:textfield t:id="value" t:value="obj.value"/>
Lets consider initialization procedure of obj
state like this:
(*) obj.value = actObj.value;
(I strongly need to unbind value
from actObj
, please don't ask why).
Have also a validation method. When validation fails, I'd like to show errors list on page and keep also all values, which user filled on form and which were stored into obj
.
So:
- when page firstly initialized with specific
actObj
I'd like to initializeobj
- when page validation fails, I don't want to reinitialize
obj
, because I want to keep its values and show them user with errors list.
The question is: where I should place initialization block (*) ?