oxy_popup values from XSD?

Oxygen general issues.
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

oxy_popup values from XSD?

Post 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
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: oxy_popup values from XSD?

Post 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:

Code: Select all

oxy_popup(edit, '@attr')
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
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Re: oxy_popup values from XSD?

Post 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
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Re: oxy_popup values from XSD?

Post 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
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: oxy_popup values from XSD?

Post 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
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Re: oxy_popup values from XSD?

Post 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
Post Reply