none
getVisible callback not call RRS feed

  • General discussion

  • Hi,

    I did custom backstate to hidden the tab/button (E.g. Save AS)

    The code like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <backstage onShow="ShowBackStage">
        <tab idMso="TabSave" getVisible="GetVisibleTabMy" >
        </tab>
     </backstage>
    </customUI>

     The ShowBackStage: (this working fine)

    public void ShowBackStage(object context)
            {
                ribbon.Invalidate();
            }

    The GetVisibleTabMy: (This doesn't work)

      public bool GetVisibleTabMy(Office.IRibbonControl control)
           {
               return false;
           }

    I have invalidated the control (ShowBackStage), however when I debug the project, the GetVisibleTabMy callback never call when I start debug and already execute ShowBackStage callback. (the save as doesn't hidden)

    What's the reason of that?

    On the other hand, I would like to know why the enabled attribute not work for it (E.g. save as)

    I am using Office 2013.

    Thanks


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, September 30, 2014 2:00 AM
    Moderator

All replies

  • Hello Starain,

    > What's the reason of that?

    If you remove the idMso="TabSave" declaration the callbacks start firing as they should.

    > On the other hand, I would like to know why the enabled attribute not work for it (E.g. save as)

    According to the  Introduction to the Office 2010 Backstage View for Developers article in MSDN which states the following:

                    

    Can I repurpose one of the existing definitive command buttons, fast command buttons, or tabs by changing its onAction callback attribute? For example can I change the file Save button so that is has an additional type, or displays only one file type?

    It is not possible to override these commands from the custom UI XML markup or by using the object model. Using the DocumentBeforeSave event is one alternative, but using that doesn't really change the functionality of the individual commands that show up in the Change File Type gallery in the Backstage.

    A better solution would be to consider hiding the built-in UI and rebuilding it fully with custom commands.

    It says that attributes like "visible" should do the job to hide the tab. But they don't in fact. It looks like a bug. I'd suggest opening a support case.

    Tuesday, September 30, 2014 11:27 AM