获得LOV的所有返回值编程

问题描述:

我目前工作的一个CRUD应用程序,我已经定义了一个LOV这样的:获得LOV的所有返回值编程

enter image description here

我的问题是我怎么能得到所有这些返回值例如像这样定义的ValueChangeListener:

public void onValueChanged(ValueChangeEvent ev){ 
    BindingContext bctx = BindingContext.getCurrent(); 
    oracle.binding.BindingContainer bindings = bctx.getCurrentBindingsEntry(); 
    DCIteratorBinding iterBind = (DCIteratorBinding)bindings.get("MpStavkeulazaView5Iterator"); 
    System.out.println("Vrijednost je" + ev.getNewValue()); 
} 

此代码只给了我清单属性的值,但我想其它的值了。

其他任何信息请告诉我。

首先 - 使用backing bean的值更改侦听器对于这样的用例并不理想: 为了同样的目的,请尝试使用Row Impl中的setter。记住:如果你不能从BC测试器测试你的用例,那么你的ADF设计是有缺陷的。

所有第二:你LOV可以返回多个值: http://adfbugs.blogspot.co.uk/2009/11/returning-multiple-values-from-lov-in.html

+0

我需要以编程方式访问值以计算表中的字段。您发布的链接显示它可以返回多个值,但不能如何从bean中获取它们。 – Matsura

+0

关于我的评论的任何想法? – Matsura

可以绑定行的属性,然后得到这个绑定的值或只是摆脱这个迭代器的属性。如果你要处理它在valueChangeListener你必须处理更新,得到这个值之前:

public void onValueChanged(ValueChangeEvent ev){ 
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry(); 
    DCIteratorBinding iterBind = (DCIteratorBinding)bindings.get("MpStavkeulazaView5Iterator"); 
    System.out.println("Vrijednost je" + ev.getNewValue()); 
    ev.processUpdates(FacesContext.getCurrentInstance()); 
    Row row = iterBind.getCurrentRow(); 
    System.out.println("Proizvod: " + row.getAttribute("Proizvod")); 
    System.out.println("Jmjere: " + row.getAttribute("Jmjere")); 
} 

但是它可能是更好的使用瞬态属性,你的ViewObject并做计算呢?