Is it possible to center a control(GenericTile) in the middle of the screen in View.xml without using css? - sapui5

im new to ui5 so i apologize if my question is too easy. i have a Generatic Tile that supposed to display events from Odata v4. the problem i have is that this tile is required to be in the middle of the screen(knowing that there is nothing else around). i tried using FlexBox(and many other classes) and i was only able to center it, but not to get it in the middle of the screen. is it possible to do it using only my View.xml?
enter image description here

Maybe try to wrap your Tile with a VerticalLayout or VBox (which extends FlexBox) and set height='100%' justifyContent ='Center'
Something like:
How to vertically center align my form container in openui5
or this:
https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.FlexBox/sample/sap.m.sample.FlexBoxBasicAlignment
Kind regards
Sebastian

Related

Vertical oriented Metro WinJS ListView in Grouped Mode

I'm banging my head against the wall trying to implement a ListView with grouped items that renders like the WP7 LongListSelector shown below. I've tried adding a win-vertical class to the element with the data-win-control="WinJS.UI.ListView" but since win-vertical seems to only apply to the viewport that didn't work. Any help would be greatly appreciated.
What kind of ListView Layout are you using? Using ListLayout instead of GridLayout does change the scroll direction from Horizontal to Vertical. But I don't see an easy way to add a group header for ListLayout list view. For GridLayout, there is a groupHeaderPosition property, but ListLayout object doesn't have this property. (Someone actually complained about the same thing.. at the end of this page)So, you might need to hack around for the group names by adding a dummy "group name" item into your data source and sort it properly.
Ref:
http://msdn.microsoft.com/en-us/library/windows/apps/br211837.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/br211792.aspx

How to Make Container Fill The Form in LWUIT

I have a Form that take a BoxLayout, to be able to add different custom controls one after the other in the Y-AXIS
but there is a Component that I need to add in the bottom of the screen, but as I'm using the BoxLayout so I can't fix it size to bottom of the screen
So I think that I can set that Container of the control to fill the parent Form
So the question is how to make Container fill the parent Form in LWUIT
Thanks in Advance
Why don't you try to put a BorderLayout in the Form?
You can put Containers in CENTER and SOUTH positions, and they let you place your controls as you want (BoxLayout Axis Y in the center).
Is that what you want?

Impossible custom layout in gwt?

I want to create a custom panel/layout and it's seeming pretty impossible at this point. I need the components to start in the upper left corner and stack downward until they fill the panel vertically, then wrap to the top of the next column and so on until they eventually fill the screen and create a horizontal scrollbar. After an entire day of trying I've decided it's only possible by abusing GWT (and I assume the whole web browser) adding crippling complexity and terrible performance. Please let me know if I'm missing something and layout like this is possible. Thank you!
Lame solution: Have a small (almost invisible) AbsolutePanel where every string is displayed within a div and measured (getClientWidth/height()). Then each panel can calculate it's size based on the strinsg, borders, padding, etc. it contains. Once each panel knows it's size, they can be layed out relative to the sizes of the other panels in the contianer.
Check out FlexTable, which allows you to specify the row,column for the widget to be added

Change content of a Label depending on panel size

once again I've got a question. Since I am using Google Web Toolkit (GWT) at work (along with Java Servlets), I am currently building some user interface with GWT (in Java).
I've got some trouble though. I am using a SplitLayoutPanel which contains a ScrollPanel on the left and another one on the right.
In the left ScrollPanel there's a VerticalPanel with several Labels, which differ in their width. What I want to accomplish, is: if the Label's text doesn't fit in one line, it should display as many characters as possible and have a "..." in the end, if it's not fully displayed.
I am about to add a CustomEvent EventHandler for the Label, which can be fired whenever the Label needs to change its content. Now the problem however is, that I'd need to fire the event whenever the ScrollPanel or its inner VerticalPanel is resized (by dragging the SplitLayoutPanel-Splitter).
Now the question: is it possible to override some sort of "onResize"-Event or at least "onMouseMove"-Event inside the VerticalPanel, so that I could fire the "changeLabelSize()"-method for each Label inside of this VerticalPanel?
How would I go about it? Thank you all for your time in advance! Please ask for anything unclear, so I can clarify it.
Best regards,
Igor.
This can be done easily with the CSS property text-overflow: ellipsis;.
Supported by IE7-, Safari and Konqueror.
And it can be emulated in Firefox.

Smartgwt - create a panel with title and a border

This sounds like a pretty simple thing to do but I havent been able to find an easy way to do this. How do I create a panel with a title and a border which can contain my widgets? I have seen the SectionStack class which provides this. But I dont want to create a section stack.
Window can be added to a layout and drawn. But is it the only way or is there a container class that I am missing?
Also, how does one center things? Say a textfield and a button at the center of the page. How is this achieved?
If you are using a DynamicForm, you can give it a border and title with
form.setIsGroup(true);
form.setGroupTitle(title);
This actually works for Canvas, too (which is the superclass of most widgets and layouts in SmartGWT).
(I just had the same problem, and found this question, as well as the thread Is there a "titled Border" on the SmartGWT Forums, which gave this answer. I tried and it seems to work.)
To do form-related tasks, look into DynamicForm. To set the inputs in the form, you use setItems(Item...). A text field is a TextItem. You set it's title to control the label that SmartGWT will build. To get a title for the form, the best I've come up with is to use a container canvas that will contain both the title (probably a Label element) and the DynamicForm. To center the inputs, I believe you'd need to use setAlignment on the DynamicForm.
You could create an object that is actually a VLayout that contains a Label (the tile), has a border as you need and includes a Canvas (the generic stuff you want included).
In my experience, I noticed that very often I have a DynamicForm visible, so I just add a BlurbItem control to diplay the tile and a small explanation.