Almost done with my form factory now :)
The current thing I'm having problems with, is the marking of fields
that contain invalid input-data.

As of now, i created the following appearance:
"textfield-invalid" : {
        include: "textfield",
        style : function(states)
        {
                return {
                        decorator : "input-invalid"
                };
        }
}

The "input-invalid" decorator is defined as follows:
"input-invalid" : {
        decorator : qx.ui.decoration.Beveled,
                        
        style : {
                outerColor : "border-input",
                innerColor : "red",
                innerOpacity : 0.5,
                backgroundImage : "decoration/form/input.png",
                backgroundRepeat : "repeat-x",
                backgroundColor : "background-light"
        }
}

This works very well for textfields and textarea elements. When it comes
to a date field for example, i get a lot of "Missing-appearance"
warnings, since all the sub-elements of the DateField are missing.

To prevent this, i now only set the appearance on text-fields, like this:
if(field instanceof qx.ui.form.AbstractField){
        field.setAppearance('textfield-invalid');
}

That's not very elegant though. I'm sure there would be a better way to
create that "Red" innerColor.. maybe even for all kind of elements
without the use of "instanceof" for different cases?

Any help and input is highly appreciated.
Thanks - Roman

Roman Schmid wrote:
> Hi Alex
> 
> It works like a charm. Awesome!
> I feel a bit dumb, since this is actually quite well documented... i
> guess it's because i have a headache already.
> 
> Next time i'll try harder, i promise :)
> Thanks a lot
> - Roman
> 
> 
> Alexander Back wrote:
>> Hi Roman,
>>
>> Roman Schmid wrote:
>>> Maybe somebody could be so kind and point me into the right direction.
>>> I'd like to have some special appearance for a label, let's name it
>>> "requiredlabel". There i would define color and font. That's what i
>>> tried (just for testing):
>>>
>>> qx.Theme.define("myapp.theme.Appearance", {
>>>     extend : qx.theme.modern.Appearance,
>>>
>>>     appearances : {
>>>             "requiredlabel" : {
>>>                     "textColor" : "#ff0000"
>>>             }
>>>     }
>>> });
>>>
>>> Then in the code:
>>> mylabel.setAppearance("requiredlabel");
>> The code for the appearance has to be
>>
>> --snip--
>> qx.Theme.define("myapp.theme.Appearance", {
>>    extend : qx.theme.modern.Appearance,
>>
>>    appearances : {
>>         "requiredlabel" : {
>>            style : function(states)
>>            {
>>                return
>>                {
>>               "textColor" : "#ff0000"
>>            }
>>            }
>>         }
>>     }
>> });
>> --snip--
>>
>>
>> This should work.
>>
>> cheers,
>>    Alex
>>
>> ------------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It is the best place to buy or sell services for
>> just about anything Open Source.
>> http://p.sf.net/sfu/Xq1LFB
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
> 
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to