I have a table with several columns, among them I have one that is a SelectOneMenu
, the table is loaded with a list of Inscricao
.
In the subscription status column I have a SelectOneMenu
with the statuses: {"Solicitada","Deferida","Indeferida"}
. By default each subscription to be held contains status 0, ie "Requested", so I want to change the subscription status to a listing when the user chooses an option other than the status that is currently in the subscription.
The problem is that I can not have the Subscription id and the new value at the same time, so I can not change the subscription status value.
" i
" is a variable that contains a list of subscriptions:
<p:column headerText="StatusAdmin" filterBy="#{i.status}" filterMatchMode="contains" rendered="#{p:ifGranted('admin')}" >
<p:selectOneMenu id="statusSelectOneMenu" value="#{i.status}" style="width:125px"
onchange="submit()" valueChangeListener="#{inscricaoBean.editarInscricao(i)}" >
<f:selectItem itemLabel="Solicitada" itemValue="0" />
<f:selectItem itemLabel="Deferida" itemValue="1" />
<f:selectItem itemLabel="Indeferida" itemValue="2" />
</p:selectOneMenu>
</p:column>
In this way:
valueChangeListener="#{inscricaoBean.evt}"
I have access to the new value that has been assigned, but in this case I do not know which subscription related to this new value.
valueChangeListener="#{inscricaoBean.evt(i)}"
In this way I have access to the subscription, but I do not know what the new value is, how do I have both at the same time?