Referencing values in oxy_combobox from another combobox

Oxygen general issues.
sia
Posts: 12
Joined: Tue Sep 17, 2019 1:22 am

Referencing values in oxy_combobox from another combobox

Post by sia »

Hello Everyone,
I would like to fetch values from one oxy_combobox and populate the values and filter accordingly in the other combobox.
The first combobox should have a static list whereas the second combobox should reference those values and generate an appropriate oxy_xpath to display the list. Please suggest away to achieve the same.

Thank you for any help !
Best,
Sia
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Referencing values in oxy_combobox from another combobox

Post by alex_jitianu »

Hello,

I can think of two ways to achieve this.

The recommended one would be to make us of the content completion configuration and call an external XSLT script to compute the values for the second attribute. The values for the first attribute (or element content) are static while the second ones are computed using an XSLT and inspecting the value of the first attribute (the parameter contextElementXPathExpression can be used to identify the context in the XML)

The second solution involves oxy_xpath() function in the CSS. The downside is that the elements that use this functions will be relayout after each document change. If you have many of them then you can step into performance issue. Just something to consider when you decide which path to take. An example on how to write such a rule:

Code: Select all

second:before {
content:
	 oxy_combobox(
		edit, "@attribute", 
		editable, true, 
		values, oxy_xpath('if (preceding-sibling::p/@attr = "abc") then ("a,b,c") else ("d,e,f")'));

}

Best regards,
Alex
sia
Posts: 12
Joined: Tue Sep 17, 2019 1:22 am

Re: Referencing values in oxy_combobox from another combobox

Post by sia »

Thank you for the solution.
Post Reply