AutoFilterTableHeader wrong rendering

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

AutoFilterTableHeader wrong rendering

Postby dgolesn » Fri Aug 31, 2012 5:38 am

Hi,

I have a SortableTable with some customized renderers (e.g. a Boolean is rendered to "wahr" (german for "true") or a resource key value is rendered for the users language)
The renderers are set to the column later (after UI creation), because we are using a binding framework (JGoodies) with descriptors per cell (rest is generated)

I have added an AutoTableTableHeader like this:

Code: Select all
        SortableTable comp = new SortableTable();
        /* autofilter header */
        AutoFilterTableHeader tableHeader = new AutoFilterTableHeader(comp.getColumnModel()) {
            private static final long serialVersionUID = 1L;

            @Override
            protected void customizeAutoFilterBox(AutoFilterBox box) {
                super.customizeAutoFilterBox(box);
                box.setAllowCustomFilter(false);
            }
        };
        tableHeader.setAutoFilterEnabled(true);
        tableHeader.setUseNativeHeaderRenderer(true);
        tableHeader.setDefaultRenderer(new TableHeaderRenderer(true));
        comp.setTableHeader(tableHeader);
        // the renderers are set later in the binding step


First problem is, that the #customizeAutoFilterBox is never called.
Second (main) problem is, that the autoFilter combobox contains values that are different to the table (resource key instead of the rendered value).

How can I force the autofilter to use the normal rendered cell values? Or how can I add my own renderers for the autofilter combobox entries?

Thanks!
(Jide version 3.3.5)
dgolesn
 
Posts: 2
Joined: Fri Aug 31, 2012 5:22 am

Re: AutoFilterTableHeader wrong rendering

Postby JIDE Support » Fri Aug 31, 2012 12:40 pm

1. AutoFilterTableHeader#customizeAutoFilterBox() was not invoked because you used the native mode by tableHeader.setUseNativeHeaderRenderer(true). There are two different implementations on AutoFilterTableHeader. One is called native, and the other is non-native. AutoFilterBox is only used in non-native mode.
2. Please register an ObjectConverter by ObjectConverterManager#registerConverter(). It will take effect both on table cell and AutoFilterTableHeader. ObjectConverter is designed to do this kind of job, converting an object to string. While renderer is designed to do many other stuff. And they have different scope. You can get more detail info about ObjectConverter, Renderer, Editor from our developer manual. It can be found at http://www.jidesoft.com/products/JIDE_G ... _Guide.pdf.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: AutoFilterTableHeader wrong rendering

Postby dgolesn » Mon Sep 03, 2012 2:50 am

1. Does that mean, I have to use the always-visible autofilter button in the table header if I want to customize the autofilter entries?
Is there another way to customize the autofilter entries (e.g. removing "custom...", adding my own filter, etc.) but keeping the #setUseNativeHeaderRenderer(true) behavior?
2. Thanks, that works now
dgolesn
 
Posts: 2
Joined: Fri Aug 31, 2012 5:22 am

Re: AutoFilterTableHeader wrong rendering

Postby JIDE Support » Mon Sep 03, 2012 10:22 am

In native mode, you need to provide a customized UI delegate to achieve your goal. Please give the attached demo a try.

Thanks,
Attachments
CustomAutoFilterTableHearerUIDelegate.java
(2.93 KiB) Downloaded 1843 times
AutoFilterTableHeaderDemo.java
(10.73 KiB) Downloaded 1884 times
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 17 guests

cron