java - af :Calendar component, 按列类型过滤

标签 java jsf calendar oracle-adf jdeveloper

有谁知道如何根据特定属性过滤日历事件?

例如,基于提供商 ID 或其他内容。我想要的是有一些复选框,通过选中这些复选框,日历事件将相应地显示。

最佳答案

使用 View Object View Criterias 是最好的方法。

如果你想访问提供者,你可以通过日历绑定(bind)来访问它。设置 Calendar 标签的 bindings 属性,使其绑定(bind)到一个支持 bean。

private RichCalendar thecal;
//getter and setter for ca
public RichCalendar getthecal() {
    return thecal;   
}
public void setthecal(RichCalendar calendar) {
    this.thecal = calendar;
}

然后您可以通过 getthecal().getValue() 访问日历模型数据(如提供程序)以获取 CalendarModel 对象。请参阅此处以获取 Java 引用:http://docs.oracle.com/cd/E14571_01/apirefs.1111/e10684/oracle/adf/view/rich/model/CalendarModel.html

但是,我通过查看对象属性和查看条件进行所有过滤。我在我的应用程序模块实现类中创建了一个方法,并从绑定(bind)到支持 bean 操作的按钮调用它。

按钮操作:

    //get the application module
    DCBindingContainer dcbindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    AppModule am = (AppModule)dcbindings.getDataControl().getApplicationModule();

    //Run the filtering logic
    am.nameOfYourMethod(PassSomeData,BlahBlah);

AM 方法:

//get the view object your calendar uses
CalendarVOImpl voImpl = getCalendarVO();
ViewCriteria vc = voImpl.createViewCriteria();
//Just some name for the view criteria
vc.setName("filterCalendar");
ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
//Set the name of the attribute and the value you're looking to filter by
vcRow.setAttribute("NameOfAttribute", "IN (" + valueFilter + ")");
vc.insertRow(vcRow);
voImpl.applyViewCriteria(vc);
voImpl.executeQuery();

确保您有一些部分触发器设置以在该方法运行后刷新您的日历。

关于java - af :Calendar component, 按列类型过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17529118/

相关文章:

java - 使用正则表达式解析日志文件以显示多行数据

java - 使用自定义请求对象时带有可选参数的 Spring @RequestMapping

java - 如何在 swagger codegen 中处理多种响应/返回类型(204 为空,400 非空等)?

java - 在 JSF 中将 inputText 转换为 byte[]

java - Java 服务器端(Jsp、velocity 等)日历组件?

java - 如何使用 java 检查当前日期并移至 selenium webdriver 中的下一个日期

java - 打印文件 Java 的行时出现问题

java - 我正在尝试读取 .properties 文件,其中包含以 utf-8 编码的中文字符

jsf - 根据提供的属性初始化复合组件

c++ - 日历程序的偏移