gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 05:41:09 26 4
gpt4 key购买 nike

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

例如,基于提供商 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com