On Tuesday 11 June 2013 20:41:18 Med Hamza wrote:
> I tried
>
> Inside MainForm.onprocedure OnInitSubform(const sender: TObject; const
> asubform: twidget);
> var oTC:tcomponent;
>
> begin
> oTC:=asubform.findcomponent('activator'));
> If oTc <>nil then tactivator(oTC).active := true;
> end;
>
> same resultWhy do you place the activator component in the subform? A <tmsesqlquery>.controller.activator can only have a single reference to a tactivator instance. If the tmsesqlquery is in a datamodule which has been created before creation of the submodule, there will be an "unresolved reference" entry in the "NeedResolving" list. While creating the first subform instance the reference will be resolved and the "unresolved reference" entry deleted by GlobalFixupReferences". Destroying the subform destroys the activator and sets <tmsesqlquery>.controller.activator to nil. So the activator of next subform instance will have no clients. > > I planed to activate tdataset using a loop inside tactivator > > for i ..... to clients.count > tdataset(clients[i]).active := not(tdataset(clients[i])).active; > > what do you think > That is what tactivator internally does. Please place the tactivator component in a datamodule which will not be destroyed until program end and set thedatamodule.theactivator.active in thesubform.onloaded/ondestroy. I'll extend tififormlinkcomp in order to trigger the action in the datamodule without code in the subform. Martin ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ mseide-msegui-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

