How to refresh tabs, from the client side (SalesLogix 7.5.2)
Nicolas Galler | December 11, 2009As part of the many performance enhancement brought by this latest service pack, tabs are no longer automatically refreshing when a dialog closes. I think we can all agree that the gained performance is worth it
But this has a few consequences:
- First of all, if you are using a quickform as an insert form, you are all good. Yes, this is one of these cases where using a quickform actually paid off! Congratulate yourself for the good choice.
- If you are using a custom smart part processed on the server side, it is quite straightforward, but requires a manual addition of this little piece of code to your server side script (right before or after closing the dialog):
PanelRefresh.RefreshTabWorkspace();
- If you are using a client-side customization (and I do use those once in a while for interactive or time-consuming processes), it is only slightly more complex – you need to trigger a refresh from the client side. Assuming you are closing the dialog with this type of code:
DialogWorkspace._dialog.close();
In that case I had to use a slight subterfuge to get the panel to refresh correctly. I added a hidden (server-side) button on the page:
<asp:Button runat="server" ID="btnProcessServer" CssClass="btnProcess_server" style="display: none" />
And then in the code-behind:
/// <summary> /// This is called by the Javascript when processing is complete. /// Close the dialog, and ensure tab is refreshed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnProcessServer_Click(object sender, EventArgs e) { DialogService.CloseEventHappened(sender, e); PanelRefresh.RefreshTabWorkspace(); }
Finally I just had to replace my javascript with the following to cause a postback and have the dialog closed from the code-behind from the button:
$(".btnProcess_Server").click();Note that I am using the CSS class instead of the id, as the id is going to be transformed a bit by ASP.NET. It’s a bit of a cheat. There might be a creative way to do it entirely from client side, using the window.TabControl object (a reference to the tab workspace), however experience taught me creatively discovering hidden Sage Javascript API is a good way to waste my afternoon (and also get my butt kicked during upgrades!)





