2008/4/23, Ed Leafe <[EMAIL PROTECTED]>:
> On Apr 23, 2008, at 7:41 AM, Karsten Weinert wrote:
>
> > In the minimal example below I can teach my form
> > to display this optional info, but by default, if I enter new optional
> > info, and move
> > forward and back through the masters dataset, the entered
> > information is lost.
>
>
> You are most likely "losing" the data because you are not linking the
> child to the parent. By setting up the child to automatically be added
> and the parent link filled, you should avoid this.
The tables are linked:
details.LinkField = "master_fk"
details.NewRecordOnNewParent = False
details.FillLinkFromParent = True
master.NewChildOnNew = False
master.addChild(details)
The data is "saved" (into the dataset), however, if I first move the focus from
the optional info textbox to any other control (thus triggering the
onValueChanged handler) and press then the "next" button.
It is not saved, if I enter something in the optional info textbox and
hit "next" directly.
>
> You can then set up some code in your child's beforeSave() method to
> check for non-empty values, and if none are found, issue a
> self.cancel() to remove the empty record.
>
This is a real clever technique, thank you. Can you advise me where to
call new on the child bizobj? As I tried to explain above, the
onValueChanged handler seems not to be appropriate. Setting
NewChildOnNew / NewRecordOnNewParent to True would not help in all
cases, as it may occur that a given parent row has no child.
Kind regards,
Karsten.
_______________________________________________
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]