Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:05:37+00:00 2026-06-10T12:05:37+00:00

I have been having hard time with Primefaces and SO is my ultimate place

  • 0

I have been having hard time with Primefaces and SO is my ultimate place to find answer for issues.

I have p:dataTable with many columns so each of them should have short width. For headers, they seem OK but for data columns they break to 2 or more lines which I don’t prefer.

I made first column’s width larger to show what are in data table. Header text is fine, keeping it to single line. But data columns are bad for me. I prefer they keep it to single line. I want no line break. Ellipses is preferable but not mandatory.

<p:dataTable id="searchResultTable" var="searchData" value="#{registerBean.searchDataList}"
        scrollHeight="200"
        rowIndexVar="rowIndex"
        rowKey="#{searchData.model}"
        selectionMode="single"
        selection="#{registerBean.selectedSearchData}"
        paginator="true" rows="10"
        paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
        rowsPerPageTemplate="5,10,20" resizableColumns="true">
        <p:ajax event="rowSelect" listener="#{registerBean.onSelectedSearchData}"/>
    <p:column headerText="#{registerBean.getSearchResultHeaderText(0)}"
              width="30" style="height: 10px; font-size: 8pt;">
        <h:outputText value="#{registerBean.getSearchResultText(rowIndex,0)}" />
    </p:column>
    <p:column headerText="#{registerBean.getSearchResultHeaderText(1)}"
              width="30" style="10px; height: 10px; font-size: 8pt;">
        <h:outputText value="#{registerBean.getSearchResultText(rowIndex,1)}" />
    </p:column>
    <p:column headerText="#{registerBean.getSearchResultHeaderText(2)}"
              width="30" style="10px; height: 10px; font-size: 8pt;">
        <h:outputText value="#{registerBean.getSearchResultText(rowIndex,2)}" />
    </p:column>

I used h:outputText for each columns. I don’t persist to h:outputText, any component I can use with Primefaces can be fine.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:05:38+00:00Added an answer on June 10, 2026 at 12:05 pm

    I could find a solution. Adding CSS shown below to <p:column/> worked for me. Ellipsis is not working but no line-feeding, no expanding line height.

    <style type="text/css">
    .singleLine
    {
        text-wrap:none;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }
    </style>
    

    And do like this:

    <p:column headerText="Something"
        width="100" styleClass="singleLine" style="height: 10px; font-size: 8pt;">
        <h:outputText value="#{something.value}" />
    </p:column>
    

    I hope it will help few people on this globe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been having a hard time googling an answer for this, but.... can
i have been having a hard time to find anything that is usefull but
I have been having a hard time understanding how to use a singleton to
So I have been having a hard time sending email from my school's email
I have been having a really hard time debugging this error since the past
I have been looking at self hosting NuGet, having a hard time understanding how
Ok, I have been having a VERY hard time figuring this out. I guess
This is probably a basic question, but I have been having a hard time
I have been having a hard time with what must be an incredibly normal
I've been having a hard time coming up a solution with this one. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.