Vaadin 23 align components in Grid header for filtering - vaadin

This is the code I have for Grid filtering components:
headerRow.getCell(idColumn).setComponent(FilterUtils.createIdFilterHeader(dataViewFilter::setId, "user.id"));
headerRow.getCell(nameColumn).setComponent(FilterUtils.createNameFilterHeader(dataViewFilter::setName, "user.first.name"));
VerticalLayout referrerFilterVerticalLayout = new VerticalLayout();
referrerFilterVerticalLayout.setMargin(false);
referrerFilterVerticalLayout.setPadding(false);
referrerFilterVerticalLayout.setSpacing(false);
referrerFilterVerticalLayout.add(FilterUtils.createIdFilterHeader(dataViewFilter::setReferrerId, "referrer.id"));
referrerFilterVerticalLayout.add(FilterUtils.createNameFilterHeader(dataViewFilter::setReferrerName, "referrer.first.name"));
headerRow.getCell(referredByColumn).setComponent(referrerFilterVerticalLayout);
Right now the header looks like:
I need to adjust the first two components and move them up to get something like this:
Please show how to achieve this.

Probably the easiest thing would be to stick your filter boxes in two Horizontal Layouts, within the Vertical Layout.

Related

Get items visible in viewport of Grid in Vaadin 8 & 10

The Grid widget in Vaadin 8 & 10 offers a method to get a Set of the currently selected items: Grid::getSelectedItems.
In a similar vein, I would like to get a collection of the items that are currently visible to the user in the Grid. Say my Grid widget holds 10 items, but only 5 are viewable because the Grid widget is too short to display them all. I want to know which of the five can be seen by the user.
This is not trivial task, I have something similar, but not exactly this case before. First of all, I would I would create custom Layout component, e.g. by extending CssLayout in similar fashion as has been discussed here ( How to make UI receive scroll events ) in addition to reporting scroll events I would report the position of the layout on the viewport (see http://www.gwtproject.org/javadoc/latest/com/google/gwt/dom/client/Element.html ). Yes GWT and client side development is required.
I would use this layout as wrapper for the Grid, i.e. Grid would be in the layout. You could extend the Grid component as well. But I think doing the layout wrapper gives you nice tool that you can use with other components as well for which you need to determine, whether they are actually visible or not.
This way I can then calculate which portion of the layout is in the viewport. As you see, there are number of cases here, e.g. only bottom of the Grid or top of the Grid is visible. Then I need to know row-height, header height, etc. That enables me to calculate how many rows there are visible. I hope you get the idea. The outcome for the generic case will be rather lengthy piece of code when all possibilities are enumerated. This calculation you can do on server side.

How to add a horizontal scrollbar to ListBox in Domino Designer

I have a form in my hands with listbox on it. There was a demand to display horizontal scrollbar for this listbox since users are unable to fully read text in the right column.
Is there any way to do so?
how does it looks
desing of subform
Try to get rid off Layout and use table instead.
It seems to be limitation of layouts. It works if you do not use Layouts.
Here is how my subform looks like:

How to make Vaadin Panels extend across the whole page?

How do I make my panels extend the full width across the page and not just to where their components stop?
As also cfrick suggested, use setSizeFull(), if your component is nested inside other layouts/components, you need to set all of them to full size as follows.
VerticalLayout panelWrapper = new VerticalLayout();
Panel yourPanel = new Panel();
panelWrapper.addComponent(yourPanel);
yourPanel.setSizeFull();
panelWrapper.setSizeFull();
If you have more parent components, you need to setSizeFull() all of them back to the UI root.

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.

Resizable columns / panels for content in jquery?

does any one know if there is an example available for sliding panels in jquery? If so, can someone send me a link? This is what I want to accomplish.
On my main screen I want to have three divisions. One right column that covers half the screen and then the left column divided in two rows. I want to expand and/or shrink the right column and/or left column and/or the top row in the left column and/or the bottom row in the left column.
Think og it as an IDE with the left side of the coding area and right side as project explorer and the properties. The coder would like to see any three of the sections at once or would like to expand each working area.
I am looking for a jquery solution for such!
Thanks
Sounds like the way jsfiddle.net works
This is available as a plugin. http://docs.jquery.com/UI/Resizable
You could also use the jQuery splitter plugin: http://www.methvin.com/splitter/
Also see (2011): http://jcubic.wordpress.com/2011/03/06/jquery-splitter-split-container/
Flexigrid is a new (2012) option: http://flexigrid.info/
The most robust solution for this is to use the jQuery layout plugin. You can find it here: http://layout.jquery-dev.net/

Resources