If you are talking about overriding a style binding with an attribute
initialization, I think I see the problem. If you have a style for `padding`
(which sets all four values), since styles are applied _after_ initialization,
any individual attribute settings (like `paddingright`, etc.) will be
overridden. This can be a general problem in CSS too, but is solved by the
cascading rules which determine which property 'wins'.
This is more motivation for us to have something like:
<view ... style="padding-left: 3" ...>
which would create a local style rule that would override any inherited
bindings.
As a work-around, you would have to consistently either use the abbreviation or
the individual attributes in both your style sheet and in the LZX.
On 2011-01-01, at 09:47, Captain Feng wrote:
> Question:
> It works well when through stylesheet:
> view.boxy {
> padding: 1 3 5 7;
> border-width: 2 4 6 8;
> border-color: plum;
> margin: 3 7 11 15;
> }
>
> but it didn't work through tag attribute, e.g:
> <view name="s1" with="boxmodel" width="60" height="60" bgcolor="red"
> paddingbottom="5" paddingleft="7" paddingright="3" paddingtop="1" />
> is that designated as expected?
>
> -Fred
>
> 2011/1/1 Captain Feng <[email protected]>
>
>> Happy new year to all!
>>
>> -Fred
>>
>> 2011/1/1 P T Withington <[email protected]>
>>
>> Change ptw-20101231-eeH by [email protected] on 2010-12-31 11:09:28 EST
>>> in /Users/ptw/OpenLaszlo/trunk-3
>>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>>
>>> Summary: More complete boxmodel mixin
>>>
>>> New Features:
>>>
>>> boxmmodel mixin now supports indpependently specifying
>>> margin/border-width/padding for all four sides
>>>
>>> Bugs Fixed:
>>> LPP-9079 Add discrete padding/margin/border top/left/right/bottom
>>> LPP-8819 Doc tools not aware of <attribute style="..." ...>
>>>
>>> Technical Reviewer: [email protected] (pending)
>>> QA Reviewer: [email protected] (pending)
>>>
>>> Release Notes:
>>>
>>> boxmmodel mixin now supports indpependently specifying
>>> margin/border-width/padding for all four sides
>>>
>>> When an attribute can be styled by a CSS property, the name of the
>>> corresponding property is displayed in the attribute documentation.
>>>
>>> Details:
>>> lfc-undeclared, LzNode, NodeModel: Install type information early
>>> on.
>>>
>>> LzSprite.*: Support all four axes of
>>> margin/border-width/padding.
>>>
>>> Lz{,Text,InputText}Sprite.as: Remove gigantic #passthrough block
>>> (using only where necessary) so our compiler can annotate slots
>>> for debugging sprites.
>>>
>>> TypeCompiler: Install user-type names so they inspect correctly.
>>>
>>> boxmodel: Add a new type that can parse boxmodel side
>>> dimensions. Use that for the "abbreviated" boxmodel attributes.
>>> The abbreviated setter unpacks and calls the actual individual
>>> attribute setters. Each of the individual setters also keeps the
>>> abbreviated value up to date.
>>>
>>> docbook.css: Style the description of attribute CSS properties
>>>
>>> js2doc2dbk: Note the CSS property corresponding to an attribute
>>> (if there is one).
>>>
>>> lzx2js2doc: Pull the style property out of attributes
>>>
>>> Tests:
>>>
>>> example in the documentation
>>>
>>> Files:
>>> M WEB-INF/lps/schema/lfc-undeclared.lzx
>>> M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
>>> M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
>>> M WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
>>> M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
>>> M WEB-INF/lps/lfc/core/LzNode.lzs
>>> M WEB-INF/lps/server/src/org/openlaszlo/compiler/TypeCompiler.java
>>> M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
>>> M docs/includes/docbook.css
>>> M docs/src/xsl/simple-driver.xsl
>>> M docs/src/xsl/js2doc2dbk.xsl
>>> M docs/src/xsl/lzx2js2doc.xsl
>>> M lps/components/mixins/boxmodel.lzx
>>>
>>> Changeset:
>>> http://svn.openlaszlo.org/openlaszlo/patches/ptw-20101231-eeH.tar
>>>
>>
>>
>>
>> --
>> captain
>>
>
>
>
> --
> captain