Page 1 of 1

Referencing values in oxy_combobox from another combobox

Posted: Tue Sep 17, 2019 7:41 pm
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

Re: Referencing values in oxy_combobox from another combobox

Posted: Fri Sep 20, 2019 9:17 am
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

Re: Referencing values in oxy_combobox from another combobox

Posted: Mon Sep 30, 2019 7:09 pm
by sia
Thank you for the solution.