Very strange behavior p:chips

UI Components for JSF
Post Reply
Posts: 300
Joined: 02 Feb 2014, 17:38

14 Sep 2018, 20:54

Hi all,

It´s very strange for me:
I have a p:chips:

- If I add per "ENTER" key my values will appear in the p:chips as usual. For testing I have also #{} as standalone to see what is in my list...

But I would like to add also an customer emailaddress with a button.
1) If I haven´t ENTERED a value to p:chips my p:overlayPanel will appear.
2) If I have ENTERED a value (per ENTER) my p:overlayPanel will never appear.

3) If I choose 1) and add an emailaddress, it will appear in my #{} but it´s not showing in my p:chips. I have an update over the whole panel, so it should be update also p:chips.

Here my whole code:

Code: Select all

<h:panelGroup id="email_to_panel">
													<p:outputLabel for="email_to" value="Empfänger:" />
													<p:chips id="email_to" style="width:100%"
														inputStyle="width:100%" required="false"
														requiredMessage="Bitte Empfänger angeben"
														<p:ajax event="itemSelect"
															update=":communicationSendEmailForm:email_to_panel" />
														<p:ajax event="itemUnselect"
															update=":communicationSendEmailForm:email_to_panel" />
													<p:tooltip for="email_to" position="top"
														value="Wählen Sie einen Kunden aus oder geben Sie eine Emailadresse an" />
													<p:commandLink id="emailToBtn" value="Kunde auswählen"
														immediate="false" styleClass="Fs12 FontBold"
														global="false" icon="fa fa-font"
														style="margin-right: 10px;" />
													<p:tooltip for="emailToBtn" position="top"
														value="Kunde auswählen" />

												<p:overlayPanel id="emailToPanel" for="emailToBtn"
													hideEffect="fade" dynamic="true" dismissable="true"
													style="min-width:650px; max-width:850px; min-height: 150px;">

													<p:dataTable id="customerListDatatable"
														var="customer" widgetVar="customerTable"
														multiViewState="false" resizableColumns="false"
														rows="10" pageLinks="10" paginatorPosition="bottom"
														lazy="true" paginator="true" reflow="true"
														currentPageReportTemplate="(Eintrag: {startRecord}-{endRecord} von {totalRecords}, Seite: {currentPage} von {totalPages})"
														paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
														emptyMessage="Kein Kunde gefunden">

														<f:facet name="header">

																<p:inputText id="globalFilter"
																	onkeyup="PF('customerTable').filter()" global="false"
																	style="width:250px" placeholder="Suche..." />


														<p:column sortBy="#{customer.customerNumber}"
															filterStyle="display:none" visible="true">
															<f:facet name="header">
																<h:outputText value="Kundennummer" />
															<h:outputText value="#{customer.customerNumber}" />

														<p:column sortBy="#{customer.surname}" visible="true"
															filterBy="#{customer.surname}" filterStyle="display:none">
															<f:facet name="header">
																<h:outputText value="Vorname" />
															<h:outputText value="#{customer.surname}" />

														<p:column sortBy="#{}" visible="true"
															filterBy="#{}" filterStyle="display:none">
															<f:facet name="header">
																<h:outputText value="Nachname" />
															<h:outputText value="#{}" />

														<p:column sortBy="#{}" visible="true"
															filterBy="#{}" filterStyle="display:none">
															<f:facet name="header">
																<h:outputText value="Email" />
															<h:outputText value="#{}" />

														<p:column exportable="false">
															<f:facet name="header">
																<h:outputText value="Optionen" />

															<div align="center">
																<p:commandButton id="selectCustomerToButton"
																	value="Selektieren" styleClass="green-btn Fs12 White"
																	update=":communicationSendEmailForm:email_to_panel, :growl"
																	icon="fa fa-check" immediate="true"
																	ajax="true" />
															<p:tooltip for="selectCustomerToButton" position="top"
																value="Wählen Sie den Kunden als Empfänger aus" />



Backing Bean method:

Code: Select all

	public void doSelectCustomerTo(Customer customer) {

		if (customer.getEmail() == null) {
					new FacesMessage(FacesMessage.SEVERITY_ERROR, "Der Kunde hat keine Emailadresse", ""));
		List<String> toList = new ArrayList<String>();
		if (email.getToList() != null)
			toList = email.getToList();

		if (toList.contains(customer.getEmail())) {
					new FacesMessage(FacesMessage.SEVERITY_ERROR, "Kunde bereits als Empfänger hinzugefügt", ""));
		if (!toList.contains(customer.getEmail())) {

					new FacesMessage(FacesMessage.SEVERITY_INFO, "Kunde als Empfänger hinzugefügt", ""));
Here from my email ENTITY:
private List<String> toList;
In Firebug I got also no error message. Any ideas?

Expert Member
Posts: 9344
Joined: 17 Jun 2010, 13:34
Location: Netherlands

18 Sep 2018, 09:57

Please try making an 'mcve'... See
Ronald van Kuijk
PrimeFaces 6.1, PrimeFaces plus 0.0.2 | JbossWildfly 10.1| Mojarra 2.2.13
Fedora 61, Firefox 'most recent'
Read the forum posting rules

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 6 guests