我有一个用例,我创建了一个包含 3 个值的视图对象,即 LOC_CODE、LOC_DESC、CITY_DESC。现在在我的 ADF 表单中,我想以这样的方式显示所有 3 个值,以便用户可以从 Popup(LOV) 中选择 LOC_CODE,其余两个字段 LOC_DESC 和 CITY_DESC 应相应更改。目前弹出窗口显示所有 3 个值,但是当我选择该行并单击“确定”按钮时,它只会在 1 个文本框中填充 LOC_CODE。以下是相同的场景:
问问题
937 次
3 回答
0
得到了解决方案。只需在相应字段附近添加一个文本框或拖放并将其与所需的绑定对象绑定即可。例如,在这种情况下,LOC_DESC 和 CITY_DESC 在我的数据控件中作为 DefLoc 和 DefCity 可用,其中包含用于获取相应描述值的 SQL。现在我需要拖放 DefLoc 和 DefCity 并自动完成绑定或仅检查绑定值。
于 2017-03-17T12:27:51.570 回答
0
就我而言,JDeveloper 12.2.1.3.0
public void valueChangeListener(ValueChangeEvent valueChangeEvent) {
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
JUCtrlListBinding list = (JUCtrlListBinding) bindings.get("YourBindingforLOV");
String selectedValue = (String) valueChangeEvent.getNewValue();
list.getListIterBinding().setCurrentRowWithKeyValue(selectedValue);
Row currRow = list.getListIterBinding().getCurrentRow();
if (currRow != null) {
String s = (String) currRow.getAttribute("YourAttributeName");
}
}
于 2018-02-20T19:33:49.037 回答
0
您必须将 valuechangelistener 添加到位置代码。设置自动提交为真。
现在在支持 bean 中使用以下代码:
public void valuechangelistener(ValueChangeEvent valueChangeEvent) {
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
JUCtrlListBinding list = (JUCtrlListBinding)bindings.get("LOC_CODE");
String selectedValue = (String)list.getAttributeValue();
list.getListIterBinding().setCurrentRowWithKeyValue(selectedValue);
Row currRow = list.getListIterBinding().getCurrentRow();
if (currRow != null) {
bndloc_desc.setValue(currRow.getAttribute("LOC_DESC"));
bndcity_desc.setValue(currRow.getAttribute("CITY_DESC"));
}
}
现在将部分触发器设置为位置描述和城市描述,ID 为 LOC_CODE。完成此操作后,您将获得所需的结果。
实施后更新。
于 2017-04-10T11:41:37.653 回答