ComboBox with Vaadin Grid and ComponentRenderer and the Empty Grid - combobox

I hope this post can help me.
My problem that when I use ComponentRenderer, then the grid appears empty.
The used vaadin version 7.6 and the used ComponentRenderer is 1.0.3 as it is recommended to be.
If I did not use ComponentRenderer, then the grid appears but the combo box is not appear.
What could be the reason?
Below is the used code:
Object itemId = container.addItem();
container.getContainerProperty(itemId,"ID").setValue("1");
container.getContainerProperty(itemId,"Dependent MPI").setValue("200.300");
container.getContainerProperty(itemId,"MPI Type").setValue("Antenna");
container.getContainerProperty(itemId,"Approval").setValue(ApproveReject);
this.getColumn("Approval").setRenderer(new ComponentRenderer());
Regards
Bilal

Object itemId = container.addItem(); //1
container.getContainerProperty(itemId,"ID").setValue("1");//2
container.getContainerProperty(itemId,"Dependent MPI").setValue("200.300");//3
container.getContainerProperty(itemId,"MPI Type").setValue("Antenna");//4
container.getContainerProperty(itemId,"Approval").setValue(ApproveReject);//5
this.getColumn("Approval").setRenderer(new ComponentRenderer()); //6
I believe you are trying to add a column "Approval" in line 5. Shouldn't it be:
Column approvalColumn = container.addColumn(...);
approvalColumn.setRenderer(...);

Related

DataGridViewComboBoxColumn behaves differently on Windows 7+ OS

I've made a client application in Windows Forms. I've used Windows Server 2008 R2 for development.
However client has reported few bugs which I am not able to reproduce on my machine but when I deploy same solution on Windows 7 or 10. It gives me different results.
As of now I now two problems:
DataGridViewComboBoxColumn backcolour turns out to be gray.
When moving across the columns using Tabs or Cursors keys, they skip combo box column. This is biggest problem.
I've created a test application with minimal code and found that this problem persists with test app as well.
DataGridViewComboBoxColumn column = new DataGridViewComboBoxColumn();
{
column.HeaderText = "CB";
column.Name = "CB";
column.DefaultCellStyle.BackColor = Color.White;
//column.CellTemplate = new DataGridViewCheckBoxCell();
column.DataSource = list;
column.ValueType = typeof(string);
}
dataGridView1.Columns.Add(column);
dataGridView1.DataSource = dtEmp;
Here is screenshot of problem:
Windows 10 - Notice that despite moving cursor key, first column is not highlighted
Windows 2008- Notice that dfirst column is highlighted and cells are not grayed out.
Any help would be greatly appreciated.
You might try to change DisplayStyle property to Nothing enum value so that your column will by styled and focus will be visible. However combobox arrow obviously disappears, but that might not be an issue for you.
this.Column1.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing;
Or try to change FlatStyle property to Flat so that you will see a combo box arrow:
this.Column1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;

Displaying Parse Data to ContainerList

I want to display data from Parse in a list from GamesScores class using Container in Codename One, this is what I've tried so far and it's not showing anything nor giving any errors:
Container container = findListCont();
container.setLayout(BoxLayout.y());
container.setScrollableY(true);
ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
List<ParseObject> results = (List<ParseObject>) query.find();
System.out.println("Size: " + results.size());
container.addComponent(results, f);
Please help me out, I'm a new in Codename One. If there tutorials on it, please share or anything to help me achieve the desired results.
I'm actually shocked this isn't failing. You are using the add constraint to place the object result as a constraint and you add the form object into the container...
You need to loop over the results and convert them to components to add into the layout. It also seems that you are using the old GUI builder which I would recommend against.
Generally something like this rough pseudo code should work assuming you are using a box Y layout:
for(ParseObject o : results) {
MultiButton mb = new MultiButton(o.getDisplayValue());
f.add(mb);
}
f.revalidate();

Trac ticket-custom permission

I created a custom field checkbox in trac. Written here.
How to make the field were only available for users to TRAC_ADMIN?
example trac.ini
[ticket-custom]
newfield = checkbox
newfield.label = Checkbox field name
newfield.value = 0
newfield.permissions = TRAC_ADMIN
newfield.permissions - does not work
Thank you.
You could use BlackMagicTicketTweaksPlugin. The feature is proposed in #9289, and I will probably work on adding the feature to Trac for release 1.4 (probably about a year away since 1.2 is just about to come out).

OxyPlot : ColumnSeries/BarSeries display value of each column

In my WPF app, I use OxyPlot. I bind my data to the PlotModel and all is working well.
I want to display the value of each column on the chart. Is it possible?
For reference, this example of BarSeries on site, I wish to show actual value of Apples of 2009, 2010 & 2011 respectively on each column. i.e. value of Value1 for the 2009Apples column, Value2 for 2010Apples and so on.
I looked up at the APIof the BarSeries (For WPF ColumnSeries used interchangeably).
Tutorials of Bar & other plots. But couldn't find such thing anywhere.
How do I achieve this?
Yes, just set the LabelFormatString property of your series.
var theSeries = new ColumnSeries();
theSeries.LabelFormatString = "{0:F2}"; // Example: 1.2311 will display like "1.23"
// Add your columns
theSeries.Items.Add(new ColumnItem(someValue);
// ...
There is also an optional property you can set called LabelPlacement. The default value is LabelPlacement.Outside:
theSeries.LabelPlacement = LabelPlacement.Middle;

How to flex TextField in qooxdoo mobile

I'm trying to add a row on a qx.ui.mobile.page.NavigationPage consisting of a label, a text field, and a button. I want the text field to take up any extra horizontal space (the row should span the screen horizontally). I thought this would work:
var comp = new qx.ui.mobile.container.Composite();
comp.setLayout(new qx.ui.mobile.layout.HBox(null, 'middle'));
comp.add(new qx.ui.mobile.basic.Label("Filtering:"));
var f = new qx.ui.mobile.form.TextField();
comp.add(f, {flex:1});
var b = new qx.ui.mobile.form.Button("Update");
comp.add(b);
this.getContent().add(comp);
but it doesn't (see http://tinyurl.com/nwlhtwq for a playground example).
What am doing wrong? Thanks!
Have a look at this example:
http://tinyurl.com/nmw6lgs
It is because the textfield has a "display:inline-block" by default, and width of 100%.
Please set these properties:
qx.bom.element.Style.set(textField.getContentElement(),"display","block");
qx.bom.element.Style.set(textField.getContentElement(),"width","auto");
We will fix that in framework, too.

Resources