如何在视图对象-ADF中将瞬态值作为默认值分配给另一个属性 [英] How to assign a transient value as a default value to another attribute in View Object - ADF

查看:81
本文介绍了如何在视图对象-ADF中将瞬态值作为默认值分配给另一个属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是adf的新手,我正尝试根据sql语句为另一个属性提供默认值.例如,我有一个名为Employee(emp_id,emp_version,emp_name ...)的表,该表具有emp_version列,并且我想使用以下sql语句为emp_version提供默认值:

I am new to adf and I am trying to provide a default value based on an sql statement to another attribute. For instance I have a table called Employee(emp_id,emp_version,emp_name...), which has a column emp_version and i want to provide a default value to emp_version with the following sql statement:

  select count(emp_id)+1
    from employees

为了做到这一点,我尝试创建一个瞬态字段(testEmpversionTransient)并提供一条sql语句,如下所示:

In order to do this I tried to create a transient field(testEmpversionTransient) and provide an sql statement as shown below:

但是我无法将testEmpversionTransient属性的值分配给emp_version属性,请问如何实现该值?

However I am not able to assign the value from the testEmpversionTransient attribute to emp_version attribute, any idea how it can be acheived please?

预先感谢

推荐答案

您正尝试在向表右侧输入数据时向某个字段添加默认值.

Youre trying something like adding a default value to a certain field when entering data to your table right.

为此,您不需要更改SQL语句,只需将默认值添加到必填字段的 placeHolder (位于该字段的属性标签中)

For that you don't need to change the SQL statement, all you have to do is adding the default value to the required field's placeHolder (located in the properties tab of that field)

placeholder="Default Value"

将更改提交到数据库后,将为该字段提交默认值.

When you commit the changes to the Data Base, for that field the default value will be commited.

这篇关于如何在视图对象-ADF中将瞬态值作为默认值分配给另一个属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆