Alex, Sorry, I don't have any related examples and don't know how to do it. I guess you may need a jquery dialog and a while loop, which continue to run until the dialog return "No".
Mark On Monday, March 18, 2013 11:01:27 AM UTC-4, Alex Glaros wrote: > > It worked. Thanks Mark. > > Can you provide a link to any examples where user has the ability to enter > a variable number of children? I mean once they type in the parent and one > child, something like a prompt is displayed asking "do you want to add > another child record?". This would let them enter as many children as they > want, while having entered the parent data only once. > > thanks, > > Alex > > > > On Monday, March 18, 2013 6:47:45 AM UTC-7, Mark wrote: >> >> try form.vars.sharedServiceID=sharedServiceID >> >> On Sunday, March 17, 2013 3:13:58 AM UTC-4, Alex Glaros wrote: >>> >>> I'm trying to automatically populate child FK field "sharedServiceID" >>> using the controller below, but the field gets filled with "none" >>> >>> Do you see any flaw in the controller format below? >>> >>> Thanks, >>> >>> Alex Glaros >>> >>> >>> >>> PARENT TABLE >>> >>> db.define_table('SharedService', >>> Field('shortSharedServiceTitle', 'string', label='Title')) >>> ##------------------------ >>> >>> CHILD TABLE >>> >>> db.define_table('SharedServicePartnerIntersection', >>> Field('*sharedServiceID*', 'reference SharedService', >>> writable=False,readable=False), >>> >>> ##------------------------ >>> db.SharedServicePartnerIntersection.sharedServiceID.requires = >>> IS_IN_DB(db, db.SharedService.id, >>> '%(shortSharedServiceTitle)s',zero=T('choose one')) >>> db.SharedServicePartnerIntersection['_plural'] = 'Partner List' >>> >>> CONTROLLER >>> >>> def add_partner(): >>> >>> form=SQLFORM.factory(db.SharedService,db.SharedServicePartnerIntersection) >>> if form.process().accepted: >>> *sharedServiceID* = >>> db.SharedService.insert(**db.SharedService._filter_fields(form.vars)) >>> form.vars.SharedService=*sharedServiceID* >>> >>> db.SharedServicePartnerIntersection.insert(**db.SharedServicePartnerIntersection._filter_fields(form.vars)) >>> response.flash='Thanks for adding a shared service partner' >>> return dict(form=form) >>> >>> also tried this >>> >>> def add_partner(): >>> >>> form=SQLFORM.factory(db.SharedService,db.SharedServicePartnerIntersection) >>> if form.process().accepted: >>> sharedServiceID = >>> db.SharedService.insert(**db.SharedService._filter_fields(form.vars)) >>> form.vars.SharedService=sharedServiceID >>> *sharedServiceID = * >>> db.SharedServicePartnerIntersection.insert(**db.SharedServicePartnerIntersection._filter_fields(form.vars)) >>> response.flash='Thanks for adding a shared service partner' >>> return dict(form=form) >>> >>> -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.