나는 a가 <p:dataTable/>
있고 각 행에는 a <p:selectOneMenu/>
가 있으며 목록에있는 항목 수 1에서 정수 목록입니다. 따라서 30 개 항목이있는 목록이있는 경우 <p:dataTable />
각각 <p:selectOneMenu/>
1에서 30까지의 옵션이 표시됩니다. 그러나 <p:selectOneMenu />
내 <p:dataTable />
. 한 행에서 항목이 선택되면 다른 행에서이 항목을 제거해야합니다 <p:selectOneMenu/>
. 예를 들어, 항목 '1'이 선택되면 다른 모든 항목은 선택 옵션으로 사용할 수있는 숫자 '1'을 가질 수 없습니다.
내 관리 빈 / 컨트롤러에서 할 수있는 방법이 있습니까? <p:selectionOneMenu/>
javascript를 사용하여 가져 오려고 시도했지만 clientId를 얻는 데 문제가 있고 selectOneMenu가 항목을 표시하기 위해 div를 사용하기 때문에 성공하지 못했습니다. 이 문제에 대한 의견이 있으십니까?
이것은 내 xhtml입니다
<p:dataTable id="dataTableSolicitacoes" value="#{pesquisarItemSolicInvestController.listaSolicitacoes}"
selectionMode="single" var="_solicitacao" rowKey="#{_solicitacao.index}" rowIndexVar="index"
selection="#{pesquisarItemSolicInvestController.linhaSelecionada}"
<p:ajax event="rowSelect" listener="#{pesquisarItemSolicInvestController.onRowSelect}" process="@(#dataTableSolicitacoes)" update="@(#dataTableSolicitacoes), @(#panelBotoes)" />
<p:column style="vertical-align: middle; width: 60px !important;">
<f:facet name="header">
<h:outputText value="#{messages.LABEL_PRIORIDADE}" title="#{messages.TITLE_INFORME_ORDEM_PRIO}"/>
</f:facet>
<p:selectOneMenu id="cbPrioridade" value="#{_solicitacao.prioridade}" style="width:60px !important;"
styleClass="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all"
disabled="#{!mf:hasPermission(securityController,'manterItensEnviados,manter')}">
<f:selectItem itemLabel="" itemValue="" noSelectionOption="true" />
<f:selectItems value="#{pesquisarItemSolicInvestController.listaPrioridades}" />
<p:ajax event="change" listener="#{pesquisarItemSolicInvestController.mudarPrioridade(_solicitacao.index)}"
process="@(#dataTableSolicitacoes), @(#panelBotoes)" update="@(#dataTableSolicitacoes), @(#panelBotoes)" />
</p:selectOneMenu>
</p:column>
</p:dataTable>
backing bean에서 하나의 메뉴를 선택할 때마다 다른 옵션 배열이 있습니다.
그런 다음 아래와 같이 f : selectItems에서 사용하십시오.
<f:selectItems value="#{pesquisarItemSolicInvestController.listaPrioridades[index]}" />
이벤트 리스너 메소드에서 아래와 같이 행 인덱스를 매개 변수로 가져옵니다.
#{pesquisarItemSolicInvestController.mudarPrioridade(_solicitacao.index, index)}
그런 다음을 제외한 모든 옵션 배열에서 선택한 항목을 제거합니다 listaPrioridades[index]
.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다