Announcement

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

    FilterBuilder localization issue

    Hello,

    I need to translate the "and", "or", "not" operators text shown in the FilterBuilder when the "topOperatorAppearance" parameter is equal to "bracket".
    I tried setting the "andTitle"
    Code:
    Operators.addClassProperties({andTitle: "MyAnd"});
    but it is not working, I still get "and", "or", "not" in the list (see bracketOperators.JPG).
    Code:
    Operators.addClassProperties({andTitle: "MyAnd"});
    isc.FilterBuilder.create({
       ID: "fBuilder",
       topOperatorAppearance: "bracket",
      dataSource: isc.DataSource.create({
          fields: [
              {name: "field1",title: "Field1", type:"string" }
          ]
      })
    });
    Whereas if I set the "topOperatorAppearance" parameter to "radio", the localization works.
    Code:
    Operators.addClassProperties({andTitle: "MyAnd"});
    isc.FilterBuilder.create({
       ID: "fBuilder",
       topOperatorAppearance: "radio",
      dataSource: isc.DataSource.create({
          fields: [
              {name: "field1",title: "Field1", type:"string" }
          ]
      })
    });
    How can I modify the texts ("and, "or", "not") with a "topOperatorAppearance" set to "bracket". ? I cannot use the "radio" appearance.

    Thank you
    Attached Files

    #2
    What exact version did you try this with (always post this).

    Comment


      #3
      Originally posted by Isomorphic
      What exact version did you try this with (always post this).
      I'm sorry, I forgot. here it is :
      I'm using SmartClient 7.0RC2 "PowerEdition"
      Same behavior with Firefox 3.0 and Internet Explorer 7

      Thank you

      Comment


        #4
        Then this is a known bug already corrected in 8.0 builds. Are you able to move to the more recent version? It's backwards compatible as usual.

        Comment


          #5
          Originally posted by Isomorphic
          Then this is a known bug already corrected in 8.0 builds. Are you able to move to the more recent version? It's backwards compatible as usual.
          I cannot move to the 8 version, I need to use my 7.0 licenced version. Can you please provide me a patch for the 7.0RC2 version ?
          Thank you

          Comment


            #6
            Is your only concern with moving to 8.0 getting a licensed copy? That's not a problem.

            Comment


              #7
              Originally posted by Isomorphic
              Is your only concern with moving to 8.0 getting a licensed copy? That's not a problem.
              No, I also have a tight schedule and I cannot use a new version in production without having the time to do comprehensive tests of all my code (my application is quite complex).

              Thank you

              Comment


                #8
                The following 7.0RC2 patch allows localization of the operator-title strings in the FilterBuilder's "bracket" item.

                Note that, once this patch is applied to 7.0rc2, the i18n properties andTitle, orTitle and notTitle affect both the "radio" and "bracket" topOperatorAppearance modes. If you want any of the entries to remain as they were before this change ("and", "or", "not"), you'll now need to specifically set the corresponding and/or/notTitle attributes to those strings.

                As of 8.0, the default values of those properties have changed and affect only the "bracket" appearance - there are seperate i18n titles for the "radio" appearance.

                //----------------------------------------------------------------------------
                // Isomorphic SmartClient 7.0rc2 patch
                // Purpose: Allow FilterBuilder operator-titles to be altered via Operators.and/or/notTitle
                // when topOperatorAppearance is "bracket"
                //
                // Applies to SmartClient 7.0RC2 builds only
                //----------------------------------------------------------------------------
                if (window.isc) {
                if (isc.version.startsWith("7.0rc2")) {
                isc.FilterBuilder.addProperties({
                initWidget : function() {
                this.Super("initWidget",arguments);
                this.addButtonDefaults.prompt=this.addButtonPrompt;
                this.removeButtonDefaults.prompt=this.removeButtonPrompt;
                this.subClauseButtonDefaults.prompt=this.subClauseButtonPrompt;
                this.subClauseButtonDefaults.title=this.subClauseButtonTitle;

                var _1;
                if(this.showSubClauseButton==_1) {
                this.showSubClauseButton=(this.topOperatorAppearance!="radio")
                }
                this.clauses=[];
                var _2=this.topOperatorAppearance;
                var _3=this.getDataSource().getTypeOperatorMap("text",true,"criteria");

                if(_2=="bracket"){
                if(this.showTopRemoveButton){
                var _6=this.removeButton=this.createAutoChild("removeButton",{
                click:function(){
                this.creator.parentClause.removeButtonClick(this.creator)
                }
                });
                this.clauseLayout=this;this.addMember(_6)
                }
                this.addAutoChild("topOperatorForm");
                this.topOperatorForm.items[0].valueMap=_3;
                this.topOperatorForm.items[0].defaultValue=this.topOperator;
                this.addAutoChild("bracket")
                }
                this.addAutoChild("clauseStack");
                if(_2=="radio"){
                this.addAutoChild("radioOperatorForm");
                var _7={};

                for(var i=0;i<this.radioOptions.length;i++){
                _7[this.radioOptions[i]]=_3[this.radioOptions[i]]
                }
                this.radioOperatorForm.items[0].valueMap=_7;
                this.radioOperatorForm.items[0].defaultValue=this.topOperator
                }

                this.addAutoChildren(["buttonBar","addButton","subClauseButton"]);
                if(this.criteria){
                this.setCriteria(this.criteria)
                } else if(!this.allowEmpty&&!this.dontCreateEmptyChild){
                this.addNewClause()
                }

                this.setTopOperator(this.topOperator)
                }
                });
                } else {
                isc.Log.logWarn("Patch code for SmartClient version 7.0RC2 included in this application. " +
                "You are running version:" + isc.version + ". This patch code will have no effect " +
                "and can be removed.");
                }
                }

                Comment

                Working...
                X