我在p:autoComplete
和p:dataTable
内有一个p:cellEditors
。当我按Tab键时,光标正确地在行元素之间按顺序移动,例如在输入和selectOneMenus之间(除了AutoComplete之外)正确移动时,光标进入AutoComplete,但无法退出。
我了解如果我在var
中删除p:autoComplete
可以正常工作,我认为var
会生成一个隐藏的输入,该输入会破坏tabindex,但是我无法使用tabindex和其他方式修复它
<p:dataTable id="FieldSoftwareElement_listForm_dataTable" value="#{classSoftwareElementController.selectedClassSoftwareElement.fields}" var="item" style="margin-top: 30px;margin-bottom: 10px"
widgetVar="itemWidgetVar" styleClass="editableDataTable" selection="#{classSoftwareElementController.selectedFieldSoftwareElements}" editMode="cell" editable="true"
paginator="false" paginatorAlwaysVisible="false" paginatorPosition="bottom" rowKey="#{item.hashCode()}" rows="10" rowsPerPageTemplate="10,20,30,40,50">
<p:ajax event="rowUnselectCheckbox" update="FieldSoftwareElement_listForm_btnsPanel"/>
<p:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column headerText="#{bundle.FieldSoftwareElement_AccessFlag}">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel value="#{item.accessFlag}"/>
</f:facet>
<f:facet name="input" id="cfh">
<p:autoComplete styleClass="search-box" title="Creator"
id="ReferenceEventDialog_referenceEventForm_toCreatorIn" multiple="true"
var="creator"
value="#{item.accessFlag}"
completeMethod="#{sendLtrView.allowableActors}"
converter="ActorRelationConverter" itemLabel="#{creator.title}"
itemValue="#{creator}"
disabled="#{tabParam.readOnly}" forceSelection="true">
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="#{bundle.FieldSoftwareElement_ColumnSize}">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel value="#{item.columnSize}"/>
</f:facet>
<f:facet name="input">
<p:inputNumber value="#{item.columnSize}" disabled="#{not classSoftwareElementController.selectedDynamic}"/>
</f:facet>
</p:cellEditor>
</p:column>
</p:dataTable>
答案 0 :(得分:3)
请参阅此票证:https://github.com/primefaces/primefaces/issues/3314
它将在7.1中修复。如果在“自动完成”上设置了autoSelection="false"
,则TAB键将像正常情况下一样工作,而不选择该项目。