package various;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

public class TestingParameters {
	private int counter;

	public int getCounter() {
		return counter;
	}

	public void setCounter(int counter) {
		this.counter = counter;
	}

	public void increaseWithParam(ActionEvent event) {
		counter = Integer.parseInt(FacesContext.getCurrentInstance()
				.getExternalContext().getRequestParameterMap().get("counter"));
		counter++;

	}

	public void increaseWithAttribute(ActionEvent event) {
		UIComponent component = event.getComponent();
		counter = (Integer) component.getAttributes().get("counter");
		counter++;

	}
}
