Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Remove clauses from filterBuilder widget

    I have a DS as give below :
    Code:
    <DataSource ID="Test"
                serverType="hibernate"
                beanClassName="com.test.Test"
                configBean="mySessionFactory"
                autoDeriveSchema="false"
                dropExtraFields="true">
        <fields>
            <!-- Keys -->
            <field name="id" type="integer" primaryKey="true" hidden="true"/>
            <field name="name" type="text"/>
            <field name="alive" type="boolean"/>
            <field name="address" type="text"/>
    
         </fields>
    </DataSource>
    FilterBuilder is initialized using below code :
    Code:
    FilterBuilder fb = new FilterBuilder();
    fb.setDataSource(DataSource.get("Test"));
    The filter builder shows both name,alive opetions in dropdown as expected.

    I have many fields that I don't want to show in filterbuilder. For ex : I just want to show name, address field in filterBuilder and user should not be allowed to filter by 'alive' field.
    How can I remove datasource fields from filterBuilder?

    Thanks in advance.

    #2
    Provide a DataSource with less fields. You can use DataSource.inheritsFrom to avoid duplicating field definitions.

    Comment

    Working...
    X