Combobox form component in CSS

Post here questions and problems related to oXygen frameworks/document types.
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

Combobox form component in CSS

Post by CheryBen »

Hi, i have a question about a form component that i have configured in my css to render/edit an attribute indicating the document classification.
My attribute is an integer and i would like to show a combobox to allow the user to select the classification in a label list.
For exemple, here is the mapping :
01 : NOT PROTECTED
02 : RESTRICTED
03 : CONFIDENTIAL DEFENSE
04 : SECRET DEFENSE/RESTRICTED

Here is my config :

Code: Select all

security[securityClassification="01"] {   
content: "Security level : "
oxy_editor(
type, combo,
edit, "@securityClassification",
editable, true,
values, "01, 02, 03, 04",
labels, "NOT PROTECTED, RESTRICTED, CONFIDENTIAL DEFENSE, SECRET DEFENSE/RESTRICTED")
" NOT PROTECTED";
}

security[securityClassification="02"] {
content: "Security level : "
oxy_editor(
type, combo,
edit, "@securityClassification",
editable, true,
values, "01, 02, 03, 04",
labels, "NOT PROTECTED, RESTRICTED, CONFIDENTIAL DEFENSE, SECRET DEFENSE/RESTRICTED")
" RESTRICTED";
}

security[securityClassification="03"] {
content: "Security level : "
oxy_editor(
type, combo,
edit, "@securityClassification",
editable, true,
values, "01, 02, 03, 04",
labels, "NOT PROTECTED, RESTRICTED, CONFIDENTIAL DEFENSE, SECRET DEFENSE/RESTRICTED")
" CONFIDENTIAL DEFENSE";
}

security[securityClassification="04"] {
content: "Security level : "
oxy_editor(
type, combo,
edit, "@securityClassification",
editable, true,
values, "01, 02, 03, 04",
labels, "NOT PROTECTED, RESTRICTED, CONFIDENTIAL DEFENSE, SECRET DEFENSE/RESTRICTED")
" SECRET DEFENSE/RESTRICTED";
}
I have to duplicate the css element for each value because the combobox does not display the labels, only the values.
Is there any bug or config problem? it seems the labels values are not used.
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: Combobox form component in CSS

Post by alex_jitianu »

Hi,

You get this behavior because you have an editable combo box. The problem is that once the user can manually edit the value it must see the real value, not just a label. Is the user supposed to provide custom values? Because if it isn't, just mark the combo as read-only (using the editable property) and the labels will automatically be used:

Code: Select all

security {   
content: "Security level : "
oxy_editor(
type, combo,
edit, "@securityClassification",
editable, false,
values, "01, 02, 03, 04",
labels, "NOT PROTECTED, RESTRICTED, CONFIDENTIAL DEFENSE, SECRET DEFENSE/RESTRICTED")
" NOT PROTECTED";
}
Apparently we forgot to mention this behavior into our documentation so I've added an issue to correct that.

Best regards,
Alex
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

Re: Combobox form component in CSS

Post by CheryBen »

Thanks for the reply.

The fact is that in the schema, the classification could be from 01 to 99, but i have only 4 predefined labels.
I will find a workaround to match this specific case.

Thanks again,
Benoit.
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: Combobox form component in CSS

Post by alex_jitianu »

Hi,

It may help to use the tooltips property to provide those labels as tooltips:

Code: Select all


security {   
content: "Security level : "
oxy_editor(
type, combo,
edit, "@securityClassification",
editable, true,
values, "01, 02, 03, 04",
tooltips, "NOT PROTECTED, RESTRICTED, CONFIDENTIAL DEFENSE, SECRET DEFENSE/RESTRICTED");
}
So the user will see the actual values but their description will be presented when the mouse hovers them or when they are selected in the pop-up.

Best regards,
Alex
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

Re: Combobox form component in CSS

Post by CheryBen »

Thanks Alex, this is a good turn around.

Benoît.
Post Reply