incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <Martin.K...@aura.cz>
Subject Re: setLocalValueSet never called for true???
Date Wed, 31 May 2006 22:36:33 GMT
This changed code works ok :
      setSubmittedValue(null);
      if (compareValues(previous, newValue))
      {
        setValue(newValue);
        setLocalValueSet(true); // explicit calling setLocalValueSet
        queueEvent(new ValueChangeEvent(this, previous, newValue));
      }



Martin Koci píše v Čt 01. 06. 2006 v 00:29 +0200:
> I have problems with selectOrderShuttle - it was working with build
> donated with you and Oracle to apache (packages oracle.*) but now it
> stops. 
> 
> > The difference between the two is that the way the code
> > used to be, updateModel() would get called even when
> > there was no ValueChangeEvent, which was undesirable.
> > Now, updateModel() will only happen when the value
> > actually changes.  That should be a good thing;  is
> > this causing problems in your code?  Do you not see
> > updateModel() executing properly when the value has
> > actually changed?
> 
> Yes, I select more items or reorder them , values are correctly
> submitted and validated but update model phase doesn't call
> 
>       Object localValue = getLocalValue();
>       binding.setValue(context, localValue);
> 
> because isLocalValueSet returns false;
> 
> 
> 
> > 
> > -- Adam
> > 
> > 
> > On 5/31/06, Martin Koci <Martin.Koci@aura.cz> wrote:
> > > Hello,
> > >
> > > I have strange problems with latest build from svn - update model phase
> > > on components is called but canceled after first steps because
> > > isLocalValueSet() return always false!
> > >
> > > public void updateModel(FacesContext context)
> > >   {
> > >     if (context == null)
> > >       throw new NullPointerException();
> > >
> > >     if (!isValid() || !isLocalValueSet()) <<-- always return false
> > >       return;
> > >
> > > I found in UIXEditableValue:
> > >
> > >     // If our value is valid, store the new value, erase the
> > >     // "submitted" value, and emit a ValueChangeEvent if appropriate
> > >     if (isValid())
> > >     {
> > >       Object previous = getValue();
> > >       setSubmittedValue(null);
> > >       if (compareValues(previous, newValue))
> > >       {
> > >         setValue(newValue);   <<<<<<< ------- setValue
only if no
> > > change?
> > >         queueEvent(new ValueChangeEvent(this, previous, newValue));
> > >       }
> > >     }
> > >
> > > I think it should be:
> > >
> > >   // If our value is valid, store the new value, erase the
> > >     // "submitted" value, and emit a ValueChangeEvent if appropriate
> > >     if (isValid())
> > >     {
> > >       Object previous = getValue();
> > >       setSubmittedValue(null);
> > >       setValue(newValue);
> > >       if (compareValues(previous, newValue))
> > >       {
> > >          queueEvent(new ValueChangeEvent(this, previous, newValue));
> > >       }
> > >     }
> > >
> > >
> > 
> 
> 


Mime
View raw message