Announcement

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

  • wwarriner
    replied
    Thanks again - Yeah my uses case has a fields conditionally read-only. Im not familiar with the "set at multiple levels" for validOperators but that sounds promising.
    Ill check it out

    Thanks !

    Leave a comment:


  • Isomorphic
    replied
    What would it mean for a field to be read-only?

    If you are trying to create completely fixed criteria, just do that outside of the filterBuildee. If the user can’t edit it, there’s no reason it would be represented in the FilterBuilder, that’s just confusing, and also not a compact representation.

    If you’re trying to limit the available operators, see validOperators - it can be set at multiple levels (search the docs for the term and use the provided interlinks).

    You already know how to make the value completely fixed.

    Leave a comment:


  • wwarriner
    replied
    So again thanks for staying with this. For the record I'm not trying to be argumentative or critical of the product. I use the filter builder extensively and think it very good, So from where I am now I really would like to be able to have a read-only field in the filter as you mentioned in your last post.

    So - I get and agree with your last post except that using valueFieldProperties I can make the value read-only but the operator can still be selected. This causes problems should the filter then be saved or applied.
    Is it correct that there is no way to access/customize the operator form Item ( that is customize the operator fieldItem ). If not then that's a problem for a read-only solution. Agree ?

    thanks

    Leave a comment:


  • Isomorphic
    replied
    So again, you just use this DataSource to configure the FilterBuilder. You don't use it to perform any operations. So there is no need for anything to be inherited except fields. There is no need to bounce between two DataSource definitions because the inheriting DataSource is only client-side code and only consists of a list of fields.

    If you have use cases such as read-only fields, those would be configured via valueFieldProperties, and that works exactly the same regardless of what approach is taken to limit fields.

    Leave a comment:


  • wwarriner
    replied
    So thanks for your help its really appreciated, but I have to disagree with your assumption. I can think of and have couple of use cases where a filter value may: be displayed but optionally read only , modified by some global value( like date ), and persisted. Requiring 2 different data sources requires additional code to make this seamless ( Since a builder doesn't handle fields not declared in its datasource xml ( I tried it))- essentially I have to manipulate the delta between the 2 data sources. And BTW I've used datasource inherits extensively and its great - wish it supported operation bindings inheritance though.

    I think it would be an acceptable option ( like 1 line to disable the operator form Item ( you can disable the option list now), and easier than adding a new data source.
    Anyway not trying to be argumentative - The filter builder is a very nice tool and pretty flexible, still I think this would be a usefull addition.

    So for now its DataSource.inherits ;-)

    Thanks again

    Leave a comment:


  • Isomorphic
    replied
    Please look at DataSource.inheritsFrom - this is going to take just a handful of lines of code, inline, right in your FilterBuilder definition.

    Your proposed approach is more complicated and far worse UE.

    Leave a comment:


  • wwarriner
    replied
    I know about that but was hoping to handle it in the FilterBuilder. I can disable the Filter Builder value list, If I could disable the associated operator Form Item that would be acceptable. Any way to do that
    thx

    Leave a comment:


  • Isomorphic
    replied
    You can pass a DataSource with limited fields. To avoid duplication, use DataSource.inheritsFrom to inherit from the original DataSource.

    Leave a comment:


  • wwarriner
    replied
    Thanks for pointing me to the getValueFieldProperties, worked great.

    I'm wanting one more customization of the filter builder, I would like for some fields ( Field as in ds xml field) to be conditionally included/visible/enabled/non-functional. Is there a way to customize the FilterBuilder to achieve this ?

    Thanks

    Leave a comment:


  • wwarriner
    replied
    k thx

    Leave a comment:


  • Isomorphic
    replied
    Yes, you’ve already been using it: the entire docs.serverds Javadoc package.

    Leave a comment:


  • wwarriner
    replied
    Thanks Ill check that out.

    BTW where is what's allowable and not in the ds.xml defined. Is there a schema or documentation ?

    Leave a comment:


  • Isomorphic
    replied
    As we said before:

    You can have custom valueField properties if you want to use, for instance, a SelectItem with an optionDataSource for a dynamic criterion.value.
    FilterBuilder has an API getValueFieldProperties() which is an override point so you can set properties on the valueField, such as optionDataSource, and optionOperationId which will allow you to have a special fetch operation with the behaviors you want.

    Note also it is not correct to set optionDataSource in .ds.xml - note it's not documented there. You can set the foreignKey attribute and that has a similar effect in the specific case of a SelectItem ending up bound to the field.

    Leave a comment:


  • wwarriner
    replied
    To be clear in my last post:
    we have distinct values which employ a common prexfixes/suffixes. Users often want to see a all data with a give prefix or suffix. Id like to be able to support users entering the pre/suffix independently of whats displayed in the option list.

    Thanks

    Leave a comment:


  • wwarriner
    replied
    So I created a datasource for the table field I wanted to populate the option list from and added a optionDataSource="myOptionDs" to the XML for a given field and that seems to work.
    Is this the best/recommend approach ?

    If so a couple of additional questions
    1. Is there a way to force this to be cached - ?
    2. Is there a way to configure the option list to allow users to type values into in order to support searches ( queries) such as starts with, ends with, contains, etc

    Thanks

    Leave a comment:

Working...
X