Custom-UI: Force Developer-Tab to be visible - ms-word

I have a MS-Word template where the user sometimes will have to edit content controls.
Therefore I would like to force the developer tab to be visible whenever a document based on this template is opened.
I changed the CustomUI:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab idMso="TabDeveloper" visible="true" />
</tabs>
</ribbon>
</customUI>
No error is thrown when the document is opened - but the Developer tab isn't visible.
Any thing else I have to consider, to force the tab to be visible?
(Vice versa works: hiding a visible Developer-Tab by setting visible to false)
(There is no VBA attached to the document.)

OK - sometimes a short break helps:
I am adding a custom tab containing the relevant buttons from the developer tab. Plus: renaming them :-)
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="Abnahme" label="Abnahmedokument">
<group id="x" label="Eingabefelder">
<button idMso="ContentControlText" label="neues Eingabefeld" size="large"/>
<button idMso="ControlProperties" label="Eingabefeld bearbeiten" size="large"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

I know of no method other than user education.
You could, in your distribution template, add your own duplicate tab or a tab that has the controls for Content Controls. Better practice is probably to put the Content Control tools on your own additional tab and ignore the Developer Tab.
See also Hide/Show all tabs on Ribbon except Custom tabs which also says there is no method available via VBA.
The following caveat is for someone finding your question in a web search and thinking about using the Word.OfficeUI file and finding this question in a web search. It does not appear that you are doing that.
For customization distribution, the UI editor in Word is a very poor tool. It is intended for personal use.
The Word.OfficeUI file produced by Word will overwrite any user customizations including QAT customizations. Placing that on a user's computer is mean and dictatorial just like overwriting the Normal template. It is a bad practice.
For distribution, you should be editing the XML of a global template. Likewise, such a template is the best method of distributing other user interface customizations like macros and building blocks. The methods for doing this are explored in the book RibbonX: Customizing the Ribbon User Interface and on Greg Maxey's page: Customize the Office Ribbon: It doesn't take rocket science.

Related

Bind command to hub section header click in Windows 10 Universal App

Suppose I got a hub page (HubPageView) and a couple of hub sections inside that page e.g.
<Hub Header="{Binding AppName}">
<HubSection IsHeaderInteractive="True"
Header="Section 1">
...
</HubSection>
...
</Hub>
When rendered the above shows as "Section 1 See more" and I take it that if the user taps "See more" the app is supposed to navigate to, say, Section1PageView.
I'm trying hard to follow the MVVM pattern so I'd like to bind the tap to a command (NavigateToSection1Command) instead of using the ItemClick event - how do I accomplish this?
The Hub class has a SectionHeaderClick event to which you could attach an EventTriggerBehavior and bind your Command to it.
<Page xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
<Hub Header="{Binding AppName}">
<i:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="SectionHeaderClick">
<core:InvokeCommandAction Command="{Binding NavigateToSectionCommand}" />
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
</Hub>
</Page>
The SectionHeaderClick is the event that MS put for us to interact with the Hub Header, but the way it works will make MVVM's life harder. You see, that event passes the Section object that was clicked as an argument. You will lose that by attaching a command, as there is no built in way to pass an event argument to a command and there will be no way to tell which section the command was fired from.
That being said, I think that placing a Button or TextBlock at the HubSection's Header and attaching a EventTriggerBehavior to it`s Click event would better suit your needs.
Ps: You will have to add a Reference to the Behaviors SDK. Go to Add References > Universal Windows > Extensions, then check Behaviors SDK (XAML)

XPages Typeahead autocomplete behavior

In XPages Mobile controls I'm having a problem with Typeahead. Actually I think the behavior changed recently - maybe with the last update of the Ext. Library but I'm not sure. Thats when we noticed the change by the way. Is has been working as desired.
Below are 2 screenshots. The first one is on a normal XPage and the second is inside Mobile Controls.
Notice how the user starts typing a "D" in the first one there's no "autocomplete". But in the second screenshot the user typed a "D" and it immediately added in the first value which in this case starts with an "O". It replaced the "D" that the user typed.
(The fact that the record with the beginning "O" is showing is working as designed, so ignore that.)
The problem is I don't want that autocomplete happening at all. I want the behavior of the first screenshot inside mobile controls. so the user can keep typing and it'll will continue to filter the list and not overwrite what the user entered.
I'm fairly certain it used to do that and I don't know what changed. The code itself did not change - that I know.
I've attempted to set autocomplete and autocorrect to "off" without any luck. I'm not sure what the difference is or if they even truly come into play.
How can I get the field to not auto-fill inside of Mobile Controls?
Any advice would be appreciated. I should note that this is privately going to be used on iPads. So it's the Mobile Safari browser.
Thanks!
Here is the basic code for this:
<xp:inputText id="inputJobCode" value="#{viewScope.selectedJob}"
styleClass="target span9">
<xp:this.attrs>
<xp:attr name="placeholder" value="Job Code" />
<xp:attr name="autocorrect" value="off" />
<xp:attr name="autocomplete" value="off" />
</xp:this.attrs>
<xp:this.dojoAttributes>
<xp:dojoAttribute name="autocorrect" value="off" />
<xp:dojoAttribute name="autocomplete" value="off" />
</xp:this.dojoAttributes>
<xp:typeAhead mode="partial" minChars="1" valueMarkup="true"
var="searchValue" valueList="#{javascript:return com.companyname.datahub.TypeAhead.jobTypeAhead(searchValue);}">
</xp:typeAhead>
<xp:eventHandler event="onchange" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:var key:String = viewScope.get("selectedJob");
getComponent("inputJobCode").setValue("");
//JobData.load(key);
}]]></xp:this.action>
</xp:eventHandler>
</xp:inputText>
Here is what the output HTML is from the mobile control page:
<input type="text" id="view:_id1:checkOutFacilityID_content:_id4:inputText5"
name="view:_id1:checkOutFacilityID_content:_id4:inputText5" autocomplete="off"
class="mblTextBox target" placeholder="Job Code" autocorrect="off"
dojotype="extlib.dijit.mobile.TypeAheadCombo"
store="view__id1_checkOutFacilityID_content__id4__id9" data-dojo-
props="list:'view__id1_checkOutFacilityID_content__id4__id9', searchAttr:'value',
labelAttr:'label', labelType:'html'" spellcheck="false" tabindex="0" lang="en"
widgetid="view:_id1:checkOutFacilityID_content:_id4:inputText5" value="">
I got an answer for this from the Maire at IBM.
There was a change made in a recent Ext. Library update regarding Type Ahead. The solution for now is to use dojo to add a setting. Here's the email that IBM sent me.
Hi David,
The mobile typeAhead behavior changed in the release 901v00_04.20140226-1506
For details of the changes, see the section "Improvements to XPages TypeAhead control support" in the readme.pdf for that release.
I'm reproducing the behavior you're talking about, and I've logged an SPR:
SPR#MKEE9L7E9BLink XPages, Mobile TypeAhead, first item in the dropdown is being inserted into the edit box (should not be)
To workaround the issue:
The workaround is to write a script changing the edit box behavior,
so insert this control into your XPage, and change the name inputText1 to match your edit box's name:
<xp:panel id="panel1">
<xp:eventHandler event="onClientLoad" submit="false">
<xp:this.script><![CDATA[dijit.byId('#{id:inputText1}').autoComplete=false;/*Note autoComplete=false is different to autocomplete=off*/ ]]></xp:this.script>
</xp:eventHandler>
</xp:panel>
Regards,
Maire
I note the dojoType added to mobile - dojotype="extlib.dijit.mobile.TypeAheadCombo". It sounds like that makes it a mixture of a combo box and typeahead, which explains the functionality you're seeing.
Does it work if you add that Dojo Attribute to the non-mobile one?

Windows Store App: Eliminates GridView styles and use only for hub page layout

I try to make a Windows Store App (Metro) hub page which has four different templates with GridView.
I referenced link in Creating hub page with different controls in Windows 8 page and it works fine.
But GridView has a default style which interacts with touch(and mouse) activity.
It grayed when hover, and shows click interaction.
My question is, how to disable those behaviors?
I tried to dig with Blend but hard to find the place to be customized.
Sorry I don't know MS Blend
But in visual studio please follow below instruction :
right click on your grid
go to Edit Additional Template
click on 'Edit Generated Item Container(ItemContainerStyle)' > 'Edit a Copy...'
go to XAML code and remove the PointerOver content from your code. the code should be like the following
//some code here
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOverPressed"/>
<VisualState x:Name="Disabled">
//continue

Removing a view from Eclipse Window -> Show views

We have an application in which some views only work when attached to certain perspectives.
We want to remove those views from the Window -> Show View dialog so that users cannot add them to perspectives where they don't work.
Any ideas on how to do this either programmatically or declaratively?
I have tried using <visibleWhen />, but the views are still showing in the dialog:
<view class="com.mycompany.ViewClass"
id="com.mycompany.ViewId"
name="View Name"
restorable="true">
<visibleWhen>
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="com.mycompany.MyPerspective"/>
</with>
</visibleWhen>
</view>
I don't think there is any problem with the <visibleWhen /> clause, so I'm wondering if it can be used with a View?
It should be treated as a menu contribution, using the <visibleWhen/> to only display that option when a certain condition is met.
See the wiki article "Menu Contribution" for more.
Unfortunately, it seems that Eclipse already does this for the Introduction view by calling the private ViewContentProvider.removeIntroView on the content provider for the Show Views dialog. A way to get around this limitation is to define activities by adding to the org.eclipse.ui.activities extension point (see activityPatternBinding on how activities can be mapped to UI contributions). Doing this will not only remove the views from the Show Views dialog, but it will also prevent them from showing in the perspectives themselves. The views can then be shown programmatically. I had to also enable the activities in the ApplicationWorkbenchAdvisor.preStartup method because of limitations in our application:
Set<String> activityIds = new HashSet<String>();
activityIds.add("com.my.activity.id");
IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
activitySupport.setEnabledActivityIds(activityIds);
In this case, the activity has to be disabled before showing the dialog, so the Show Views menu contribution has to be modified to do this as well.
Hopefully an extension point will be added to the next version of Eclipse to provide the option for developers to remove views from the dialog declaratively.

SharePoint Navigation Menu - Multi Level

I'm looking into integrating some Telerik Components into our MOSS Installation. I'd figure I would kill a few birds with one stone and work on the Navigation Menu first.
I'm slightly new to SharePoint, and pulling hair at some of it's oddities.
We have some requirements for our Navigation menu:
Security Trimmed
Multi-Level Navigation
As best as I can tell, there doesn't seem to be a way to get security trimming without using SharePoint's out of the box Navigation Settings. Am I wrong?
Is there a way to get these Navigation Settings to go more than two levels deep?
EDITS
I'm using the Global Navigation, located at / > Site Settings > Modify Navigation
Haven't used the Telerik control.
I suspect you should be able to accomplish this with basic properties, something like StaticDisplayLevels="2" with 2 being the number you want.
The security I believe would be handled on your datasource that the control uses.
Again, I haven't used the telerik control so I'm sure it's a bit different, looking at the product info for this control it appears to be a matter of figuring out what the properties are that you need to adjust. There must be some documentation that came with it?
Savageguy is correct that you modify this on the datasource, an example:
<PublishingNavigation:PortalSiteMapDataSource
ID="MainNavigationDataSource"
runat="server"
EnableViewState="true"
SiteMapProvider="GlobalNavSiteMapProvider"
StartingNodeOffset="0"
ShowStartingNode="false" />
and then you can use any sort of control (databound) to render your menu. I´m using a repeater for my menu:
<asp:Repeater runat="server" ID="MenuRepeater"
DataSourceID="MainNavigationDataSource">
you are not required to use any other components other than SharePoint Menu but you have to add a small piece of script in the body tag:
< body onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">