SAPUI5 vertical alignment Radiobuttongroup - alignment

Is there a way to create a radiobuttongroup with vertical alignment?
What I did is I created a verticalLayout around my radiobuttongroup shown in the picture below.
What I recieve is this:
What I want is this:
O a O b
How can I do that using a JavaScript-view in sapui5?

Its the columns property which determins how many RadioButton Items will be shown in a single row.
Check the below link: https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.commons.RadioButtonGroup.html#getColumns .
For you Code, since there are only 2 items, you can set the columns property in the RadioButtonGroup to 2.
var oRBG = new sap.ui.commons.RadioButtonGroup({
columns :2
});

Related

Align Items List of a Select Component

Vaadin 14.4.7
I have a Select component on my form. If the items in the select list are enough in number, the top of the expanded list touches the top of the window and the list shows two vertical scroll bars. If I move the Layout in which the Select exists down a bit, things look okay. I was wondering, though, if there was a way to align the list of items and have it center on the Select box.
This is the image of the scroll bars:
This is the app as a whole:
This is the code that creates the Select box:
variableColumnColumnSelectbox = new Select<>();
variableColumnColumnSelectbox.setLabel("Column:");
variableColumnColumnSelectbox.getElement().getThemeList().add("selectoverlaycustom");
variableColumnColumnSelectbox.setItemLabelGenerator(DimClmn::getClmnRptHdngCd);
variableColumnColumnSelectbox.setEnabled(false);
And this is the code to create the Horizontal Layout in which the row of Select boxes resides, with my fix to move it down a little commented out:
private HorizontalLayout buildVariableColumnsGridLayout() {
HorizontalLayout variableColumnsGridHorzLayout = new HorizontalLayout();
variableColumnsGridHorzLayout.getElement().getStyle().set("max-width", "70%");
variableColumnsGridHorzLayout.getElement().getStyle().set("margin", "auto");
/*
* This top margin value is set in order to move the variables column grid down
* so that the column select box in the grid form has room to display all of the
* values properly. If the report has a lot of columns, this select list will
* show two vertical scroll-bars. I don't know why.
*/
// variableColumnsGridHorzLayout.getElement().getStyle().set("margin-top",
// "10px");
createVariableColumnsGridLayout(variableColumnsGridHorzLayout);
return variableColumnsGridHorzLayout;
}
Well, I finally figured this out. I was able to get the inner scroll bar removed with a CSS rule applied to vaadin-list-box:
[part="items"]{
overflow-y: unset;
}
So simple.
(Really, as I look at it now, I posed my question incorrectly. I should have asked how to remove the inner scroll bar, which is what I was really after.)

Prevent a column to be dragged or resized

I have a column in a ListGrid and I want this column to be frozen. I don't want users to be able to drag the header and resize this column's width.
I tried
column.setCanDragResize(false)
but had no luck.
Any suggestions?
First plz post code snippet or at least smart GWT version.
Second, that method works fine in this case:
ListGrid list = new ListGrid();
list.setWidth(500);
list.setHeight(300);
ListGridField listField = new ListGridField("first");
listField.setCanDragResize(false);
list.setFields(listField);
list.draw();
If u want all fields to be disabled then you can use:
ListGrid list = new ListGrid();
list.setCanResizeFields(false);
list.setWidth(500);
list.setHeight(300);
ListGridField listField = new ListGridField("first");
ListGridField listField2 = new ListGridField("second");
ListGridField listField3 = new ListGridField("third");
list.setFields(listField,listField2,listField3);
list.draw();
EDIT: you can also set list.setCanReorderFields(false); if u dont want to reorder fields
Regards, Jakov A.

How to get the index or position of an item in Gtk.ListBox in vala?

I want a behavior like if you click on the first listitem open do a thing, if I click on the second listitem do other thing. Same thing for the third and second.
Similar to switchboard but not in iconview (I have the animason and gtk.stack set up):
https://www.youtube.com/watch?v=Lj2wKNYVFR8
This is the code:
var listbox = new Gtk.ListBox();
listbox.set_activate_on_single_click(true);
var l = new Watcher.List.ListItem("title", "subtitle");
listbox.insert(l, 0);
var l2 = new Watcher.List.ListItem("title2", "subtitle2");
listbox.insert(l2, 1);
"l" and l2 is a Gtk.ListBoxRow object so basically I add 2 listboxrow item into a listbox.
When I click on an Item do stuff:
listbox.row_selected.connect( ()=>{
stack.set_visible_child_name("new");
back.set_child_visible(true);
});
It will always show the stack child named "new" whether I click the first or second item in the list. I can acces the ListBoxRow index but that is just only for a specific Row.
I need to add custom formated items into a list and I was told that ListBox can do it. (Others can't?)
My ListBoxRow is just a grid with two labels in it but I want to add buttons and some more later.
Look at the reference for Listbox.row_selected(): You'll see that it has a ListBoxRow argument. You should update your row_selected closure to have that argument as well -- then you can use the row inside the closure to figure out which child you want to set visible.
If you really need to know the index of the row inside the listbox, you call row.get_index().

how to create a custom formItem composed of 2 buttons and a table in smartgwt?

I want to create a formItem composed of 2 buttons (addButton, removeButton) and a table, the addButton adds a line to the table and the removeButtons removes the selected line.
Please Help.
The simplest when you want something special in a dynamicForm is to use the CanvasItem which allow you to "wrap" anything you like inside a formitem uniform.
So in your case you can put a Layout (H or V) with the members you likeIButton, GridList, Label .... and set the Canvas of your CanvasItem to this Layout (setCanvas() method).

SetMargin in a manager in blackberry

I have a Grid view with some items displayed.How can i set the margin in grid view so that the items will be inside that margin and not within the scope of the whole screen.
if ur using GridFieldManager then see this :
grid.setColumnProperty(int coolumn,int property,int value);
where grid is the object of GridFieldManager;

Resources