have more than 1 Tab in application page ?

May 4, 2014 at 6:02 AM
how can I have more than 1 Tab in application Page ?
Coordinator
May 4, 2014 at 7:30 AM
Generally, answer must be like "just add second tab same way as you do this before (add second Element and second user control to ControlTemplates), and not forget use unique Id in tab definition". But i test this way, and i get two ribbon tabs, but only one works fine (second tab), all buttons in first tab was grey and looks like disabled buttons.
I can't find out problem.
Now i can only advise to contact the original author of Sharepoint Fluent Ribbon, maybe he can help.
If you get answer, please post it here, for everyone with the same problem.
Jun 17, 2014 at 2:07 PM
Hello,
I've found a solution for this problem, but you have to modify the source code:
  • Open RibbonController.cs
  • Locate the following code in both "AddRibbonContextualTabToPage" and "AddRibbonTabToPage" methods:
var commands = new RibbonCommandRepository();
commands.AddCommands(definition);
page.Items[CommandsKey] = commands;
  • Replace it with the following code:
if (page.Items[CommandsKey] != null)
{
    var commands = page.Items[CommandsKey] as RibbonCommandRepository;
    commands.AddCommands(definition);
    page.Items[CommandsKey] = commands;
}
else
{
    var commands = new RibbonCommandRepository();
    commands.AddCommands(definition);
    page.Items[CommandsKey] = commands;
}
Regards,
Coordinator
Jun 17, 2014 at 5:05 PM
Humberto0607, thank you for bug fix (I'll add this fix today)!
vistarayan, thank you for bug report!