I'm learning to work with the datanav.
I'm modifying one of the CRUDs created by the AppWizard. My file has a foreign key that I wish the user to see as a drop down list, so I change the input control to a dDropdownList with ValueMode='Key'. I would usually set right there the Choices and Keys, and get done with it. But this control must be different, if a value has already been referenced by a foreign key in some other row of the actual table it must not appear in the drop down, unless it is the value that is being referenced in the actual row. To make it easier to understand, the Choices and Keys of the drop down list must come from the following : crs.execute("""select Id, trim(Nombre||" "||Apellido) as FullName
                                    from persona
where Id not in (select PersonaId from proveedor)
                                            or Id = ?
order by FullName""", (self.Record.Id , ))
where self.Record.Id is the actual row.

I have everything set and working but I am not being able to place Choices and Keys assignment in a proper place. I've tried binding the RowNumChanged event to the method that sets the Choices and Keys, but this event occurs AFTER the controls are updated, so when I move the pointer I get a value error when the framework tries to set the drop down's Value to a foreign key that does not exist the actual choices (the choices appropriate for the previous record). I've also tried binding the drop down's Update event to this method with the same results.
Has anybody done something similar? Any suggestions?



--- StripMime Report -- processed MIME parts ---
multipart/alternative
 text/plain (text body -- kept)
 text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/528fde87.7070...@gmail.com

Reply via email to