Page 1 of 1

p:pickList p:ajax f:param not transmitting cid parameter

Posted: 31 Jul 2023, 22:32
by arnieAustin
I'm using Jarkarta on Wildfly 27 along with PF 12.

My app also uses CDI's Conversation Scope, which means I need to pass the cid parameter on every request or CDI will instantiate a new bean.

All my command buttons work as expected.

I'm trying to use a p:pickList now and it appears that PF isn't transmitting the cid because the UI doesn't update properly after the AJAX request is completed.

Here is a portion of the mock up:

Code: Select all

	
<p:ajax event="select" listener="#{sysUserRoleMembershipEdit.onSelect}" 
	process="@this" update="sysUserEditTabRolesOutputPanel" partialSubmit="true" >
	<f:param name="cid" value="#{javax.enterprise.context.conversation.id}" />
</p:ajax>
What can I look for to see what is being sent during the request?

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 31 Jul 2023, 22:44
by arnieAustin
I found the p:log and added to the form and I can confirm the cid is being sent.

So I guess there's some other subtle issue going on

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 01 Aug 2023, 00:30
by arnieAustin
So the CDI cid parameter is going but this is odd:

Code: Select all

<f:ajax event="select" listener="#{sysUserRoleMembershipEdit.onSelect}" 
	process="@this" update="@this" async="true" >
	<f:param name="cid" value="#{javax.enterprise.context.conversation.id}" />
</f:ajax>
For some reason, p:ajax does not work. But the f:ajax tag does.

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 01 Aug 2023, 04:49
by arnieAustin
Made some progress and the event is firing.

But the selected row does not seem to keep the focus and the transfer button does not stay activated at the end of ajax request and as the status dialog closes.

If the ajax call is firing why doesn't the controls behave as expected?

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 01 Aug 2023, 13:31
by tandraschko
You should not need <f:param name="cid", thats done automatically when you check the URL of the form

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 01 Aug 2023, 14:54
by arnieAustin
Unless something's changed with how CDI conversations work, the cid parameter is required. Especially given the fact that I do not use URL parameters but request objects as the former is a security risk.

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 04 Aug 2023, 20:07
by arnieAustin
I should also mention that the pickList is on the 2nd tab of a tabView.

Could that be effecting it?

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 04 Aug 2023, 22:41
by arnieAustin
I also found:

viewtopic.php?t=24624

So this appears to be a known issue.

Re: p:pickList p:ajax f:param not transmitting cid parameter

Posted: 19 Aug 2023, 15:25
by arnieAustin
Turns out the f:param name="cid" ... was working. I had process="@this" on the ajax events of the picklist, thinking, only this control is changing.

Once I switched to process="@form" everything worked as expected.