假如你用过runbase类的话,你一定会对那里的pack/unpack机制印象深刻, 这种机制允许用户保存上一次输入的值,假如你也想让你的From拥有这种强大的功能的话,请参考加入以下6个方法。
1 public dataAreaId lastValueDataAreaId() 2 { 3 return curExt(); 4 } 5 6 private UserId lastValueUserId() 7 { 8 return curuserid(); 9 } 10 11 private UtilElementType lastValueType() 12 { 13 return UtilElementType::Form; 14 } 15 16 private IdentifierName lastValueElementName() 17 { 18 return this.name(); 19 } 20 21 private IdentifierName lastValueDesignName() 22 { 23 return ''; 24 } 25 26 //this is called when no last value is retrieved 27 void initParmDefault() 28 { 29 } 30 31 //further, in Close method of the form: 32 public void close() 33 { 34 super(); 35 //add saveLast method after super() 36 xSysLastValue::saveLast(this); 37 } 38 39 //in init method of the form: 40 public void init() 41 { 42 ; 43 44 //Add getLast method before super() 45 xSysLastValue::getLast(this); 46 super(); 47 … 48 }