Radio button default value on refresh

Hi All,

I have a view with a radio button group.

Every time the view is refreshed, I want the first radio button to be selected by default.

Do you have an idea how this can be achieved?

You can just change the field the the radio button group control’s value property is bound to right before the view is rendered.

For example, override the preRenderResponse method of your page bean with something like this:


	//some field bound to the radio button group controls value property
	private String radioGroupValue = "one";
	
	/* (non-Javadoc)
	 * @see com.webmethods.caf.faces.bean.BaseViewBean#preRenderResponse(javax.faces.event.PreRenderViewEvent)
	 */
	@Override
	public void preRenderResponse(PreRenderViewEvent e) {
		//TODO: set the field bound to your radio button group here
		radioGroupValue = "two";
				
		super.preRenderResponse(e);
	}