On Apr 29, 2007, at 3:43 PM, [EMAIL PROTECTED] wrote:

> * Creating a toolbar:
> I've shamelessly ripped some code of the datanav subframework to  
> create a toolbar :-). I've used the form.afterInit method to create  
> it. I wonder if this is the best place to do it, or if there is  
> another place that makes more sense to put UI creation/changing code?

        As long as that works, there should be no problem.

> * onNew:
> I'm looking for a way to create a new record depending on which  
> page is Showing on a PageFrame. One as a list of books another as a  
> list of authors. Both lists have a RegID and both are associated to  
> bizObjs. Because I want to do this from the toolbar, I'm thinking  
> to override the form's onNew method, but am not sure how to test  
> for the current selected page and how to use the onNew method. In  
> pseudo-code:
>
> def onNew(self, evt):
>     if self.pgBookLst.Shown:
>         getBizobj('book').new()
>     elif self.pgAuthorLst.Shown:
>         getBizobj('author').new()

        Use the pageframe's SelectedPage property to determine which page is  
shown.

> Because the bookBizobj is the form's primary bizObj I wonder if I  
> could just return True or somehow evt.Skip() to let the default  
> behaviour of record creation take place for the case where  
> pgBookLst is visible?

        While that might work, it's better to be explicit than implicit.

> * onSave:
> Up until now I've managed to create a record, but haven't figured  
> out how to save it. dabo asks me to commit the record uppon  
> aplication close. But I really would like to figure out how to do  
> it automatically (sometimes we don't want user confirmation) and  
> also how to have a Save button.

        The form's save() method will save the current bizobj's changes. You  
can also use save("author") to save changes to the author bizobj.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
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/dabo-users/[EMAIL PROTECTED]

Reply via email to