Lok
(Lok Bharatendu)
August 2, 2012, 11:40am
1
Hi All,
Is there a way to scope shortcut to a layout (horizontallayout)?
I know they can be scoped to panels. As panels have vertical alignment of components and also have header bars by default, it doesn’t suits my requirement.
my layout is as follows: (Screenshot attached)
[Button >> Create New record]
[Text field ]
[Button search]
==============================================
Tab1 | Tab2
Please suggest this can be achieved
Regards,
Lok Bharatendu
Lok
(Lok Bharatendu)
August 6, 2012, 2:35pm
2
Hi all,
I have found a solution for this.
It can be done as follows:
Create new Panel and set custom class
Panel panel = new Panel();
panel.setStyleName(“horizontal-panel”);
Create one horizontallayout
HorizontalLayout hl = new HorizontalLayout();
hl.setSpacing(true);
set panel content
panel.setContent(hl);
Add your components on horizontallayout
hl.addComponent(myComponent1);
hl.addComponent(myComponent2);
hl.addComponent(myButton);
add action to panel
panel.addAction(new ClickShortcut(searchButton, KeyCode.ENTER));
Add the following class to your css
.v-panel-horizontal-panel{
height: 30px;
border:0px solid;
background-image: url("") !important;
}
.v-panel-horizontal-panel .v-panel-content{
border:none;
}
.v-panel-nocaption-horizontal-panel{
display: none;
}
Regards,
Lok Bharatendu