Combo Box values depending on another Combox Box value selected
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 12
- Joined: Mon Dec 16, 2019 6:51 pm
Combo Box values depending on another Combox Box value selected
Hi,
I'd like to create two dropdown menus linked together. The values that you can select in the second dropdown menu would depend on the value you selected in the first dropdown menu.
Example:
I have combo box Vehicle Type and Combo Box Brand. If I select Car in the first combo box, the values in the second combo box will display the car brands. If you change to Airplane, the values in Combo Box Brand would change to the Ariplane brands.
Can I apply this with CSS/XML Schema?
I'd like to create two dropdown menus linked together. The values that you can select in the second dropdown menu would depend on the value you selected in the first dropdown menu.
Example:
I have combo box Vehicle Type and Combo Box Brand. If I select Car in the first combo box, the values in the second combo box will display the car brands. If you change to Airplane, the values in Combo Box Brand would change to the Ariplane brands.
Can I apply this with CSS/XML Schema?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Combo Box values depending on another Combox Box value selected
Post by alex_jitianu »
Hi,
It is possible. From a CSS you would do it by writing selectors for all possible combinations. Depending on the combinations, it can be a bit cumbersome. Let's assume that both combos edit attribute values:
Perhaps a better approach would be to configure the content completion though a configuration file. In such a configuration file the values for an attribute can be computed through an XSLT which has access to the XML context. In the XSLT you can have a map from vehicleType to brands and it would be easier to compute the possible values. All it is left top do in the CSS is to bind the combo boxes, but leave the values to be taken from the schema/content completion customization:
Please let me know if you need additional assistance.
Best regards,
Alex
It is possible. From a CSS you would do it by writing selectors for all possible combinations. Depending on the combinations, it can be a bit cumbersome. Let's assume that both combos edit attribute values:
Code: Select all
element:before(20) {
content: oxy_combobox(
edit, '@vehicleType',
editable, false,
width, 20em,
values, 'Car, Boat')
}
element[vehicleType='Car']:before(10) {
content: oxy_combobox(
edit, '@brand',
editable, false,
width, 20em,
values, 'VW, Renault')
}
element[vehicleType='Boat']:before(10) {
content: oxy_combobox(
edit, '@brand',
editable, false,
width, 20em,
values, 'BoatBrand1, BoatBrand2')
}
Code: Select all
element:before(20) {
content: "Vehicle type:" oxy_combobox(
edit, '@vehicleType',
editable, false,
width, 20em)
" Brand:" oxy_combobox(
edit, '@brand',
editable, false,
width, 20em)
}
Best regards,
Alex
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Combo Box values depending on another Combox Box value selected
Hi,
Something like this:
should work to compute values for text content inside a certain element.
And you can use the oxy_combobox to also edit the text content of an element:
https://www.oxygenxml.com/doc/versions/ ... ditor.html
Regards,
Radu
Something like this:
Code: Select all
<config xmlns="http://www.oxygenxml.com/ns/ccfilter/config">
<match elementName="property">
<xslt href="get_values.xsl" useCache="false" action="replace"/>
</match>
</config>
And you can use the oxy_combobox to also edit the text content of an element:
https://www.oxygenxml.com/doc/versions/ ... ditor.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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