- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 10:07 AM
We added a Print button so unlike yours, it had only client side implication, it was a simple javascript onclick to open a pop-up with the article without the SNOW frame and passing a parameter that calls window.print(). We replicated the behavior of the printer friendly version button that you find in the user preference menu.
Here is what we added following the Edit button
<j:if test="${showUpdateAction}">
<button id="editArticle" title="${gs.getMessage('Edit content')}" class="btn btn-default navbar-btn snc-article-header-toolbar-button">${gs.getMessage("Edit")}</button>
</j:if>
<!-- Custom added to add a print Button when there is the required sysparm -->
<g:evaluate var="sysparm_media">
var sysparm_media = RP.getParameterValue("sysparm_media");
sysparm_media;
</g:evaluate>
<j:if test="${sysparm_media!='print'}">
<button id="printArticle" title="${gs.getMessage('Print Article')}" class="btn navbar-btn btn-primary" style="display:inline-block;" onclick="window.open('/kb_view.do?sys_kb_id=${knowledgeRecord.sys_id}&sysparm_media=print', 'Printer_friendly_format', 'resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no')">${gs.getMessage("Print")}</button>
</j:if>
<!-- Automatically opens the print option of the browser when the sysparm get passed using the previous button -->
<j:if test="${sysparm_media=='print'}">
<script>
window.print();
</script>
</j:if>
However you are saying that you want to do a similar button the the createIncident button which looks like:
<button id="createIncident" title="${gs.getMessage('Create Incident')}" class="btn btn-default navbar-btn snc-article-header-toolbar-button">${gs.getMessage("Create Incident")}</button>
I'm not aware of what handle the click of this button, but you could probably mimic the create incident with a href="your_table.do?sys_id=-1&sysparm_query=field_x=value_you_want_in_that_field"
If you want to share your requirement, I could try to help you with a better example.