How to add a button to the Action menu? - odoo-8

I want to add new button in action

Use key2="client_action_multi" in act_window to add submenu to "Action" button ("More" in previous Odoo versions). Reference here
<act_window name="New Sub menu"
res_model="product.product"
src_model="product.product"
key2="client_action_multi"
view_mode="form" target="new"
view_type="form"
id="act_new_sub_menu" />

Related

Hamburger menu AutomationId for UI Testing

I'm trying to run a UI Test on a page (About.xaml).
Below are the steps to get to the page when the application loads.
Launch the Login Screen
User enters username
User enters password
User clicks on the Login Button
User lands on the Home Page in an AppShell.
User clicks on the Hamburger menu
User clicks on the About Menu in the Flyout Menu Items.
My question is, how do I set the Automation Id for the Hamburger Menu (Flyout Menu) of the AppShell?
Here's the UI Test Case.
[Test]
public async Task AboutPage_UITest()
{
//Arange
app.EnterText("UsernameEntryId", "user1");
app.EnterText("PasswordEntryId", "Abc#123");
//Act
app.DismissKeyboard();
app.Tap(x => x.Marked("LoginButtonId"));
app.Tap(x => x.Marked("AppShellId"));
//app.Tap(c => c.Class("OverflowMenuButton")); I tried this as well but no luck.
await Task.Delay(30000);
app.Tap(x => x.Marked("AboutId"));
//Assert
var appResult = app.Query("EmailId").First(result => result.Text == "abc#example.com");
Assert.IsTrue(appResult != null, "Label is not displaying the right result!");
app.Screenshot("About Page");
}
In the AppShell.xaml, here's the top section.
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
FlyoutHeaderBehavior="CollapseOnScroll"
Shell.ItemTemplate="{StaticResource FlyoutTemplate}"
Shell.MenuItemTemplate="{StaticResource FlyoutTemplate}"
FlyoutBackgroundColor="WhiteSmoke"
Navigating="OnNavigating"
Navigated="OnNavigated"
AutomationId="AppShellId"
x:Class="DemoApp.AppShell">
Welcome to SO!
After researching that , you can use follow ways to set the AutomationId for the Hamburger Menu.
In AppShell.xaml.cs:
public AppShell()
{
InitializeComponent();
FlyoutIcon.AutomationId = "FlyoutIcon";
//or
FlyoutIcon.SetValue(AutomationProperties.NameProperty, "FlyoutIcon");
}
Note: Also need to set a value for FlyoutIcon(Such as: FlyoutIcon="xxx.png") make it work, otherwise above code will occur error System.NullReferenceException: 'Object reference not set to an instance of an object.'.
In addition, here it the way to go to About Page without tapping the Hamburger menu.
You can add TabBar to AppShell.xaml, and defining the About page and other page inside it.
Such as follow:
<TabBar>
<Tab Title="About"
AutomationId="About"
Icon="tab_about.png">
<ShellContent>
<local:AboutPage />
</ShellContent>
</Tab>
<Tab Title="Browse"
AutomationId="Browse"
Icon="tab_feed.png">
<ShellContent>
<local:ItemsPage />
</ShellContent>
</Tab>
</TabBar>
Then in Test method can navigate to your wanted page as follow:
app.Tap(x => x.Marked("About"));
Or, directly in Xaml, like this:
<Shell.FlyoutIcon>
<FontImageSource AutomationId="THE_ID_YOU_WANT" ... other props />
</Shell.FlyoutIcon>
You can also use FileImageSource or UrlImageSource or whatever kind you need. The important thing is that the AutomationId goes on the ImageSource tag itself.
Annoyingly, you don't seem to be able to set the AutomationId without manually defining an icon. And the Id it gives you is not consistent every run (Sometimes it is "OK" and sometimes "Open navigation drawer" - so this is the best way to get a consistent Id.

How do I show a Next button on Sencha NavigationView?

Sencha adds a nice Back button to the navigation bar. As shown below.
So my questions are:-
How can I dynamically add the Next button to the navigation bar?
How do I style the Next button to have a triangular edge, similar to what the Back button has?
You can change appearance of button to look alike forward button by setting ui : "forward" config for button.
You can add buttons to navigation bar with following way -
navigationBar : {
items:[
{
xtype:'button',
text:'Forward',
ui:'forward'
}
]
},
You can also add buttons dynamically to navigation bar from controller. First get instance of navigation view and then navigation bar. Create some buttons and add them to it.
var navBar = this.getMyNavView().getNavigationBar();
var button = Ext.create('Ext.Button', {
text: 'Button'
});
navBar.add(button);
update
Found this issue for ui : 'forward' on sencha forum. Have a look at it.
http://www.sencha.com/forum/showthread.php?253899-When-using-ui-forward-and-back-the-buttons-are-not-being-rendered-properly

How to reset telerik dropdownlist control value on client side

I want to reset dropdownlist selection on clear button click and set default message.
<telerik:RadDropDownList ID="radDrpDwn_User" runat="server" Width="325px" DefaultMessage="--select--">
</telerik:RadDropDownList>
First of all there isn't any control in telerik called (RadDropDownList) , the compatible control is RadComboBox control
so you define it using the Following ;
<telerik:RadComboBox ID="radDrpDwn_User" runat="server" Width="325px" DefaultMessage="--select--">
</telerik:RadComboBox>
and in the clear Button :
protected void Clear_Click(object sender,EventArgs e)
{
radDrpDwn_User.ClearSelection();
}
regards

How do I remove the Office-like button, but keep the ribbon?

How do I remove the Office-like button, but keep the ribbon?
In your CMainFrame class declare the ribbon button:
private:
CMFCRibbonApplicationButton m_wndRibbonButton;
Then in the OnCreate method, set the button visibility and assign it to the ribbon bar:
m_wndRibbonButton.SetVisible(FALSE);
m_wndRibbonBar.SetApplicationButton(&m_wndRibbonButton, CSize());
This is what you'll get:

Magento - hide the buttons "Reset Filter" and "Search"

how can I hide the buttons "Reset Filter" and "Search" in a custom module grid ?
Thanks.
Hide filter buttons only
To only hide "Reset filter" and "Search" buttons, but keep the header filter fields, you could override Mage_Adminhtml_Block_Widget_Grid::getMainButtonsHtml() with:
public function getMainButtonsHtml()
{
return '';
}
Hide filter buttons and header filter fields
If you want to hide the whole filter stuff, "Reset filter", "Search" button and the header filter fields, you could use the setFilterVisibility() method of Mage_Adminhtml_Block_Widget_Grid:
$this->setFilterVisibility(false);
You can control individual buttons with:
protected function _prepareLayout()
{
$this->unsetChild('reset_filter_button');
$this->unsetChild('search_button');
}
There is also an export_button child too.

Resources