运行时创建form方法

static void CreateFieldMethod(Args _args)

    {

        TreeNode tn1,tnAddr, methodsNode;

        MemberFunction memberFunction;

        str source;

        ;

 

        tn1 = infolog.findNode("//Forms//Address//Data Sources//Address//Fields//AddrRecId");

        tnAddr = infolog.findNode( "//Forms//Address" );

        methodsNode = tn1.AOTfindChild( 'Methods' );

        methodsNode.AOTadd('lookup');

        memberFunction = methodsNode.AOTfindChild( 'lookup' );

        source = @"public void lookup(FormControl _formControl, str _filterStr)

                         {

                                super(_formControl, _filterStr);

                         }" ;

        memberFunction.AOTsetSource(source, false);

        memberFunction.AOTsave();

        methodsNode.AOTsave();

        tnAddr.AOTcompile();

    }

posted @ 2009-04-26 12:20  Fandy Xie  Views(169)  Comments(0Edit  收藏  举报