Use case – User wants to retains value which has been selected even when there is a pagerefresh from broswer.
Step 1. Create one bean and put it in pageFlowScope.
Step 2. Create one attribute private String defaultValue.
Step 3. On valueChangeEvent of selectOneChoice call method retainValues()
Step 4. in RetainValues() write,
this.defaultValue = valueChangeEvent.getNewValue().toString();
Step 5. Assign pageFlowScope.bean.defaultValue to value attribute of selectOneChoice.
Step 6. You are done!!! Enjoy!