Jdeveloper中碰到的关于selectonechoice的问题。。。。
沉珂 2006-12-22 11:38:45 我用jsf做一个page,上面是form,下面是table型,
然后我在做line的selectOneChoice时,出现了问题。
line有两个栏位是海关编号、海关名称。
我在海关编号做了个list of value,就是select one choice
问题出来了,
在拉select one choice时,
把lov里的值分别付给海关编号、海关名称,
但每次都是在table的第一个栏有效果,
其他栏位lov的值改变了,就跟没改变一样,没效果。
我已经在selectOneChoice做了valuechangeListener
和Binding。。。。autoSubmit为true,
bean里面的代码如下:
public class GccXmCavLOVMBean {
private CoreSelectOneChoice masterCustomersLOV;
public GccXmCavLOVMBean() {
}
public void MasterCustomersLOV(ValueChangeEvent valueChangeEvent) {
// Add event code here...
}
public void setMasterCustomersLOV(CoreSelectOneChoice masterCustomersLOV) {
this.masterCustomersLOV = masterCustomersLOV;
}
public CoreSelectOneChoice getMasterCustomersLOV() {
return masterCustomersLOV;
}
public void onMaterCustomsChanged(ValueChangeEvent valueChangeEvent) {
// Add event code here...
FacesContext fctx = FacesContext.getCurrentInstance();
Application fapp = fctx.getApplication();
JUFormBinding adfbc =
(JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(fctx);
//
DCIteratorBinding iterLov = adfbc.findIteratorBinding("LovGccLookupValuesMasCustomsVOIterator");
System.out.println("Test");
Row row =iterLov.getRowAtRangeIndex(((Integer)masterCustomersLOV.getValue()).intValue());
/*System.out.println(masterCustomersLOV);
Row row = iterLov.getCurrentRow();*/
String masterCustoms = (String)row.getAttribute("LookupCode");
String masCustName = (String)row.getAttribute("Name1");
System.out.println("masterCustoms:"+masterCustoms);
System.out.println("masCustName:"+masCustName);
DCIteratorBinding iterRow = adfbc.findIteratorBinding("GccCavEntExpVOIterator");
Row rowTrMas = iterRow.getCurrentRow();
rowTrMas.setAttribute("MasterCustoms", masterCustoms);
rowTrMas.setAttribute("MasCustName", masCustName);
//
String currentView = fctx.getViewRoot().getViewId();
ViewHandler vh = fctx.getApplication().getViewHandler();
UIViewRoot x = vh.createView(fctx, currentView);
x.setViewId(currentView);
fctx.setViewRoot(x);
}
}