1

enter image description hereThis is the code for commnad button in the Visualforce page.

<apex:commandButton 
    action="{!searchEmps}" 
    styleClass="slds-button slds-button_brand slds-button__icon" 
    Value="SEARCH" > 
    <svg class="slds-button__icon" 
         aria-hidden="true"> 
        <use xlink:href="{!URLFOR($Resource.SLDS,'/SLDS_Icons/utility-spr‌​ite/svg/symbols.svg#‌​search')}">
    </use>
  </svg> 
</apex:commandButton>
3

apex:commandButton doesn't support what you're trying to do here - you can embed text in the value attribute or link to an image with the image attribute. I'd suggest instead you make it an apex:commandLink, and style it as a button.

| improve this answer | |
1
<apex:commandLink
    action="{!searchEmps}"  
    Value="SEARCH" > 
    <svg class="slds-button__icon" 
         aria-hidden="true"> 
        <use xlink:href="{!URLFOR($Resource.SLDS,'/SLDS_Icons/utility-spr‌​ite/svg/symbols.svg#‌​search')}">
    </use>
  </svg> 
</apex:commandLink>

Use this code and style the link according to your requirements.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.