Hi Hussien,

I'm experimenting with the setReadOnly and setProperty commands and how they 
interact with CSS and I have some questions.

First, I've created a setReadOnly macro like so:

<commandname="setReadOnlyValue">
<macro>
<sequence>
<commandname="setReadOnly"parameter="[implicitElement]true"></command> 
<commandname="rebuild"parameter="[implicitElement]"></command>
</sequence>
</macro>
</command>
?
and I access it via a button bar button. It works; I can toggle an element 
between read-only and read-write by using this command and another that sets 
the value to "false". I can't however, make the CSS tie in with any reliablity. 
I've added this to the CSS sheet in use:
?...@namespace prop http://www.xmlmind.com/xmleditor/namespace/property;
?
*:property(prop|readOnly, "true") {
background-color: #E0F0F0;}
*:property(prop|readOnly, "false") {
background-color: normal;}
?
and it seems to have no effect...most of the time. It will occasionally work, 
and then not work again while I swap "rebuild" for "refresh" back and forth and 
try to figure out why it worked in the first place. I'm stumped. I'm making 
very, very small changes, testing after every change, but can't seem to find 
the secret sauce. Three times now I've got it working, created a backup copy of 
my work, then tried to break the working copy. I break it, can't fix it, roll 
back to the backup copy, which now refuses to work. It's a little perplexing.
?
So that's part 1: what am I doing wrong with the CSS/Command combo?
?
Part 2 involves the setProperty command, which I can't really test until I have 
the CSS working, since I have no way of knowing if the command is working 
unless I can reflect it in the content's presentation. I've interpreted the 
setProperty command in the Commands pdf like so:
?
<commandname="setInvisibleValue">
<macro>
<sequence>
<commandname="setProperty"parameter="[implicitElement]visible no"/> 
<commandname="refresh"parameter="[implicitElement]"></command>
</sequence>
</macro>
</command>
?
should this create a property on the current element called "visible" and set 
it's value to "no"? I'm not sure if I need to create the property before 
assigning a value to it, or if the creation and assignment are one.
?
Cheers,
Jeff.

Reply via email to