Skip to Content
avatar image
Former Member

How to change the text "Go" in Smart Filter Bar to "Find" ?

Hi,

I want to change the text "Go" in Smart Filter Bar to "Find" and add a icon there. Also i want to know which event triggers when clicked on Go button and how do i handle it.

smartfilterbar.png

smartfilterbar.png (24.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 02 at 08:22 PM

    Hello,

    it seems that _oToolbar is deprecated.

    However, you can do it easily by getting _oSearchButton instance:

    var oFilter = this.getView().byId("objectFilter"),
    				that = this;
    				
    			oFilter.addEventDelegate({
    				"onAfterRendering": function(oEvent) {
    					var oResourceBundle = that.getOwnerComponent().getModel("i18n").getResourceBundle();
    
    
    					var oButton = oEvent.srcControl._oSearchButton;
    					oButton.setText(oResourceBundle.getText("goButton"));
    				}
    			});
    
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 13, 2017 at 06:40 PM

    Hello,

    It is not possible (for the moment) to do it in Standard way. But here is how I found to handle it.

    Put this code in onInit function of the view:

    var oFilter = this.getView().byId("idSmartFilter");      
    oFilter.setShowGoOnFB(false);
    oFilter.addEventDelegate({
          "onAfterRendering": function(oEvent) {
                                var oContents = oEvent.srcControl._oToolbar.getContent();
                                if (oContents.length > 7) {
                                  // Search area
                                    var oButton= oContents[???];  // I let you find the index corresponding to the GO button
                                    oButton.setText(that._oBundle.getText("inputSearchPlaceholder"));
                                }
                            }
                        });

    With the debug you will be able to find the correct UI Control ;)

    Add comment
    10|10000 characters needed characters exceeded