Important Update: Community URLs redirect issues are partially resolved. Learn More. .
2021-07-20 01:32 AM
Hi All,
We have a custom object button to trigger a datafeed and it has been placed under a sub-tab. its not working when we move from one tab to another. Can anyone please help us to fix this issue.
Requirement is to tigger the custom code on clicking the button which is placed in a sub-tab.
Thakns in Advance!
@Anonymous @DavidPetty
2024-03-07 01:19 PM
Thanks!
I did some digging through my old code and found following which might be helpful. The HTML at the top would go in each tab custom object and the script would go in a custom object outside the tab set.
<table border='0' style='width: 100%'>
<tr>
<td style='width: 50%; text-align:left; padding: 10px;'>
<img class="btnprev" src="/BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Previous+Module;iconSetStyle:VistaRound;baseColor:%23DDDDDD;disabled:False" onclick="selectTab('prev')"/>
</td>
<td style='width: 50%; text-align:right; padding: 10px;'>
<img class="btnnext" src="/BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Next+Module;iconSetStyle:VistaRound;baseColor:%23DDDDDD;disabled:False" onclick="selectTab('next')"/>
</td>
</tr>
</table>
<script type="text/javascript">
var tabIndexes, tabSetId, selectedTabIndex;
function pageLoad() {
$.each($LM._tabSets, function(key, value) {
tabSetId = key;
});
if (tabSetId) {
tabIndexes = $LM._tabSets[tabSetId].tabIds;
var tabStripElementId = 'master_DefaultContent_rts_ts' + tabSetId + '_t';
var tabStrip = $find(tabStripElementId);
selectedTabIndex = tabStrip._selectedIndex;
}
}
function selectTab(action) {
var tabId, tab;
if (action == 'prev') {
tabId = tabIndexes[selectedTabIndex-1];
tab = $('li.tab_'+tabId).find('a.rtsLink').trigger('click');
tab.find('span.rtsTxt').trigger('click');
}
if (action == 'next') {
tabId = tabIndexes[selectedTabIndex+1];
tab = $('li.tab_'+tabId).find('a.rtsLink').trigger('click');
tab.find('span.rtsTxt').trigger('click');
}
}
</script>
Advisory Consultant