动态创建Form

 1 static void CreateFieldMethod(Args _args)
 2 {
 3     TreeNode       tn1, tnAddr, methodsNode;
 4     MemberFunction memberFunction;
 5     str            source;
 6     ;
 7  
 8     tn1         = infolog.findNode("\\Forms\\Address\\Data Sources\\Address\\Fields\\AddrRecId");
 9     tnAddr      = infolog.findNode( "\\Forms\\Address" );
10     methodsNode = tn1.AOTfindChild( 'Methods' );
11     methodsNode.AOTadd('lookup');
12     memberFunction = methodsNode.AOTfindChild( 'lookup' );
13     source = @"public void lookup(FormControl _formControl, str _filterStr)
14     {
15       super(_formControl, _filterStr);
16     }" ;
17     memberFunction.AOTsetSource(source, false);
18     memberFunction.AOTsave();
19     methodsNode.AOTsave();
20     tnAddr.AOTcompile();
21 }
posted @ 2012-08-30 11:30  Sprite.z  Views(152)  Comments(0Edit  收藏  举报