Displaying read-only attributes in Author
Oxygen general issues.
-
- Posts: 5
- Joined: Fri Oct 11, 2013 12:12 am
Displaying read-only attributes in Author
I'm experimenting with the CSS extensions for Author mode and have an unusual use-case:
<element attr1="x" attr2="y"/>
I need to display this in author mode as:
element x y
Where element, x, and y are READ-ONLY if y is some value 'a' and READ-WRITE if y is value 'b'.
First of all, I have no idea how to display an attribute without using oxy-editor, but since in most cases the attributes will be read-only, that doesn't work for me. If not read-only, I can use the oxy-editor functions.
<element attr1="x" attr2="y"/>
I need to display this in author mode as:
element x y
Where element, x, and y are READ-ONLY if y is some value 'a' and READ-WRITE if y is value 'b'.
First of all, I have no idea how to display an attribute without using oxy-editor, but since in most cases the attributes will be read-only, that doesn't work for me. If not read-only, I can use the oxy-editor functions.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Displaying read-only attributes in Author
Post by alex_jitianu »
Hi,
You can still use form controls, you just have to mark the element as READ_ONLY (using the -oxy-editable property). As a result the form controls will also be READ-ONLY:
If you don't want to use form controls when the values are READ-ONLY you can use the attr function to just present the attributes:
Best regards,
Alex
You can still use form controls, you just have to mark the element as READ_ONLY (using the -oxy-editable property). As a result the form controls will also be READ-ONLY:
Code: Select all
element:before {
content: oxy_local-name() " " oxy_textfield(edit, '@attr1', columns, 10) " " oxy_textfield(edit, '@attr2', columns, 10);
}
element[attr2='a'] {
-oxy-editable:false;
}
element[attr2='b'] {
-oxy-editable:true;
}
Code: Select all
element:before {
content: oxy_local-name() " " attr(attr1) " " attr(attr2);
}
Alex
-
- Posts: 5
- Joined: Fri Oct 11, 2013 12:12 am
Re: Displaying read-only attributes in Author
This does not work at all! Attributes can still be edited when an element's -oxy-editable:false. I'm beginning to think that it is not possible at all to have form controls be set to read-only.
Is it at least possible to have the attributes output as read-only plain text that can be assigned column widths to regularly space them apart?
Is it at least possible to have the attributes output as read-only plain text that can be assigned column widths to regularly space them apart?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Displaying read-only attributes in Author
Post by alex_jitianu »
Hi,
I've tried this scenario and setting -oxy-editable:false on an element will also make it's attributes read-only.
In the code snapshots I've posted, the attributes are editable but as soon as you set attr2 to value a both attributes become READ-ONLY.
If you want to output the attributes in a columns like layout you can use the oxy_label function, like so:
I'll also send you the sample files on your email address so that you can test them more easily.
Best regards,
Alex
I've tried this scenario and setting -oxy-editable:false on an element will also make it's attributes read-only.
In the code snapshots I've posted, the attributes are editable but as soon as you set attr2 to value a both attributes become READ-ONLY.
If you want to output the attributes in a columns like layout you can use the oxy_label function, like so:
Code: Select all
element:before {
content: oxy_local-name() ": \A "
oxy_label(text, "Attribute 1", width, 100px) attr(attr1) "\A "
oxy_label(text, "Attr 2", width, 100px) attr(attr2);
}
Best regards,
Alex
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service