Vaadin 23 add the common part of several Views into content part of AppLayout - vaadin

I have MainLayout defined (extended from AppLayout), where I have configured Header and Drawer. Also, I have 3 different views which use MainLayout via #Route annotation.
There is some similarity between such 3 views - they have the common tabs at the top of the content area. Is it possible somehow to add such tabs into MainLayout content area? Or inside of AppLayout I may only add something to Header and Drawer only? How to properly implement such common tabs for these 3 views ? Right now I added duplicates of these tabs into each of the view and they don't work as expected(incorrect highlighting of selected tab). How to make them common for 3 views ?

I created one more layout class with #ParentLayout(MainLayout.class) annotation and derived from VerticalLayout implements RouterLayout. Inside this layout I added my tabs. Now, for each of the mentioned in the question views, I use this new Layout.

Related

How to change GridView in MVC View Layout pages

I have customer table that has 20 columns. And using EntityFramework I created a controller than a View. Everything works well. Only Index.cshtml page it is larger than I expected. From left to right I have to bottom scroll.
My layout uses standard MVC GridView. Is it possible to change the grid view to something different like a ListView?
Kind Regards

Left side is a treeview menu and right side need to be the content

I'm developing a ASP.NET MVC5 razor project and I have a cshtml divided into two parts, left part has a div with a treeview with options like a menu and the right part is a div that I would like to load cshtml that correspond to the option selected in treeview, ¿how can I do to achieve this?
Thanks
I am making the assumption that this is a simple navigation that is consistent amongst all pages, for which you can put the common navigation in the _Layout.cshtml. This file contains all the common , , tags used for each page. If you put your navigation in here then it will also be displayed on each page.
The navigation options can then link to your normal actions which display the corresponding views within the layout page.
In this tutorial the author discusses adding a simple navigation (in the section "Using a Layout for common site elements") in the _Layout with the difference that the navigation is at the top and not at the side. You can use css to style the page differently.

MVC - Have View affect sections of main layout

I've created a layout with all the styling etc. I have a menu and sub menu here, also a 3 column layout for content.
The left column will be used as a filter for reports most of the time, center for main content and the right column for help tips depending on the view you're at.
Can I define what the links in the sub menu are?
What is populated in the Left and Right columns, depending on the current view?
If you're looking to add new content in those areas, you want to be looking at sections.
You can see an example of this in the default project, just do a file-new-project to check out the layout page. You'll want something like this in your layout:
#RenderSection("SideBar", false)
The false here lets you opt-out of putting sidebar content on a view.
Your view would then have something like this:
#section SideBar {
// your sidebar stuff
}
As always, the Gu knows best: http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx
Cheers.

jQuery UI tabs - how to change tab position

I have created tab layout as in this example http://jqueryui.com/demos/tabs/#bottom with controls bellow the panel. I have 3 default tabs, which can't be delted and than user can add some more tabs and also delete them.
The problem is that the default tabs should be on the top like there http://jqueryui.com/demos/tabs/#default so because UI doesn't support two control panels, I have created new element looking like control panel on top <p class="ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top tabs-header-top"></p> with fixed heigth. But now I don't know how to move the default tabs to the right position. I tried adding them position: relative; top:-20em; ,but to make this working, the whole tab container must have fixed heigth and that's bad, because I need it to stretch within the window to be as big as possible.
So is there any other way how to move the default tabs to the top?
Thanks
edit: here is example of my idea, but achieved with fixd heigth http://jsfiddle.net/L6QjK/2/
To be clear: This method is technicaly working, so the questin is not about making tabs with two control panels, but about positioning the tabs
Not sure if it will work, but try creating two DIVs, one with default styling and one with the bottom styling:
<div class="tabs">...
<div class="tabs tabs-bottom">
and then use $(".tabs").tabs(...)
So finally I managed to create two control panels on my own by changing the jquery ui code.
If somebody is trying to make same thing as I here are some tips:
1) To create multiple control panels, find this.list=this.element.find("ol,ul)").eq(0)
now, the .eq(0) selector causes, that onlz the first ul or ol is made to control panel, so I simply modified the find selector to this :this.list=this.element.find("ol,ul:lt(2))") and the :lt(2) selector will make first two ULs to two control panels. Now we have two control panels and it is all about css positioning, you can get isnpired here http://jqueryui.com/demos/tabs/#bottom to move one control panle to the bottom.
2)I am using schema, that the first control panel contains static tabs, and to the second one are added dznamic tabs. So I also needed to change the target during adding tabs. For this you have to find h.appendTo(this.list) and change it to h.appendTo(this.list[1]) because ad.1) this.list now contains two elements and I want the tabs add to the second one.
So finaly to make two control panels tab layout isn't that hard

asp.net mvc 2 menus between 4 controllers

I want to have 2 navigation menus- One will be a "Top Level" menu, with 4 choices, each pointing to the index of a separate controller.
I would like to have a "Controller-Level" sub-menu on the left of my screen. This will correspond to links relevant to the controller selected in the top menu.
The "controller-level" menu is not static and needs to be customized based on roles of user.
The top-level one is basic. But how can i create the second menu that will change when a controller is selected from top?
danke!
I'm working on a similar situation where I need two menus. Was a "best-practice" ever resolved here? I have the need for one menu on the left, and a dynamically created tab-like menu at the top depending on what page I'm working with/on.
The user actually needs the ability to add/remove/hide top tabs depending on preferences. We are using MVC 2 and I'm not sure if the tab bar belongs in a control, on individual views, or what...and also how to make them both interact with my pages. (The left nav needs to show where the user is at all times, and the top tab needs to be highlighted based on the sub-page the user has selected.
If you are using MVC 2 RC or MVC Futures, then use RenderAction.
Create a controller for the dynamic menu, and call RenderAction("action", "controller"). This will invoke the controller, and you can have your logic in the controller to show the correct menu.

Resources