I have a dropdown in a rich:dataTable that is supposed to update my model class. My entity is a TransCode which points to another lookup table called "TransCodeStatus". I have a dropdown of the statuses that auto-submits to the server using a4j:support.
<rich:dataTable id="transCodeTable" binding="#{transCodeBean.dataTable}" value="#{transCodeBean.dataList}" var="_tc" rows="10" rowKeyVar="#{transCodeBean.rowKeyVar}">
....
<h:selectOneMenu id="transCodeSelect#{_tc.transCd}"
value="#{_tc.transStatusCode}"
valueChangeListener="#{transCodeBean.statusChanged}">
<f:selectItems value="#{transCodeBean.statusList}" />
<a4j:support event="onchange" reRender="transCodeTable"
oncomplete="$('messages').show();setTimeout(function() {$('messages').hide();}, 4000);">
<a4j:actionparam name="transCode" value="#{_tc}"
assignTo="#{transCodeBean.itemInEditMode}" />
</a4j:support>
</h:selectOneMenu>
The issue is that for logging purposes I need to get the entity that was changed in the valueChangeListener method. I tried passing it into the bean by an Actionparam, but in the method it ends up still being null.
public void statusChanged(ValueChangeEvent event)
{
...
LOG.debug( "item " + itemInEditMode );
}
prints out "item null"
How can I get that item? Is it because the valueListener is getting executed before the actionParam gets executed? I'm open to other suggestions on how to set this up as well.