ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

visual appearance litsbox readonly but disabled URGENT!

mhj
21 Jan 2012 00:41:13 GMT
21 Jan 2012 00:41:13 GMT

helo guys!
i need urgent listbox with visual appearance like readonly but disabled.
when readonly: has img in background and text is really black, not gray but items are selectables
when disabled: items are blocked but text is very bad (gray with shadow)
thanks in advance

RichardL
21 Jan 2012 03:00:06 GMT
21 Jan 2012 03:00:06 GMT

You could have one listbox component with with the following logic:

If made readonly:
--If is currently disabled:
----Add onhover styling to listbox.
Add background image styling.
Style text to black.
Add onClick listener.

If made disabled:
--If is currently readonly:
----Remove onClick listener
----Remove background image styling.
Style text to gray.
Remove onhover styling from listbox.

Is this what you want to do? If so, which part are you having difficulty with?

mhj
22 Jan 2012 23:55:45 GMT
22 Jan 2012 23:55:45 GMT

my problem is:
when i set as disabled a lisbox, combobox, etc. text appears very bad, gray color with shadow. i wanna the text color seems really black.
I tried with some other posts, but nothing happen.

DaniG
23 Jan 2012 09:24:03 GMT
23 Jan 2012 09:24:03 GMT

Hi mhj...

I had the same problem, the text in disabled components is really illegible. You can achieve it rewriting the styles with the zclass property. It is simple with textboxes, decimalboxes... but with some components like comboboxes, listboxes... is a little more complex to do.

Good luck

mhj
23 Jan 2012 10:29:59 GMT
23 Jan 2012 10:29:59 GMT

that is exactly what happens to me, I do not understand how something that seems simple to solve turns out to be so complicated. I am waiting for help ....

terrytornadoTop Contributor
23 Jan 2012 12:28:18 GMT
23 Jan 2012 12:28:18 GMT

Hi,

I'm not have the solution for listbox on the fly, but the attached code should help you to search on how you can modify the disabled color.

myCSS.css

. . .

/* ------------------- DATEBOX -------------------- */
/* Disabled datebox should have black font */
  .z-datebox-disd,.z-datebox-text-disd,.z-datebox-rounded-disd,.z-datebox-rounded-text-disd
	{
	color: #000000 !important;
  }

best
Stephan

mhj
23 Jan 2012 19:43:18 GMT
23 Jan 2012 19:43:18 GMT

thank you very much Stephan!
i will try with your code, if i can solve the problem i post the solution.

mhj
24 Jan 2012 01:09:53 GMT
24 Jan 2012 01:09:53 GMT

good, i found a post helped:
http://www.zkoss.org/forum/listComment/11928
now still i don't know how set text color in IE. I did a test in 9 version. with chrome stay very nice

.z-textbox-disd,   .z-decimalbox-disd,   .z-intbox-disd,   .z-longbox-disd,   .z-doublebox-disd {
	color: black !important;
         opacity: 1;
	-moz-opacity: 1;
	filter: alpha(opacity=100); 
        background:#F8F8F8 ;
}
  .z-datebox-disd,.z-datebox-text-disd,.z-datebox-rounded-disd,.z-datebox-rounded-text-disd
	{
	color: black !important;
         opacity: 1;
	-moz-opacity: 1;
	filter: alpha(opacity=100);
        background:#F8F8F8 ;
  }
  .z-listbox-disd,.z-listbox-text-disd,.z-listbox-rounded-disd,.z-listbox-rounded-text-disd
	{
	color: black !important;
         opacity: 1;
	-moz-opacity: 1;
	filter: alpha(opacity=100);
        background:#F8F8F8 ;
  }
    .z-combobox-disd,.z-combobox-text-disd,.z-combobox-rounded-disd,.z-combobox-rounded-text-disd
	{
	color: black !important;
         opacity: 1;
	-moz-opacity: 1;
	filter: alpha(opacity=100);
        background:#F8F8F8 ;
  }

vincentjian
6 Feb 2012 06:49:48 GMT
6 Feb 2012 06:49:48 GMT

Hi,

IE 9 had default style for disabled element, and there is no way to change the text color and shadow.