On Dec 11, 2010, at 5:42 PM, Carey Gagnon wrote:
> Open the pycon hours turtorial app. Select any record. Now start changing
> info in any of the form fields and click save. All information is saved
> correctly and the grid is updated accordingly except the client field.
>
> How do you get the client field in the grid to update without doing a
> requery on the entire dataset?
What is being edited when you change the client is the foreign key
related to client. That value is important to the database, but not to humans
using the system, so we do a join to grab the related client name for display.
When we change the value of clientfk, we need to update the name in the
bizobj so the grid's data is current. In my copy of the code (guess I haven't
updated the tutorial with it yet) I have a method in the form called
'updateClientName()'. It is called from the client dropdown's OnHit handler,
and also from afterSave(). The method looks like:
def updateClientName(self):
nm = self.ddClient.StringValue
self.PrimaryBizobj.setFieldVal("clientname", nm)
-- Ed Leafe
_______________________________________________
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]