Announcement

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

    FilterBuilder i18n

    How can I set the text for FilterBuilder match select box?
    Right now it says "Match All" and "Match Any".

    Following the I18nUtil/SmartGwtMessages example I did this.
    The operator select box show the text I set, but the match select box does not - it always shows in English (in my case):
    Code:
      private static native void initSmartGwtMessages (
        final String filterBuilderMatchAllText,
        final String filterBuilderMatchAnyText,
        final String filterBuilderMatchNoneText,
        final String operatorEqualsText,
        final String operatorContainsText,
        final String operatorContainsInsensitiveText) /*-{
    
        if($wnd.isc.FilterBuilder) {
    
          if (filterBuilderMatchAllText) {
            $wnd.isc.FilterBuilder.addProperties({matchAllTitle: filterBuilderMatchAllText});
          }
    
          if (filterBuilderMatchAnyText) {
            $wnd.isc.FilterBuilder.addProperties({matchAnyTitle: filterBuilderMatchAnyText});
          }
    
          if (filterBuilderMatchNoneText) {
            $wnd.isc.FilterBuilder.addProperties({matchNoneTitle: filterBuilderMatchNoneText});
          }
        }
    
        if($wnd.isc.Operators){
    
          if (operatorEqualsText) {
            $wnd.isc.Operators.addClassProperties({equalsTitle: operatorEqualsText});
          }
    
          if (operatorContainsText) {
            $wnd.isc.Operators.addClassProperties({containsTitle: operatorContainsText});
          }
    
          if (operatorContainsInsensitiveText) {
            $wnd.isc.Operators.addClassProperties({iContainsTitle: operatorContainsInsensitiveText});
          }
        }
    }-*/;
    Any ideas?

    #2
    The solution is here:
    http://forums.smartclient.com/showthread.php?t=21307

    joe> ...So, is there no way to make the drop-downs in the SmartGWT filter builder say "AND, OR, NOT", as in the SmartClient filter builder?
    iso> Those come from the system-wide setting for the "and", "or" and "not" logical operators, so you'd set it via SmartGWTMessages.operators_andTitle et al.

    So I guess the code needs to look like this:
    Code:
      private static native void initSmartGwtMessages (
        final String filterBuilderMatchAllText,
        final String filterBuilderMatchAnyText,
        final String filterBuilderMatchNoneText,
        final String operatorEqualsText,
        final String operatorContainsText,
        final String operatorContainsInsensitiveText) /*-{
    
        if($wnd.isc.FilterBuilder) {
    
          if (filterBuilderMatchAllText) {
            $wnd.isc.FilterBuilder.addProperties({matchAllTitle: filterBuilderMatchAllText});
          }
    
          if (filterBuilderMatchAnyText) {
            $wnd.isc.FilterBuilder.addProperties({matchAnyTitle: filterBuilderMatchAnyText});
          }
    
          if (filterBuilderMatchNoneText) {
            $wnd.isc.FilterBuilder.addProperties({matchNoneTitle: filterBuilderMatchNoneText});
          }
        }
    
        if($wnd.isc.Operators){
        
          if (filterBuilderMatchAllText) {
            $wnd.isc.Operators.addClassProperties({andTitle: filterBuilderMatchAllText});
          }
          
          if (filterBuilderMatchNoneText) {
            $wnd.isc.Operators.addClassProperties({notTitle: filterBuilderMatchNoneText});
          }
          
          if (filterBuilderMatchAnyText) {
            $wnd.isc.Operators.addClassProperties({orTitle: filterBuilderMatchAnyText});
          }
    
          if (operatorEqualsText) {
            $wnd.isc.Operators.addClassProperties({equalsTitle: operatorEqualsText});
          }
    
          if (operatorContainsText) {
            $wnd.isc.Operators.addClassProperties({containsTitle: operatorContainsText});
          }
    
          if (operatorContainsInsensitiveText) {
            $wnd.isc.Operators.addClassProperties({iContainsTitle: operatorContainsInsensitiveText});
          }
        }
      }-*/;
    Where we set the text for both:
    1. $wnd.isc.FilterBuilder, and
    2. $wnd.isc.Operators

    Comment

    Working...
    X