我想在inputComboboxListOfValues组件的下拉菜单中限制显示字符的数量。 af:inputText有一个truncateAt属性。有没有办法用inputComboboxListOfValues做同样的事情?
我的代码:
<af:inputComboboxListOfValues id="xxxxx" autoSubmit="true" popupTitle=""
value="#{xxxxx.yyyyy}" label=""
model="#{bindings.xxxxxx.zzzzzzzzzzz}" placeholder="#{msg['zzzzzzz.xxxxxxxx']}"
required="false" shortDesc="#{bindings.zzzzzzzzz.yyyyyyyy}" launchPopupListener="#{pageFlowScope.xxxxxMB.yyyyyyyy}">
<af:autoSuggestBehavior suggestedItems="#{xxxxx.yyyyyy}"/>
</af:inputComboboxListOfValues>
您可以使用af:inputComboboxListOfValues inlineStyle属性设置max-width CSS。
在你的情况下,灵感来自Setting a max character length in css。 :
<af:inputComboboxListOfValues id="xxxxx" autoSubmit="true" popupTitle=""
value="#{xxxxx.yyyyy}" label=""
model="#{bindings.xxxxxx.zzzzzzzzzzz}" placeholder="#{msg['zzzzzzz.xxxxxxxx']}"
required="false" shortDesc="#{bindings.zzzzzzzzz.yyyyyyyy}" launchPopupListener="#{pageFlowScope.xxxxxMB.yyyyyyyy}"
inlineStyle="overflow: hidden!important; text-overflow: ellipsis!important; white-space: nowrap!important; max-width: 20px!important;" >
<af:autoSuggestBehavior suggestedItems="#{xxxxx.yyyyyy}"/>
</af:inputComboboxListOfValues>
注意:不要忘记在max-width属性的末尾添加!important来覆盖组件css