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);
}
}
...全文
191 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧