| 1.切换Treelist的当前行，下面的Freeform中的内容会跟着变化； 2.在Freeform中输入，内容会更新到Treelist；

1.切换Treelist的当前行，Freeform的内容会跟着变化；

    function OnEvent(id, Event, p1, p2, p3, p4)
    {
     if(id=='AF1') {
      if( Event == "SelChanged" ) { //事件：当前行切换
       var colName="";
       //逐个列，取出内容，填入Freeform
       while(true) {
        colName = AF1.func("GetNextValidCol", colName);
        if(colName=="") break;
        var data = AF1.func("GetCellData", p1 + "\r\n" + colName);
        AF2.func("SetValue", colName+ "\r\n" +data);
       }
      }
     }
     else if(id=='AF2') {
      if( Event == "EditChanged" ) { //内容在输入
       var data = AF2.func("getValue", p1);
       var row = AF1.func("GetCurrentRow", "");
       AF1.func("SetCellData", row +"\r\n"+ p1 +"\r\n"+ data);
      }
     }
    }