Java af:日历组件,按列类型筛选

Java af:日历组件,按列类型筛选,java,jsf,calendar,oracle-adf,jdeveloper,Java,Jsf,Calendar,Oracle Adf,Jdeveloper,有人知道如何根据特定属性过滤日历事件吗 例如,基于提供者ID或其他内容。我想要的是有一些复选框,通过选中这些复选框,日历事件将相应显示。我尝试调整adf演示应用程序中实现的解决方案: 但是我发现它太复杂了,所以我通过在Calendar组件的ViewObject中使用ViewCriteria找到了解决方案。我创建了三个绑定变量,并创建了一个ViewCriteria,它将显示那些事件,提供程序与它们中的每一个都相等(“或”相关)。然后,我在VOImpl类中创建了一个方法,并将其绑定到日历页面中。单击

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


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

我尝试调整adf演示应用程序中实现的解决方案: 但是我发现它太复杂了,所以我通过在Calendar组件的ViewObject中使用ViewCriteria找到了解决方案。我创建了三个绑定变量,并创建了一个ViewCriteria,它将显示那些事件,提供程序与它们中的每一个都相等(“或”相关)。然后,我在VOImpl类中创建了一个方法,并将其绑定到日历页面中。单击按钮,然后在不同情况下使用所需的值执行ViewCriteria


希望这对其他人有所帮助

使用视图对象视图标准是最好的方法

如果要访问提供程序,可以通过日历绑定进行访问。设置日历标记的bindings属性,使其绑定到支持bean

private RichCalendar thecal;
//getter and setter for ca
public RichCalendar getthecal() {
    return thecal;   
}
public void setthecal(RichCalendar calendar) {
    this.thecal = calendar;
}
然后,您可以通过gethecal().getValue()访问日历模型数据(如提供程序),以获取CalendarModel对象。有关java参考,请参见此处:

但是,我通过查看对象属性和查看标准执行所有过滤。我在我的应用程序模块实现类中创建了一个方法,并从绑定到支持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);
//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();
AM方法:

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

    //Run the filtering logic
    am.nameOfYourMethod(PassSomeData,BlahBlah);
//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();

确保已设置部分触发器,以便在该方法运行后刷新日历。

感谢您的回复:)