当前用户:
ADFContext.getCurrent().getSessionScope().get("userId");
==========================================================
升级版查询:(在VO增加一个attribute A,设定 A为 key attribute, A的类型为boolean,control type为checkbox,A不用绑定LOV, 直接true,false,并把A加入到查询中,另外真正的属性
绑定变量B,这个变量在VO的实现类中,将当前用户的值赋给该变量B即可)
private String userid;
@Override
public void executeQuery() {
ViewCriteria vc = this.getViewCriteria("HtCaseBudgetsTViewCriteria");
System.out.println("-----------1-----------");
if (vc.getCurrentRow() != null) {
System.out.println("-----------5-----------");
if (vc.getCurrentRow().getAttribute("userornot") != null && vc.getCurrentRow().getAttribute("userornot").equals(true)){
userid = ADFContext.getCurrent().getSessionScope().get("userId").toString();
System.out.println("-------------"+ userid+"------------");
System.out.println("-----------4-----------");
this.setuserid(userid);
}
else {
this.setuserid(null);
}
}
super.executeQuery();
System.out.println("-----------3-----------");
}
ADFContext.getCurrent().getSessionScope().get("userId");
==========================================================
升级版查询:(在VO增加一个attribute A,设定 A为 key attribute, A的类型为boolean,control type为checkbox,A不用绑定LOV, 直接true,false,并把A加入到查询中,另外真正的属性
绑定变量B,这个变量在VO的实现类中,将当前用户的值赋给该变量B即可)
private String userid;
@Override
public void executeQuery() {
ViewCriteria vc = this.getViewCriteria("HtCaseBudgetsTViewCriteria");
System.out.println("-----------1-----------");
if (vc.getCurrentRow() != null) {
System.out.println("-----------5-----------");
if (vc.getCurrentRow().getAttribute("userornot") != null && vc.getCurrentRow().getAttribute("userornot").equals(true)){
userid = ADFContext.getCurrent().getSessionScope().get("userId").toString();
System.out.println("-------------"+ userid+"------------");
System.out.println("-----------4-----------");
this.setuserid(userid);
}
else {
this.setuserid(null);
}
}
super.executeQuery();
System.out.println("-----------3-----------");
}