On Saturday, November 20, 2010 01:16:22 pm Jacek Kałucki wrote:
> Użytkownik John Fabiani napisał:
> > Hi,
> > 
> > I'm trying to create a wiki entry on how to dynamicly change the Choices
> > and Keys values of a dropdown.
> > 
> > I created a form that contains a textbox, a subclassed dropdownlist, and
> > a button.  I'd post the code but currently I'm using postgres for the
> > data to prove everything works.  So I doubt it would be much help.
> > 
> > In this case I'm using the value in a textbox to change the Choices of a
> > dropdown list.  I bind the InteractiveChange of the textbox to a method
> > that calls the dropdown update().  This works very well when I make
> > changes to the textbox value the dropdown.update() changes the Choices,
> > and Keys.
> > 
> > IOWs my subclass of dDropdownList calls a method that uses the value in
> > the textbox to get and set the Choices, and Keys.
> > 
> > My issue appears if I attempt to use the Form.cancel()  to revert back to
> > the old value of the textbox.  I use a button to call the cancel
> > routine.  It appears the dropdown.update() is called before the old
> > value of the textbox is established in the control.
> > 
> > I've tried several ways to force the correct value into the textbox prior
> > to calling my dropdown.update() method without success.
> 
> Hi.
> 
> Try this patch:
> 
> --- dDataControlMixin.py    (revision 6195)
> +++ dDataControlMixin.py    (working copy)
> @@ -81,7 +81,7 @@
>                       nm = self._name
>                       dabo.log.error(_("Could not set value of %(nm)s to
> %(val)s. Error message: %(e)s")
>                               % locals())
> -            self.flushValue()
> +            self._afterValueChanged()
>           else:
>               self._properties["Value"] = val

Thanks for the code - I'll test sometime in the future.  It was raining here 
on Sat and I thought I'd do something for the cause.  But now I have to get 
the honey do's done.

Johnf
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to