1.表单元素插件 -  获取表单属性值

// 获取其他属性值
Form form = FormUtil.findRootForm(this);
Element field = FormUtil.findElement(val, form, formData);
String fieldValue = FormUtil.getElementPropertyValue(field, formData);


// 获取ID,两种方式均可
String primaryKeyValue = formData.getPrimaryKeyValue();
String primaryKeyValue = getPrimaryKeyValue(formData);



// 获取表单定义ID
String formDefId = "";
Form form = FormUtil.findRootForm(this);
if (form != null) {
    formDefId = form.getPropertyString(FormUtil.PROPERTY_ID);
}
// 获取数据表名
AppDefinition appDef = AppUtil.getCurrentAppDefinition();
AppService appService  = (AppService) AppUtil.getApplicationContext().getBean("appService");
String tableName = appService.getFormTableName(appDef,formDefId);


// 获取当前表单元素ID
String fieldId = FormUtil.getElementParameterName(this);


  • No labels