Change position of buttons from SearchBar control

Hi,

In our application we need to change the buttons “Save”, “Update”, “Clear” from the SearchBar control from right-down to left-down.

Is there a way to handle the position of the buttons from the SearchBar control?

Thank you!

Br,
Diana Z.

Diana:

Try to get a reference to that buttons to make the changes.

For example, I’m using this code to hide the help button and insert a text in a search bar:


UIComponent helpBtn = findComponentInRoot("keywordsHelpIcon"); 
UIOutput keywordInput = (UIOutput) findComponentInRoot("keywordsTextInput");
	    
documentoEnSesion =  (String)reqsession.getAttribute("nroDoc");
	        
f (documentoEnSesion != null)
          keywordInput.setValue(documentoEnSesion);
	        
helpBtn.setRendered(false);

Hope this help.

Regards.

Hi,

Since the buttons are part of the component SearchBar I have only the id of the search bar so I cannot set a property for the buttons since I don’t have the ids of the buttons.

Is there any other way to put the buttons on the left side?

Thank you!
Diana Z.

Norberto is on the right track, the search bar implementation behind the scenes is a composition of other controls, so you can lookup a control inside the searchbar and modify it.

For example,


//lookup the searchbar control, TODO: use the real id of the searchbar control
UIComponent searchBar = findComponentInRoot("searchBar");

//lookup the footer inside the searchbar by it's id
UIComponent searchBarRefinePanelFooter = findComponent(searchBar, "refinePanelFooter");

//Clear the 'cssClass' of the footer panel remove the right-justification
searchBarRefinePanelFooter.getAttributes().put("styleClass", null);

Thank you for the support!

The solution that you have suggested works form me.

Best regards,
Diana Zoicas