JavaFX combobox, getting white background after listview - combobox

I m getting a white background in my ComboBox in javaFx
Screenshot of combobox I m getting
I simply used this
ComboBox mode = new ComboBox();
mode.getItems().addAll("Cash", "Cheque", "Account Transfer");
Please tell me how to resolve this..

As you can read here, when the combo is shown a PopupControl that extends `PopupWindow' is shown. It has its own scene and styling.
My guess is you have some styling applied to the CSS rule .root.popup, something like this:
.root.popup {
-fx-background-color: white;
}
Try to remove that sytling or change it to:
.root.popup {
-fx-background-color: transparent;
}
and check if the problem is solved.

Related

How to remove these blue bars/borders in checkbox in Kendo

I am creating a treeview using
kendo.data.HierarchicalDataSource
I want to remove these highlighted border. It is there only when using treeview.
Thanks.
Try overwriting the following style using !important. I overwritten it with red color, you can change it to any color of your choice.
.k-state-selected,
.k-state-selected:link,
.k-state-selected:visited,
.k-tool.k-state-selected
{
color : #ffff;
background-color:#ff0000!important;
}
Sample dojo

ExtJS 4 form textfield and color (background)

There is simple form and some textfields on this form. I have to set colors
(background and font) in two of them on runtime.
I tried to do it two ways:
1) fieldInstance.addClass('aaa') with css like this
.aaa .x-form-field {
background-color: black;
color: red;
}
2) fieldInstance.setFieldStyle('font-weight: bold;color: red;background-color: black;');
both methods are working because I see the bottom age of both is
fields is thick in black color, and both fields are working the same (almost) way.
Before enter and after exit background color is white.
When I start to edit this fields, background of first
is always white, background of the second is black until
I leave the field.
Could you explain me whats wrong?
For <input> element applied many classes beside x-form-field, like x-form-text and some of them define color and background-color aswell. So I guess that some of that classes may be more specific than .aaa .x-form-field. Try to use !important within your CSS rules:
.aaa .x-form-field {
background-color: black !important;
color: red !important;
}
I think that the 1st function append a class to the Others already presents.
In the second case you replace values of style already setted.
Maybe to have the same issue you need to modify the x-form-field fields, instead of append Others.
I Always use the second option if i have to modify style on Runtime.
maybe posting other code i can see better where the problem could present

how to add colours as values to combobox in extjs 4.2

my requirement is to have colours in combo box instead of textual value as "RED", "GREEN" in dropdown. am trying to achieve this using EXTJS 4.2. Could any one please help me how to configure the combobox.
is there any way to add colour images as values to combobox.
You should use listConfig config to change the behaviour of combobox picker. (For more information: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-cfg-listConfig)
Perhaps you give the combobox element a css class (e.g. 'foo'), or style tag, and then set the background-color with CSS
.foo{
background-color: red
}
It can be done by setting 'background-color: color; background-image: none;'
Take look at this expamle

ExtJs Border Around Control Box Only, Not Label

I have an EXTJS TimePicker control. I want to add a border around the picker box itself, not the label or overall panel just the box when the user clicks in the field. I have the follow code the provides a partial solution. It used to work when the label was to the left of the control. Once I moved the label to the top I get the incorrect behavior:
function txtTimeCtr_Focus(sender, event, eOpts )
{
//Change the border color to red to show the time is no longer running
sender.getPicker().pickerField.getEl().addCls('txtTime-focus-border');
//sender.getEl().addCls('txtTime-focus-border');
}
Here is a screen shot of what I am currently receiving
:
This is the functionality I need to obtain:
Thanks in advance everyone.
You need to set the style on the triggerWrap:
var f = new Ext.form.field.ComboBox({
renderTo: document.body
});
f.triggerWrap.setStyle('border', '1px solid red');

adf skin: inputText

how to change the color when I select the inputText? I wanted it to be gray but already shifted at all border color (content: busy, focus, edit) and does not change.
can someone help me?
Depending on what do you mean by 'remains' you should use something like this (when using ADF Skinning):
af|inputText::content,
af|inputText::content:selected,
af|inputText::content:focus,
af|inputText::content:hover,
{
border: none !important;
}

Resources