none
Dynamic Menu under Split Button. RRS feed

  • Question

  • Hi,

    I want to display a SplitButton with a DynamicMenu under Outlook Ribbon.

    The dynamic menu is not allowed in SplitButton as direct child but we do support a Menu element, under which we can have a dynamic Menu.

    But, above workaround adds an extra Menu to display the Dynamic Menu somewhat like below (Note Highlighted Menu):

    I want to get rid of the extra menu that is being display. Kindly, let me know how do I achieve this?

    BTW the XML I am using is as follows:

    <splitButton id="SplitButton" size="large" >
       <button onAction="splitButton_Click" id="Track" tag="Track" getLabel="GetLabel" />
    <menu id="splitMenu" >
      <dynamicMenu id="TrackMenu" getContent="DynamicMenuContent" invalidateContentOnDrop="true" />
    </menu>
    </splitButton>

    Regards,

    Sachin R. Chavan.


    Sachin R. Chavan.

    Friday, January 22, 2016 8:28 AM

Answers

  • Hi Sachin,

    I don’t think it could meet your requirement even though the DynamicMenu could be under SplitButton. Based on my test, the dynamic content (getContent) need to be load when select/click that area/menu, you could debug to check this.

    >> My Menu Items are not known @ design time.

    You may try to change the ribbon XML before load it. (E.g. GetCustomUI method)

    Regards

    Starain


    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, January 26, 2016 2:54 AM
    Moderator

All replies


  • Sachin R. Chavan.

    Friday, January 22, 2016 8:29 AM
  • Hello Sachin,

    You can use the following Ribbon XML to get rid of the additional menu shown:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="ribbonLoaded" loadImage="getImages">
      <ribbon startFromScratch="false">
        <tabs>
          <tab getKeytip="getKeytip" getLabel="getLabel" getVisible="getVisible" id="RibbonTab_dc687bf980d143e5ba808f1c7f246215">
            <group getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonGroup_66d0384b81a04017856f3b35b941cf36">
              <splitButton getEnabled="getEnabled" getKeytip="getKeytip" getShowLabel="getShowLabel" getSize="getSize" getVisible="getVisible" id="RibbonSplitButton_b409e33c216f420a9a3f47e833323070">
                <button getDescription="getDescription" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getSupertip="getSuperTip" id="RibbonSplitButton_b409e33c216f420a9a3f47e833323070_wrapped" onAction="onActionCommon" />
                <menu getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getVisible="getVisible" id="RibbonMenu_a6a136580f0d4e0db30f7ce9fa156c5a" itemSize="normal">
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_9d5dd234339e4fe7b80c001d254a8b0f" onAction="onActionCommon" />
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_ad353afad11b48c79c5447bc63c2c97c" onAction="onActionCommon" />
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_0a62f17c7b1241b99b5751dc829e4089" onAction="onActionCommon" />
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_5e84464f8fca40a9a8be5867e17d8d8a" onAction="onActionCommon" />
                </menu>
              </splitButton>
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    Read more about the Fluent UI in the following series of articles:

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

    Friday, January 22, 2016 6:46 PM
  • Hi Sachin,

    Based on my test, that is the label of dynamicMenu, you don’t specify the label value of dynamicMenu, so it is empty. As far as I know, we can’t remove it.

    I suggest that you could specify label property of dynamicMenu to let the UI beautifully.

    Regards

    Starain


    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.

    Monday, January 25, 2016 5:47 AM
    Moderator
  • My Menu Items are not known @ design time. Hence, am using dynamic menu. The menu items are MRU items.

    So the Menu XML in your code snippet is not an option:

    <splitButton getEnabled="getEnabled" getKeytip="getKeytip" getShowLabel="getShowLabel" getSize="getSize" getVisible="getVisible" id="RibbonSplitButton_b409e33c216f420a9a3f47e833323070">
                <button getDescription="getDescription" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getSupertip="getSuperTip" id="RibbonSplitButton_b409e33c216f420a9a3f47e833323070_wrapped" onAction="onActionCommon" />
                <menu getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getVisible="getVisible" id="RibbonMenu_a6a136580f0d4e0db30f7ce9fa156c5a" itemSize="normal">
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_9d5dd234339e4fe7b80c001d254a8b0f" onAction="onActionCommon" />
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_ad353afad11b48c79c5447bc63c2c97c" onAction="onActionCommon" />
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_0a62f17c7b1241b99b5751dc829e4089" onAction="onActionCommon" />
                  <button getDescription="getDescription" getEnabled="getEnabled" getKeytip="getKeytip" getLabel="getLabel" getScreentip="getScreenTip" getShowImage="getShowImage" getShowLabel="getShowLabel" getSupertip="getSuperTip" getVisible="getVisible" id="RibbonButton_5e84464f8fca40a9a8be5867e17d8d8a" onAction="onActionCommon" />
                </menu>
    </splitButton>


    Sachin R. Chavan.

    Monday, January 25, 2016 8:43 AM
  • Do you allow an unlimited number of MRU items?

    If there is a max number of MRU items then you can use the menu XML as placeholders.  Use the callback methods to provide the required information for a MRU item that should be displayed in the menu.  For those menu items that are unused you can use the callbacks to populate them with default values but prevent them from appearing by setting visibility to false.

    Monday, January 25, 2016 11:29 AM
  • Tough not the elegant one in my case as it might involve lots of code changes, definitely will try the suggested option. I think it should work.

    Any plans to add the support for DynamicMenu under SplitButton in near future.


    Sachin R. Chavan.

    Monday, January 25, 2016 12:41 PM
  • Sachin,

    I don't think you might expect it working in the future. The Fluent UI is not changed since Office 2007. The Backstage UI and Context menus were added with Office 2010.

    Monday, January 25, 2016 2:00 PM
  • Hi Sachin,

    I don’t think it could meet your requirement even though the DynamicMenu could be under SplitButton. Based on my test, the dynamic content (getContent) need to be load when select/click that area/menu, you could debug to check this.

    >> My Menu Items are not known @ design time.

    You may try to change the ribbon XML before load it. (E.g. GetCustomUI method)

    Regards

    Starain


    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, January 26, 2016 2:54 AM
    Moderator