Closed tomtibbetts closed 2 years ago
@tomtibbetts Not a bug. Simply use the rowSelector
attribute of the datatable like this rowSelector="td,div"
that will make all cells with DIVS also selectable.
See the docs: https://primefaces.github.io/primefaces/11_0_0/#/components/datatable?id=attributes
Describe the bug
Hi, I have a situation that when I wrap text within a column with div tags the ajax select (double and single) does not work. It will work if the first column has div tags and there are no other columns. This is very frustrating. I don't know if this happens just to this theme or if it's a general problem. I appreciate your help. Thank you. Below is my sample code.
This code will present two datatables with identical lists. The second table renders as a dialog when the 'Search' button is clicked. The ajax in the first data table works because I'm only displaying one column of data. The ajax in the dialog datatable does not because of the 'Div' tags. If I were to remove the 'Div' tags, then the ajax will work.
I'm using Harmony v4.10 and Primefaces 11.0.0.0 RC-2
[code]package com.bakerstreethhs.bshi.persistence.data.domain;
import java.util.ArrayList; import java.util.List; import java.util.Objects;
import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table;
import com.bakerstreethhs.bshi.persistence.data.enumerations.PriorityTypeEnum;
@Entity @Table(name = "provider") public class Provider extends BaseAudited { private Long providerId; private String firstName; private String lastName; private String middleName; private String address1; private String address2; private String address3; private String address4; private String city; private Code stateCode; private String postalCode; private Code countryCode; private String email; private String telephone1; private String telephone2; private String npi; private String license; private PriorityTypeEnum telephonePreference;
} [/code] [code]package com.bakerstreethhs.bshi.ui.web.reference;
import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicLong;
import javax.faces.context.FacesContext; import javax.faces.view.ViewScoped; import javax.inject.Named;
import org.primefaces.event.SelectEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import com.bakerstreethhs.bshi.persistence.data.domain.Provider;
@Named(value = "providerSelect") @ViewScoped public class ProviderSelect implements Serializable{
} [/code] [code]<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" template="/WEB-INF/template.xhtml">
</ui:composition>[/code]
Reproducer
Sample XHTML and beans are in the description
Expected behavior
Expected behavior is to be able to single/double click on a row to select that row even if there are div tags in the columns.
PrimeFaces edition
No response
PrimeFaces version
11.0.0.0
Theme
Harmony
JSF implementation
No response
JSF version
2.2
Browser(s)
Chrome and Microsoft Edge