Form之间通过class传递参数,重要在Form中引用对应类对象,将参数倒入类中,再由另外一个Form从类对象中导出。
主要涉及的对象:args, FormRun
创建Form4, Form5, 并都创建一个Button
创建一个类
继续拖拽一个Table,放入Form4的data Source中
Form4>Methods
public class FormRun extends ObjectRun
{
Class1 class1;
}
public void init()
{
zwStudents student;
str b;
;
select firstonly student
where student.StudentId == "123";
class1 = new class1(student);
// class1.sql(student);
super();
}
Design>button>Methods
void clicked()
{
super();
class1.testFunc("abcde");
class1.create();
}
Form5>Methods
public class FormRun extends ObjectRun
{
class1 class1;
zwStudents student;
}
public void init()
{
super();
class1 = new class1();
info(class1.testFunc());
student = element.args().record();
info(student.StudentId);
}
Class1:
class Class1
{
zwStudents student;
}
void new(zwStudents _student)
{
student = _student;
}
void create()
{
Args args;
FormRun formCreate;
FormRun formRun;
;
args = new Args();
args.name(formstr(Form5));
//args.caller(formRun);
args.record(this.sql(student));
args.parmObject(this);
formCreate = classfactory.formRunClass(args);
formCreate.init();
formCreate.run();
formCreate.wait();
}
zwStudents sql(zwStudents _student)
{
return _student;
}
str testFunc(str _b = "abcd")
{
return _b;
}