List in autoComplete not mirroring same list in a p:selectOneMenu/f:selectItems

UI Components for JSF
Post Reply
fredmv
Posts: 38
Joined: 21 Feb 2019, 15:49

24 Jun 2023, 03:22

Hi all,

Weird issue here and I'm probably just overlooking something, but:


Firstly:
  • PrimeFaces 6.1, WildFly 8.1.0, OmniFaces version 2.7.
I have code that looks like this in my XHTML:

Code: Select all

<h:form>
						<p:panel header="Generate Training Assignment Summary" style="margin: 4px;">

					
						<p:panelGrid columns="2" style="margin-bottom: 10px">
							<h:panelGroup>
							<h:panelGrid>
								<h:outputLabel value=" " />

									       	
	                                        		<p:selectOneMenu id="tarSelect" value="#{trainingAlterView.selectedTarCert}">
	                                        			<f:selectItem noSelectionOption="true" value="#{null}" itemLabel="Select Certification" itemValue="#{null}" />
														<f:selectItems value="#{trainingAlterView.certRequestList}" var="cert2" itemValue="#{cert2.certId}" itemLabel="#{cert2.certTitle}" />
           											</p:selectOneMenu>
	                                             
                                	
									</h:panelGrid>
								</h:panelGroup>
							 
							<p:commandButton process="@form" update="tarSelect" value="Update" action="#{trainingAlterView.doTest()}" />
 							</p:panelGrid>

						</p:panel>	
										
					</h:form>
And code elsewhere that references that trainingAlterView.certRequestList:

Code: Select all

[...]
											<h:outputLabel value="Certification Title(s) (Limit: 5)" /> 								
											<p:autoComplete id="autoCertSearch" value="#{trainingAlterView.certRequestList}"  queryDelay="100" maxResults="30"
												styleClass="courseMultiAutoComplete" completeMethod="#{certificationListAutoComplete.getByKeywords2}"
												var="certSelect"  panelStyle="width: 500px !important;"
												converter="#{certConverter}" requiredMessage="Cert Required" itemValue="#{certSelect}"
												emptyMessage="No Matches!" itemLabel="#{certSelect.certTitle}"
												title="Start typing Cert Title" selectLimit="5" forceSelection="true" minQueryLength="3"
												scrollHeight="300" multiple="true">

												<p:column headerText="Title" style="width: 500px">
													<h:outputText value="#{certSelect.certTitle}" />
												</p:column>
												<p:column headerText="Type">
													<h:outputText value="#{certSelect.certFamily}" />
												</p:column>	
													
											</p:autoComplete>
The list itself is defined like this:

Code: Select all

	private List<Certification> certRequestList = new ArrayList<>(); 
With proper getter/setters:

Code: Select all

	public List<Certification> getCertRequestList() {
		return certRequestList;
	}


	public void setCertRequestList(List<Certification> certRequestList) {
		this.certRequestList = certRequestList;
	} 
What I don't get, at all, is that seemingly no matter what I've tried, it doesn't seem to mirror the same values. For example, if I type in a few Certification titles into the autocomplete box, I would expect when I open up my other dialog with the selectOneMenu/f:selectItems that is pointing to the #{trainingAlterView.certRequestList} that it would be the same list of values. Rather, it only ever displays the first item. Nothing else. Any idea why this may be? Is there some kind of update or Ajax type thing I need to run to get the f:selectItems to sync up with the list being shown in the autoComplete?

I'm ripping my hair out over this, it seems so stupid. :oops:

Thanks for any help.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

03 Jul 2023, 19:42

Most likely long fixed since PF 6.1. Have you tried a newer version?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests