Components can't receive focus in p:carousel in PF 6.1 and variables are being reset when wrong update parameter is used

UI Components for JSF
Post Reply
benjes
Posts: 33
Joined: 12 Jun 2013, 18:25

06 Jul 2017, 11:05

Hi

we are currently upgrading from PF 5.3 to PF 6.1 (community edition) and I have come across a strange bug with the p:carousel.
Input components like a h:inputText don't receive the focus when you click on it. You can only move the focus to the component by using the tab button.

I have tried to replicate the same HTML code Primefaces is creating directly but in that case the input components can receive the focus.

Code: Select all

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
											"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	<f:view>
		<h:head>

		</h:head>
		<h:body>




			<h:form id="testForm">

				<p:carousel value="#{testBean.list}"
					converter="#{entityConverter}" var="loc">
					<f:facet name="header">
						<h:inputText value="test" /> <!--can receive focus-->
					</f:facet>
					<h:inputText value="#{loc.name}" /> <!--cannot receive focus-->

				</p:carousel>

				<h:inputText value="test" />
				<div class="ui-carousel ui-widget ui-widget-content ui-corner-all">

					<div class="ui-carousel-header ui-widget-header ui-corner-all">
						<div class="ui-carousel-header-title">
							<input type="text" name="testForm:j_idt3:j_idt6" value="test" />
						</div>
						<span
							class="ui-carousel-button ui-carousel-next-button ui-icon ui-icon-circle-triangle-e"></span><span
							class="ui-carousel-button ui-carousel-prev-button ui-icon ui-icon-circle-triangle-w ui-state-disabled"></span><select
							name="testForm:j_idt3_dropdown"
							class="ui-carousel-dropdown ui-widget ui-state-default ui-corner-left"><option
								value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option></select>
					</div>

					<div class="ui-carousel-viewport">
						<ul class="ui-carousel-items">
							<li class="ui-carousel-item  ui-widget-content ui-corner-all">
								<h:inputText value="test in ul" /> <!--can receive focus-->
							</li>

						</ul>
					</div>
				</div>

			</h:form>
		</h:body>
	</f:view>
</ui:composition>
The backing bean just returns a list of Objects that have a String 'name'.

No Javascript errors are shown.

Is this a known bug?


I've tested this with PF 5.3 and there it works fine.

Another thing that I have noticed is that variables can be rest when a wrong update parameter is used.

Code: Select all

<p:dataTable value="#{bean.list}" var="item">
	<p:column>
		<h:outputText value="#{item.name}"/> <!-- item is still defined and name is printed -->
		<p:commandLink action="#{bean.action}" update="AnotherForm"/>
		<h:outputText value="#{item.name}"/> <!-- item is not defined anymore, nothing is printed-->
	</p:column>
</dataTable>
Okay the error here is that it should be
update=":AnotherForm" as it is outside of the current naming container but the strange thing is that it does update the correct form and it is not throwing any errors. But it most certainly should not reset the variable!

Ibrahim Siripe
Posts: 35
Joined: 11 Nov 2016, 13:11

11 Aug 2017, 03:50

Hi,

You can use inputext in carousel with primeui, https://www.primefaces.org/primeui/#carousel

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

11 Aug 2017, 21:59

And put one question in one question

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests