Thursday, March 11, 2010

A Trick in JSF Event Handling

The following is a samle event handler.
public void somethingChanged(ValueChangeEvent e)
  {
    PhaseId phaseId = e.getPhaseId();
    if (phaseId.equals(PhaseId.ANY_PHASE))
    {
      e.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
      e.queue();
    }
    else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES))
    {
      // some processing code here
    }
  }

No comments:

Post a Comment