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

  • Home
  • SEARCH
  • 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 8677387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:26:38+00:00 2026-06-12T20:26:38+00:00

I am using PrimeFaces 2.2, with JSF 2.0.3. I have an xhtml view that

  • 0

I am using PrimeFaces 2.2, with JSF 2.0.3.

I have an xhtml view that contains the following datatable:

<p:dataTable id="fooTable" 
    widgetVar="fooTable" 
    rowKey="#{foo.id}" 
    var="foo" 
    value="#{fooQueue.foos}"
    styleClass="table" 
    selection="#{fooQueue.selectedfoo}" 
    filteredValue="#{fooQueue.filteredfoos}"
    paginatorPosition="bottom" 
    paginatorAlwaysVisible="true" 
    selectionMode="single"
    rowEditListener="#{fooQueue.save}" 
    paginator="true" 
    rows="10" 
    rowIndexVar="#{foo.id}"
    emptyMessage="No foos found with given criteria" 
    rowStyleClass="#{foo.status == const.submitted ? 'gray' : null}"
    onRowSelectUpdate=":form:deleteValidation">

        <p:column id="mothersName" filterBy="#{foo.header1}"  filterMatchMode="contains">
            <f:facet name="header">
                <h:outputText value="Mother's Name" styleClass="tableHeader2" />
            </f:facet>

            <p:commandLink action="#{fooQueue.next(foo)}" 
                ajax="false" 
                disabled="#{foo.status == const.submitted || foo.id == 0}">
                <f:setPropertyActionListener value="#{foo}" target="#{fooQueue.selectedfoo}" />  
                <h:outputText value="#{foo.header1}" styleClass="tableData" />
            </p:commandLink>
        </p:column>

        <p:column sortBy="#{foo.header4}" >
            <f:facet name="header">
                <h:outputText value="DOB" styleClass="tableHeader2" style="width: 400px" />
            </f:facet>
            <h:outputText value="#{foo.header4}" styleClass="#{(foo.overSevenDays and foo.status != const.submitted and foo.id != 0)?'tableDataRed':'tableData'}" />
        </p:column></p:dataTable>

.. with the following backing bean:


@ViewScoped
@ManagedBean
public class FooQueue extends BaseViewBean { 

    private List foos;
    private Foo selectedFoo;
    private List filterdFoos;

    public FooQueue() {
        logger.debug("Creating new FooRegQueue");
        retrieveFooRecords();
    }

    private void retrieveFooRecords(){
        foos = new ArrayList();
        foos.addAll(fooService.getAllFoos());
    }

    public String next(Foo clickedFoo) {        
        System.out.println(clickedFoo.getId());     
        return "";
    }

    public Collection getFoos() {
        return foos;
    }

    public Foo getSelectedFoo() {
        return selectedFoo;
    }

    public void setSelectedFoo(Foo foo) {
        if (foo != null) {
            this.selectedFoo = foo;
        }
    }

    public void setFilterdFoos(List filterdFoos) {
        this.filterdFoos = filterdFoos;
    }

    public List getFilterdFoos() {
        return filterdFoos;
    }
}

Note the “commandLink” on the mother’s name column, and the “sortBy” on the DOB column.

I’ve encountered a strange issue, which seems to be limited to IE, where if I sort the data by DOB, then paginate to the last page and click the commandLink of the last record in the table, it fires two action events. The first event correctly reports that I clicked on the last record in the sorted table. But the second invocation of the next() method is for the last record in the UNsorted table.

Can anyone identify anything wrong with my xhtml, or backing bean? Is this a known PrimeFaces issue? A known IE issue?

I am testing with IE 8.

  • 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-12T20:26:40+00:00Added an answer on June 12, 2026 at 8:26 pm

    I solved it. I simply had to change this:

    <p:commandLink action="#{fooQueue.next(foo)}" 
      ajax="false" 
      disabled="#{foo.status == const.submitted || foo.id == 0}">
       <f:setPropertyActionListener value="#{foo}" target="#{fooQueue.selectedfoo}" />  
       <h:outputText value="#{foo.header1}" styleClass="tableData" />
    </p:commandLink>
    

    to this:

    <p:commandLink action="#{fooQueue.next(foo)}" 
      ajax="true" 
      disabled="#{foo.status == const.submitted || foo.id == 0}">
       <f:setPropertyActionListener value="#{foo}" target="#{fooQueue.selectedfoo}" />  
       <h:outputText value="#{foo.header1}" styleClass="tableData" />
    </p:commandLink>
    

    Note the ajax=”true”. Because it was previously set to ajax=”false”, it was instantiating a new instance of my backing bean, and the row that was selected in the default sort order was being loaded. Now it does not instantiate a new instance, and I load the actual record I clicked on.

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

Sidebar

Related Questions

I am using JSF 2.0 and PrimeFaces 2.2.1. In my template.xhtml, I have a
I'm using Primefaces 3.3.1 and have question. I have p:commandButton inside p:column of p:dataTable.
I have a inputTextarea that I refresh using PrimeFaces' AJAX poll. When the inputTextarea
i am using jsf 2.1.1 and primefaces 3.0.M4. i have a sample jsf page
I have a problem using JSF 2.0, PrimeFaces and the tuckey.org UrlRewriteFilter. The problem
I am using PrimeFaces 3.2 with JSF 2 in a glassfish 3.1.2. I have
Hi there Im just learning JSF 2 using Primefaces. I have a question regarding
I am using jsf 2.0 with primefaces. In my application i have login page
I'm building a web-application using JSF/Primefaces. I need to have a constants-class, i.e. a
I have a PrimeFaces checkbox on a JSF page that I'd like to check/uncheck

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.