AnsweredAssumed Answered

How to add an extra custom button to a Share form

Question asked by pkanuri on Mar 27, 2014
Latest reply on Apr 15, 2014 by lementree

I have been trying , in vain, to add a "Preview" button to my share form.
After making changes to the share-config-custom.xml I did these things:

1. Edit the form.lib.ftl

   Here is what I added to the renderFormButtons macro
  
   <#if form.showPreviewButton?? && form.showPreviewButton>
         <input id="${formId}-preview" type="button" value="${msg("form.button.cancel.label")}" />
   </#if>
  
  
2. Edit my xml file in the ../site-data/template-instances folder
   
   I used <showPreviewButton>true</showPreviewButton> to be able to display the button .

   Extract:
   
   <component>
         <region-id>create-ediscovery-search-request-content</region-id>
         <url>/components/form?mimeType=text/html&amp;destination=${destination}&amp;formId=ediscoverysearch</url>
         <properties>
            <itemKind>type</itemKind>
            <itemId>cs:ediscoverysearch</itemId>
            <mode>create</mode>
            <submitType>json</submitType>
            <showCaption>true</showCaption>
            <showCancelButton>true</showCancelButton>
         <showResetButton>true</showResetButton>
         <showPreviewButton>true</showPreviewButton> 
      </properties>
      </component>  
    
    
     But still the button does not appear in my form.
     Am I missing anything ? Or is it that one cannot declare buttons other than the predefined
     ones like (submit, reset, cancel)?
    
     Please advise.
  

Outcomes