How to edit custom ribbon in Access 2013 - ms-access

I received an .accdb file and my task is to hide the "Home" tab on the ribbon in Access 2013. The only thing left should be the "Add-ins" tab with already present custom buttons.
I have received some advice suggesting that there might be a custom ribbon that could be edited to accomplish this. However, I have no idea where to find it and start editing. Can it be done somewhere in the design mode, or should I use Visual Studio? Can the Custom UI Editor hack an existing XML structure of an accdb?
Thanks for any input.

As a general rule, you will find the ribbon customizations in a table called USYSRibbons.
The xml to hide home, and much everything in the ribbon would thus look like:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<officeMenu>
<!-- First we hide all the items displayed by default -->
<control idMso="FileNewDatabase" visible="false"/>
<control idMso="SourceControlCreateDatabaseFromProject" visible="false"/>
<control idMso="FileOpenDatabase" visible="false"/>
<control idMso="FileSave" visible="false"/>
<control idMso="ConvertDatabaseFormat" visible="false"/>
<control idMso="FileSaveAsMenuAccess" visible="false"/>
<control idMso="FileManageMenu" visible="false"/>
<control idMso="FileSendAsAttachment" visible="false"/>
<control idMso="MenuPublish" visible="false"/>
<control idMso="FileServerMenu" visible="false"/>
<control idMso="FileCloseDatabase" visible="false"/>
<control idMso="FileExit"
getVisible="HideExit"
getEnabled="EnableExit" />
<!-- Now let's show a single Print Command -->
<control idMso="FilePrintMenu" visible="false"/>
</officeMenu>
</ribbon>
</customUI>
There is no built in editor for custom ribbons (but as noted, you can right click on ribbons and customize them).

Open the database, go to "File" in the upper left corner, then click options.
Go to the tab "Customize Ribbon", there you can deselect the main tabs.

Related

p:autocomplete stops working after updating parent via ajax

I have a list of autocompletes that is rendered using a p:dataList. Something like shown below:
<h:panelGroup layout="block" id="outerPanel">
<p:dataList rendered="#{bean.myModel.listOfItems.size()>0}"
var="additionalMP"
value="#{bean.myModel.listOfItems}"
rowIndexVar="index" emptyMessage="">
<div class="wrapper ui-g">
<div>
<p:autoComplete
cache="true"
value="#{bean.myModel.listOfItems[index]}"
completeMethod ="#{handler.getAutoCompleteData}"
rendered ="true"
required="false"
scrollHeight="200"
styleClass="custom"
forceSelection="true">
<p:ajax event="query" global="false"/>
<f:attribute name="filter" value="filterName" />
<f:attribute name="mode" value="edit" />
</p:autoComplete>
</div>
<div>
<p:commandLink value="+ Add" actionListener="#{bean.addAutoComplete()}"
update=":formName:outerPanel"></p:commandLink>
</div>
</div>
</p:dataList>
</h:panelGroup>
So, the Add button inserts a new item in the list and I update the container panel so that the newly added item can be rendered on the UI.
As expected the panel is updated and I see another autocomplete on the UI. But the problem is, all the auto completes now don't work. i.e. they stop firing the query event and don't give any suggestions.
Edited: The partial response that updates the section of form with autocomplete fields, contains some script tags, which probably execute on page ready/load event. So I know that basically the newly added prime faces widgets are not being initialized.
Any idea how I can initialize the newly added autocompletes in the DOM?
The reason for all this trouble was an error in javascript that was caused by trying to scrollTo a particular element on the page from the bean. This crappy line of code in the bean was the source of all the trouble. There was no element on the page with the id messages. A glaring example of why UI should not be coupled in such a way.
RequestContext.getCurrentInstance().scrollTo("formId:messages");

Can I use CSS to change the colour/gradient etc of a telerik html chart?

I currently have a column chart which uses the default appearance. I understand that I can change the appearance of the chart in the html but I was wondering if I can use a css class to define all of this and if so how?
<div class="row">
<div class="col-md-4">
<telerik:RadHtmlChart runat="server" ID="ColumnChart" Transitions="true">
<ClientEvents OnSeriesClick="OnChartClick" />
<PlotArea>
<Series>
<telerik:ColumnSeries DataFieldY="Count" Name="Product" />
</Series>
<Appearance>
<FillStyle BackgroundColor="Transparent" />
</Appearance>
<XAxis DataLabelsField="Product" />
<YAxis>
<TitleAppearance Position="Center" RotationAngle="0" />
</YAxis>
</PlotArea>
<Legend>
<Appearance Visible="false" />
</Legend>
</telerik:RadHtmlChart>
</div>
[...]
I send the data to the chart by setting a DataTable equal to the DataSource property of the chart. Thus, if a new product is added to the DataTable I would like it to use the extra data without me having to edit the html too. I need the chart to use standard colours which are set by regulation can I assign these via a stylesheet?
http://docs.telerik.com/kendo-ui/styles-and-layout/appearance-styling
Check out this Link, this might can help you.

cockpit configuration not being picked up

I created my own cockpit from the ycockpit template, called TestCockpit. When I log into this cockpit, a List of Orders is displayed on the browser area.
I've configured the listView and the editorArea, both using XML files according to convention. The files are named listViewContentBrowser_Order.xml and editorArea_Order.xml, and are both placed under the folder for the ordermanagergroup user group.
When I run an update running system, the listView is affected by my configuration but the editorArea not.
This is what my editorArea config file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<editor>
<group qualifier="General" visible="true" initially-opened="true">
<label key="testcockpit.config.label.properties"/>
<property qualifier="Order.code"/>
<property qualifier="Order.user"/>
<property qualifier="Order.currency" visible="false"/>
<property qualifier="Order.date"/>
<property qualifier="Order.displayStatus"/>
</group>
<group qualifier="admin" visible="true" initially-opened="false">
<label key="cockpit.config.label.administration"/>
<property qualifier="Item.pk" />
<property qualifier="Item.creationTime" />
<property qualifier="Item.modifiedtime" />
</group>
<custom-group
class="de.hybris.platform.cockpit.services.config.impl.UnassignedEditorSectionConfiguration"
qualifier="unassigned"
initially-opened="false">
<label key="cockpit.config.label.other"/>
</custom-group>
</editor>
Any ideas why my configuration doesn't affect the cockpit? I do log in with a user from the ordermanagergroup, by the way.
Try clicking on "Menu" (top left in your cockpit), then selecting "User Settings" and "Reset Personalized Settings".

Primefaces tab not updating properly

I have a dialogue with a commandButton, and this is what I'm trying to do:
Do some Java work
Update a Primefaces tab
Make my dialogue box disappear
Go to that certain tab.
This is the code I'm using:
<p:commandButton value="Submit"
action="<some java work>"
oncomplete="dialogue.hide(); sideTabs.select(1)"
update="<update side tab">
</p:commandButton>
The problem is, this only works once between refreshes. What I mean is, I click the button, and everything works fine-the tab changes to the requested tab, the tab is updated, and the dialogue disappears. But when I click the button again, the requested tab is indeed selected, but isn't properly refreshed until I hit f5. Once I do that, I can click the dialogue button again and the tab will properly refresh again, but once again, only once - until I hit f5 again. So, something like this:
Click the button -> see 1 item in the tab
Click the button again -> still see only 1 item in the tab
Hit f5 -> see 2 items in the tab
Click the button -> see 3 items in the tab
Click the button again -> still see 3 items in the tab
Hit f5 -> see 4 items in the tab
etc...
Does anyone have an idea why this is happening? Do I need to add some page refresh mechanism to my commandButton? If so, how is this done?
Thanks!!!
I've tried to replicate the problem with no success.
Here is a the attribute from my ViewScoped bean:
private String str1 = "a";
private String str2 = "b";
private String update = ":f:t";
private Integer index = 0;
And here is the view:
<h:form id="f">
<p:tabView id="t" widgetVar="tVar" activeIndex="#{viewMBean.index}" >
<p:tab id="a" title="A" >
#{viewMBean.str1}
</p:tab>
<p:tab id="b" title="B">
#{viewMBean.str2}
</p:tab>
</p:tabView>
</h:form>
<p:dialog id="d" widgetVar="dVar">
<h:form>
<p:inputText value="#{viewMBean.str1}" />
<br />
<p:inputText value="#{viewMBean.str2}" />
<br />
<p:inputText value="#{viewMBean.update}" />
<br />
<p:inputText value="#{viewMBean.index}" />
<br />
<p:commandButton value="Submit" update="#{viewMBean.update}" oncomplete="dVar.hide();" />
</h:form>
</p:dialog>
I believe the problem is somewhere else in your code.

Hide Access Options

I have noticed that even though when you disable the “Use Access Special Keys”, disable the “Display Navigation Pane”, and disable the ribbon menus, you can easily access the “Access Options” go to the current Database area, and re-enable all these options.
Is there a way to completely hide the “Current Database” option in Access 2007 and 2010?
In MS Access 2007 and MS Access 2010, rather than setting options to control a user's access to the application, it is possible to control the contents of the "Backstage". All images and instructions apply to Access 2010, but 2007 is not very different. Read Customize the Ribbon first.
Backstage
First, right-click the Navigation Bar at the top of the Navigation Pane, and then click Navigation Options on the shortcut menu. In the Navigation Options dialog box, under Display Options, select the Show System Objects check box, and then click OK. This will allow you to see the table you create. Note that is applies to all databases, so you may wish to switch it back off when you are finished.
Next, under Options, choose Client Settings and scroll down to General. You will see Show add-in user interface errors, make sure it is selected.
You will need a table called USysRibbons:
Create Table USysRibbons (ID Counter Primary Key,
RibbonName Text(255),RibbonXml Memo)
You might like to add a unique index to RibbonName, otherwise you could end up with more than one ribbon with the same name.
You will need some XML, you can just cut and paste into the newly created table.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<!-- Ribbon XML -->
</ribbon>
<backstage>
<button idMso="FileSave" visible="false"/>
<button idMso="SaveObjectAs" visible="false"/>
<button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
<button idMso="FileOpen" visible="false"/>
<button idMso="FileCloseDatabase" visible="false"/>
<tab idMso ="TabInfo" visible="false"/>
<tab idMso ="TabRecent" visible="false"/>
<tab idMso ="TabNew" visible="false"/>
<tab idMso ="TabPrint" visible="false"/>
<tab idMso ="TabShare" visible="false"/>
<tab idMso ="TabHelp" visible="false"/>
<button idMso="ApplicationOptionsDialog" visible="false"/>
<button idMso="FileExit" visible="false"/>
</backstage>
</customUI>
Set the Ribbon Name to say, "BackstageCustom". It should be fairly obvious which line relates to which part of the Backstage.
You now have to close and reopen the database (Compact & Repair is probably the quickest way to do this, but make sure you have a backup before you use this method). There will be a lot of opening and closing in this.
You can now go to Options->Current Database and scroll down to Ribbon and Toolbar Options, select the newly created ribbon under Ribbon Name. When you close Options, you will get a warning that you must close and open the database for the changes to take effect.
When you do, you will no longer be able to see Options on the backstage, nor will you see much except a list of recent databases. Look at the XML above, you can see that everything is set to false.
I reckon the easiest way out of the situation is to open the USysRibbons table and change this line:
<button idMso="ApplicationOptionsDialog" visible="false"/>
to
<button idMso="ApplicationOptionsDialog" visible="true"/>
Open and close again, and remove the ribbon from Ribbon Name, under Options. Open and close and you are back to where you started, more or less.
To add to Fionnuala's excellent answer, Access 2013 has different options in the FILE menu so the XML needs to be slightly modified. Follow the answer exactly but replace the XML with this, which hides the Options menu and leaves Print and Exit.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<!-- Ribbon XML -->
</ribbon>
<backstage>
<button idMso="ApplicationOptionsDialog" visible="false"/>
</backstage>
</customUI>
All,
I've spent a lot of time ... on a lot of websites ...
Here's XML that will:
Disable QAT
Disable "Database Options"
Disable "Save As"
Disable "Close" (so you can programmatically control what happens)
Enable only the "Home" TAB ... I actually rebuilt it from scratch
This code pretty much "exactly" looks like the standard "HOME" tab in MS Access 2013.
You can use this to really lock down your app ... in combination with some good code to disable special keys at startup, etc.
Here ya go:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
<!-- Ribbon XML -->
<tabs>
<tab id="dbCustomHome" label="HOME" visible="true">
<group id="dbViews" label="Views">
<control idMso="ViewsSwitchToDefaultView" size="large" label="View" enabled="true"/>
</group>
<group id="dbClipboard" label="Clipboard">
<control idMso="PasteSpecial" size="large" label="Paste" enabled="true"/>
<control idMso="Cut" label="Cut" enabled="true"/>
<control idMso="Copy" label="Copy" enabled="true"/>
<control idMso="FormatPainter" label="Format Painter" enabled="true"/>
</group>
<group id="dbSortFilter" label="Sort and Filter">
<control idMso="FiltersMenu" size="large" label="Filter" enabled="true"/>
<control idMso="SortUp" label="Ascending" enabled="true"/>
<control idMso="SortDown" label="Descending" enabled="true"/>
<control idMso="SortRemoveAllSorts" label="Remove Sort" enabled="true"/>
<control idMso="SortSelectionMenu" label="Selection" enabled="true"/>
<control idMso="FilterAdvancedMenu" label="Advanced" enabled="true"/>
<control idMso="FilterToggleFilter" label="Toggle Filter" enabled="true"/>
</group>
<group id="dbRecords" label="Records">
<control idMso="DataRefreshAll" size="large" label="Refresh All" enabled="true"/>
<control idMso="GoToNewRecord" label="New" enabled="true"/>
<control idMso="RecordsSaveRecord" label="Save" enabled="true"/>
<control idMso="Delete" label="Delete" enabled="true"/>
<control idMso="RecordsTotals" label="Totals" enabled="true"/>
<control idMso="SpellingAccess" label="Spelling" enabled="true"/>
<control idMso="RecordsMoreRecordsMenu" label="More" enabled="true"/>
</group>
<group id="dbFind" label="Find">
<control idMso="FindDialog" size="large" label="Find" enabled="true"/>
<control idMso="ReplaceDialog" label="Replace" enabled="true"/>
<control idMso="GoToMenuAccess" label="Go To" enabled="true"/>
<control idMso="SelectMenuAccess" label="Select" enabled="true"/>
</group>
<group id="dbTextFormat" label="Text Formatting" centerVertically="true">
<box id="TopBx">
<control idMso="Font" enabled="true"/>
<control idMso="FontSize" enabled="true"/>
<buttonGroup id="buttonGroup_TopRow">
<control idMso="Bullets" enabled="true"/>
<control idMso="Numbering" enabled="true"/>
<separator id="separator1" />
<control idMso="IndentIncrease" enabled="true"/>
<control idMso="IndentDecrease" enabled="true"/>
<separator id="separator2" />
<control idMso="AlignLeftToRightMenu" enabled="true"/>
</buttonGroup>
</box>
<box id="BottomBx">
<buttonGroup id="buttonGroup_BottomRow">
<control idMso="Bold" enabled="true"/>
<control idMso="Italic" enabled="true"/>
<control idMso="Underline" enabled="true"/>
<separator id="separator3" />
<control idMso="FontColorPicker" enabled="true"/>
<control idMso="TextHighlightColorPicker" enabled="true"/>
<control idMso="FontFillBackColorPicker" enabled="true"/>
<separator id="separator4" />
<control idMso="AlignLeft" enabled="true"/>
<control idMso="AlignCenter" enabled="true"/>
<control idMso="AlignRight" enabled="true"/>
<separator id="separator5" />
<control idMso="DatasheetGridlinesMenu" enabled="true"/>
<separator id="separator6" />
<control idMso="FontAlternateFillBackColorPicker" enabled="true"/>
</buttonGroup>
</box>
</group>
</tab>
</tabs>
</ribbon>
<backstage>
<tab idMso="TabSave" visible="false" > </tab>
<button idMso="ApplicationOptionsDialog" visible="false"/>
<button idMso="FileCloseDatabase" visible="false"/>
</backstage>
</customUI>
Because there remains a backdoor entrance to the access options by using [Quick Access Toolbar] - [Customization], an other simple solution using the same way as Fionnuala could be:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<commands>
<command idMso="ApplicationOptionsDialog" enabled="false"/>
</commands>