Announcement

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

    Read-only display (text or graph) of AdvancedCriteria?

    Hi,

    I am building a nested AdvancedCriteria using the ootb FilterBuilder() which works all fine.
    Now for ease of end user use I'd like to display the created criteria in a (potentially pretty printed) textual or graphical representation in a read-only mode. Is there already such a component in SGWT (LGPL) ?

    Thanks for any pointers.
    Chris

    #2
    This does exist but doesn't have a SmartGWT wrapper. You can call it via JSNI if you like. Take a look at FilterBuilder.js::getFilterDescription() and note the second parameter (a DataSource) is required.

    Comment


      #3
      Thanks a lot! I'll play around with it and try to get it working.

      Cheers
      Chris

      Comment


        #4
        For others to benefit from. This code works nicely:

        Code:
        	private native String getFilterDescription(FilterBuilder filterBuilder) /*-{
                var fb = filterBuilder.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();		
        		return fb.getFilterDescription();
        	}-*/;
        It takes a fully initialized FilterBuilder object as parameter.
        Downside is that the result string is unfortunately not fully localized. I.e. if you use a language other than English you'll get a ugly mix of partially english operator names and localized operator names.

        E.g. equality is always printed as "is equal to"

        Comment

        Working...
        X