I try to reload a form with filled data using getUserState. I have read this document many times but I haven't understand where in my view o model I should set the userStatae . I know I should getuserState in my model with some thing like this.
$mainframe =JFactory::getApplication();
$stateVar = $mainframe->getUserState( "option.state_variable", 'state1' );
Can some one help me about where to setuserState and how I pass getUserState value to my layout?