Page 1 of 1
oxy_popup values from XSD?
Posted: Mon Aug 19, 2013 7:35 am
by yann1806
Hi guys,
wondering if there is a way in CSS to generate a nice popup menu (with oxy_popup), but having the labels/values coming straight from the XSD to avoid any duplication?
Thanks
Yann
Re: oxy_popup values from XSD?
Posted: Mon Aug 19, 2013 11:21 am
by alex_jitianu
Hi,
Actually, if not explicitly specified in the CSS the values are taken from the schema. I've noticed that the documentation fails to mention this so I'll add an issue to update it. I'm not sure how the labels should be taken from the schema though, so it would help if you could elaborate a bit on that. So if you would use:
the values for the attribute will be taken from the schema. Have you tried on some sample files and it didn't work? If so, please send them on
support@oxygenxml.com.
Best regards,
Alex
Re: oxy_popup values from XSD?
Posted: Mon Aug 19, 2013 2:24 pm
by yann1806
Hi Alex,
it works fine. Thanks!! I guess the values have to be the same as the variables, yes, but I'm fine with that.
Yann
Re: oxy_popup values from XSD?
Posted: Tue Aug 20, 2013 5:36 am
by yann1806
Alex,
one more question about that; supposed I want to define my values in CSS, not in the schema.
Is there a way to obtain a widget where the user could choose one of the predefined values *OR* enter any arbitrary text?
The idea is that I have some common values for this attributes, so it's nice to offer them as options, but I also can have open-ended values which I can't anticipate. I'm thinking a scroll-down menu for which the last option is an input text field, or something similar.
Is there a way to achieve something like that?
Thanks!
Yann
Re: oxy_popup values from XSD?
Posted: Tue Aug 20, 2013 10:48 am
by alex_jitianu
Hi,
From the built-in form controls the ones that accept open values there are the combo box form control an the text field form control.
Code: Select all
element:before {
content:oxy_combobox(edit, '@attr', editable, true) oxy_textfield(edit, '@attr2')
}
The combo box seems to be a closer match for your use case. If you want a form control that looks like the popup form control and adds a text field on the last line for open values, you can always implements one yourself using the public API:
http://oxygenxml.com/doc/ug-editor/#top ... trols.html
I can even send you the source code for the built-in popup form control so that you can have a starting point. Adding a text field to it should be fairly easy.
It's not relevant whether the values come from the schema or the CSS. But I'm guessing you want to use the CSS to offer a subset of the permitted values and use the open input to let the user specify the other values.
Best regards,
Alex
Re: oxy_popup values from XSD?
Posted: Tue Aug 20, 2013 3:58 pm
by yann1806
Hi Alex,
very helpful again, thanks!
Sure, if you can send me the code for the popup form control, it would definitely be useful.
Thanks
Yann