英文:
How to make a filter selection dependent on the selection of another filter with the JVX Framework?
问题
我在我的项目中有一个带有一些筛选器(下拉列表)的屏幕,我想根据特定筛选器的选择来选择一些筛选器。
不幸的是,我没有找到实现这一点的筛选器方法,但我知道使用JVX框架是可能的。
英文:
I have a screen in my project with some filters (dropdown list) and I want to make the selection of some filters depending on the selection of a specific filter.
I have unfortunately not found a method for the filter to do this, but know it is possible with the JVX Framework.
答案1
得分: 0
Sure, here's the translated content:
所以,您有3个关联的单元格编辑器(A、B、C),如果将A设置为特定值,B和C应该显示预定义的值?
如果这是您想要的,请使用filter A的eventFilterValueChanged
,并调用B和C的setValue(Object)
或setAllValues(Object[])
。
如果您的意思是B和C的可用值取决于A的选择值(依赖的关联单元格编辑器),那就更复杂了?
如果您的过滤器自动搜索isAutoSearch()
,那么每次过滤器值更改都会触发获取操作。这可能会导致性能问题。
英文:
So, you have 3 linked cell editors (A, B, C) and if A is set to a specific value, B and C should show a pre-defined value?
If this is what you want, then use eventFilterValueChanged
of your filter A and call setValue(Object)
or setAllValues(Object[])
for B and C.
If you mean that the available values of B and C depend on selected value of A (dependent linked cell editors), then it's more complex?
If your filters automatically search isAutoSearch()
then, every filter value change will trigger fetching. Could be a performance problem.
答案2
得分: 0
在这种情况下,您有两个选项:使用带有重叠列的外键引用。如果外键正确定义,依赖值将自动过滤。
还可以手动更改值。只需在编辑器A上监听valueChanged,并为B和C的链接单元格编辑器设置附加的过滤条件。要访问单元格编辑器,只需调用:
((ILinkedCellEditor)UICellEditor.getCellEditor(A.getUIResource())).setAdditionalCondition(condition);
附加条件将与原始过滤器一起使用“and”运算符应用。
“A.getUIResource()”需要在当前的JVx中使用,但将来的版本将仅使用“A”。
英文:
In this case, you have two options: Use foreign key references with overlaping columns. If foreign keys are correct defined, dependent values will be filtered automatically.
It's also possible to change values manually. Simply listen for valueChanged on editor A and set an additional filter condition for linked cell editor of B and C. To access the cell editor, simply call:
((ILinkedCellEditor)UICellEditor.getCellEditor(A.getUIResource())).setAdditionalCondition(condition);
The additional condition will be applied to the original filter with and
operator.
The A.getUIResource()
is needed with current JVx but future versions will work with A
only.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论