Mike,
I found the following. Does it look reasonable?

  public void changeState(ValueChangeEvent event)
  {
    PhaseId phaseId = event.getPhaseId();
    if (phaseId.equals(PhaseId.ANY_PHASE))
    {
      event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
      event.queue();
    }
    else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES))
    {
      // correct phase update local variables for the new class Number
      String newValue = (String) event.getNewValue();
      if ("NY".equals(newValue))
      {
        setCity("Albany");
      }
    }
  }


Should I write this up in the wiki?

Paul Spencer

Mike Kienenberger wrote:
http://myfaces.apache.org/sandbox/tlddoc/s/valueChangeNotifier.html

I've never used it as
t:updateActionListener/f:setPropertyActionListener has always worked
in my own use cases.

On 4/13/07, Paul Spencer <[EMAIL PROTECTED]> wrote:
I have a bean with 2 fields, state and city, with a valueChangeListener
on the state field.  The listener will set the city based on new new
state.  The problem is the city is being overwritten in the model update
phase.  So my question is:

   What is the best way to update another field inside a
   valueChangeListener so the updated value is not overwritten?

Paul Spencer



Reply via email to