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

UI Components for JSF
Post Reply
arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

31 Jul 2023, 22:32

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?

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

31 Jul 2023, 22:44

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
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

01 Aug 2023, 00:30

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.
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

01 Aug 2023, 04:49

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?
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

01 Aug 2023, 13:31

You should not need <f:param name="cid", thats done automatically when you check the URL of the form
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

01 Aug 2023, 14:54

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.
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

04 Aug 2023, 20:07

I should also mention that the pickList is on the 2nd tab of a tabView.

Could that be effecting it?
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

04 Aug 2023, 22:41

I also found:

viewtopic.php?t=24624

So this appears to be a known issue.
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

arnieAustin
Posts: 120
Joined: 14 Feb 2015, 22:35
Location: Houston, TX

19 Aug 2023, 15:25

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.
--- --- ---
PF 12 | JSF 4 | CDI 4 | WildFly 27

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: speandHap and 20 guests