Autocomplete and non-case sensitive Combobox
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 12
- Joined: Mon Dec 16, 2019 6:51 pm
Autocomplete and non-case sensitive Combobox
Hi,
I have a combobox linked to a configuration file for proposed values inside (editable=OnlyAllowedItems). https://www.oxygenxml.com/doc/versions/ ... in_context
Is there a way to have these dropdown menus autofill when you type manually or at least show in the dropdown the possible options (ex: If I type B, I wanna see the values that start with B etc.). And if I wanna type all manually, to not have these case sensitive?
Thanks
I have a combobox linked to a configuration file for proposed values inside (editable=OnlyAllowedItems). https://www.oxygenxml.com/doc/versions/ ... in_context
Is there a way to have these dropdown menus autofill when you type manually or at least show in the dropdown the possible options (ex: If I type B, I wanna see the values that start with B etc.). And if I wanna type all manually, to not have these case sensitive?
Thanks
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Autocomplete and non-case sensitive Combobox
Post by alex_jitianu »
Hi,
They should already work like that... When you start the editing session, for example by using the mouse, the popup with all the values is presented. As you type, the first value that matches is selected. Just press ENTER to commit the value. The combo is case insensitive, too.
Is this combo the one from the attributes panel or is it a form control?
I'm sorry if I didn't quite understand you situation... if that's the case , please give me more details.
Best regards,
Alex
They should already work like that... When you start the editing session, for example by using the mouse, the popup with all the values is presented. As you type, the first value that matches is selected. Just press ENTER to commit the value. The combo is case insensitive, too.
Is this combo the one from the attributes panel or is it a form control?
I'm sorry if I didn't quite understand you situation... if that's the case , please give me more details.
Best regards,
Alex
-
- Posts: 12
- Joined: Mon Dec 16, 2019 6:51 pm
Re: Autocomplete and non-case sensitive Combobox
Sorry if I wasn't clear. I'll go in with as much detail as possible.
So I have two combo boxes: primary and secondary. The values that you can select in Secondary depends on what is in Primary.
css:
config xml file:
When I write Prescription with case sensitivity in mind, it autofills and takes shows the values in Secondary, but if I type with a minuscule p:
https://imgur.com/a/XGq9o1y
Hopefully, this was more clear.
So I have two combo boxes: primary and secondary. The values that you can select in Secondary depends on what is in Primary.
css:
Code: Select all
md\.primary:before {
content:
oxy_label(text, "Primary: ", width, 10%)
oxy_combobox(
edit, '#text', width, 20em);
font-weight: bold;
}
md\.secondary:before {
content:
oxy_label(text, "Secondary: ", width, 10%)
oxy_combobox(
edit, '#text', width, 20em);
font-weight: bold;
}
Code: Select all
<match elementName="md.primary" editable="onlyAllowedItems">
<xslt href="getMetaCaijValues.xsl" useCache="false" action="replace"/>
</match>
<match elementName="md.secondary" editable="onlyAllowedItems">
<xslt href="getMetaCaijValues.xsl" useCache="false" action="replace"/>
</match>
Code: Select all
<xsl:template name="getPrimaryValues">
<items>
<item value="Prescription"/>
</items>
</xsl:template>
<xsl:template name="getSecondaryValues">
<xsl:variable name="linkedElement"
select="saxon:eval(saxon:expression(concat($contextElementXPathExpression,'/../md.primary'), ./*))"/>
<items>
<xsl:if test="$linkedElement = 'Prescription'">
<item value='Délais de prescription'/>
<item value='Interruption et suspension de la prescription'/>
<item value='Prescription acquisitive'/>
<item value='Prescription extinctive'/>
<item value='Renonciation à la prescrition'/>
</xsl:if>
</xsl:if>
</items>
</xsl:template>
https://imgur.com/a/XGq9o1y
Hopefully, this was more clear.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Autocomplete and non-case sensitive Combobox
Post by alex_jitianu »
Hi,
I see... The lookup is case sensitive so when you start writing with a small "p" it will not match the upper case value. Because of that you will end up committing "prescription" which is not the proposed value. What you can do:
- if it doesn't really matter if the value is with a lower case or with an uper case, then you can change the XSLT to do a lower-case() and make decisions based on the value with all lower case.
- if the way the value is given matters and the user should choose from one of the proposed values, then why not make the combos not editable?
Best regards,
Alex
I see... The lookup is case sensitive so when you start writing with a small "p" it will not match the upper case value. Because of that you will end up committing "prescription" which is not the proposed value. What you can do:
- if it doesn't really matter if the value is with a lower case or with an uper case, then you can change the XSLT to do a lower-case() and make decisions based on the value with all lower case.
- if the way the value is given matters and the user should choose from one of the proposed values, then why not make the combos not editable?
Code: Select all
md\.primary:before {
content:
oxy_label(text, "Primary: ", width, 10%)
oxy_combobox(
edit, '#text', width, 20em, editable, false);
font-weight: bold;
}
md\.secondary:before {
content:
oxy_label(text, "Secondary: ", width, 10%)
oxy_combobox(
edit, '#text', width, 20em, editable, false);
font-weight: bold;
}
Alex
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Autocomplete and non-case sensitive Combobox
Post by alex_jitianu »
Hi,
I don't think there's a way to configure this behavior. What if you put as possible values both forms, with lower case and with upper case? Not very elegant, but you'll get the end result you desire.
Best regards,
Alex
I don't think there's a way to configure this behavior. What if you put as possible values both forms, with lower case and with upper case? Not very elegant, but you'll get the end result you desire.
Best regards,
Alex
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service