How to remove event listener from filterBy component in PrimeFaces

My issue arises when using PrimeFaces dataTable with filterBy on a column and attempting to clear the table by clicking a link. When a filter is applied and the table is cleared, the cached data remains until the filterBy value is changed. It appears that the filterBy input component retains the event listener even after clearing the table. Here's the code snippet in question:

<h:form id="logFormId" prependId="false">
  <p:dataTable value="#{logger.logLines}" var="logMsg"
  id="loggerTable" dynamic="false" widgetVar="logTable">
    <f:facet name="header">
      <h:commandLink action="#{logger.clearList}">
    <f:ajax render="@form" execute="@form" />
  </h:commandLink>
    </f:facet>
    <p:column>
  <f:facet name="header">
    <h:outputText value="#{msgs.LoggerDate}" />
  </f:facet>
  <h:outputText value="#{logMsg.dateText}" />
</p:column>
<p:column sortBy="#{logMsg.source}" 
    filterBy="#{logMsg.source}" filterMatchMode="contains" >
  <f:facet name="header">
    <h:outputText value="#{msgs.LoggerSource}  " />
  </f:facet>
  <h:outputText value="#{logMsg.source}" />
</p:column>
  </p:dataTable>
</h:form>

Answer №1

While the answer is not definitive, here are some suggestions to explore. It appears that the context of this discussion involves a primefaces 2.2 scenario.

  1. It seems that the dynamic attribute may no longer be relevant in the p:datatable component.

  2. Consider replacing @form with render="loggerTable" in your f:ajax element.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to acquire and set up a JS-file (excluding NPM package) directly through an NPM URL?

Is it feasible to include the URL for the "checkout.js" JavaScript file in the package.json file, rather than directly adding it to the Index.html? Please note that this is a standalone JavaScript file and not an NPM package. The purpose behind this appr ...

Pressing the tab key makes all placeholders vanish

case 'input': echo '<div class="col-md-3"> <div class="placeholder"> <img src="images/person.png" /> &l ...

Issue encountered during JSON file extraction (Firefox)

Within my Node.js application, there is a specific route where I retrieve a large JSON dataset from a Postgres database and then send it in a compressed format as a response. To accomplish this, I utilize the Zlib module to compress the data using gzip. Be ...

ExpressJS authentication -> PassportJS: Issue with setting headers after they have been sent

Currently, I am implementing authentication in Express.js using Passport.js. Below is the code snippet from my login.js file: passport.use(new LocalStrategy( function(username, password, done) { //console.log(username); Usercollectio ...

An error occurred stating "No matching closing tag found for "<%" when attempting to include the file

While attempting to include other .ejs files using the same syntax, everything works perfectly except when including my _show.ejs file. I am unsure where the issue lies, whether it is in the index.ejs or _show.ejs file. This is my index.ejs File <!-- i ...

Executing Two Distinct JQuery Api Requests

I'm facing a challenge with integrating the data from two different API calls and processing them together. After receiving JSON responses from both calls, I convert them into GeoJSON format. The next step is to combine these geojson objects in anothe ...

Exploring the wonders of retrieving JSON data in PHP through an Ajax request

A front-end developer is sending an array of data formatted as a JSON object using an Ajax call. The JSON object structure is shown below: { "name": " Test Name ", "image_url": "test URL", "include": [ "1" ], "dimension": [ null ], "media_type" ...

Row in Internet Explorer 7

I have a function that reveals hidden rows in a table, which works perfectly in all tested browsers except for IE7. The function is written using Prototype.js. function showInactives(){ var row_list = $$('tr.inactive'); var ck =$('inactive_ ...

Encountered an issue with a Node.js POST request leading to an error message: "socket hang up" with code 'ECONNRESET'

After creating a sample to send data to a REST service, I discovered that encountering non-ASCII or non-Latin characters (specifically in data.firstName) causes my post request using TEST-REST.js to throw: error: { [Error: socket hang up] code: 'EC ...

Determining the exact number of immediate descendants within a ul element, while disregarding any script elements

Here is the HTML structure I am working with, which contains a script tag: <ul id="list"> <li class="item1"><a href="#">Item 1</a></li> <li class="item2"><a href="#">Item 2</a></li> <li ...

To collapse a div in an HTML Angular environment, the button must be clicked twice

A series of divs in my code are currently grouped together with expand and collapse functionality. It works well, except for the fact that I have to click a button twice in order to open another div. Initially, the first click only collapses the first div. ...

Is there a way to store data in a variable for caching in NextJS?

After receiving JSON data from an online API, I am looking for a way to store and cache the response for the duration of my application running. Is there a method to accomplish this in Next.js without relying on an external library for such a basic task? ...

Having trouble loading HDRI image as environment using Three.js

I recently started using Three.js and am currently tackling a project that involves utilizing an HDRI file for environmental mapping for lighting and reflection purposes. I've been experimenting with loading HDRI files using the HDRCubeTextureLoader a ...

Leverage ajax/js to dynamically refresh a single select tag within a set of multiple

While working on a project, I encountered a challenge while using JavaScript to update a <select> tag within a page. The specific issue arises because the page is designed in a management style with multiple forms generated dynamically through PHP ba ...

Discovering an element within a shadow root using Selenium in conjunction with Java

Is there a way to retrieve the "Solve the challenge" button from within the shadow-root (closed) element? Here is what I've attempted so far: driver.findElement(By.xpath("//[@id=\"solver-button\"]")).click(); Unfortunately, the button canno ...

Initiating Ajax to trigger the body's onLoad event

Whenever I use an ajax call to load a div, the entire page refreshes. It seems that the 'body onload=init()' event is triggered on ajax response causing all the initialization to repeat, which is not desired. Is there a way to only load the div t ...

Mobile website scroll assistant

Seeking a solution to aid mobile users in scrolling through a lengthy article page. Typically in mobile apps, an alphabetical index assists users in navigating long lists. How can I incorporate a similar feature into a webapp? For context, my tech stack i ...

Unable to click on link with JavaScript using Selenium webdriver

<a id="compareCompanies" b:onclick="needsController.showQuotes = true;" href="#">Compare companies</a> Below is the Selenium Webdriver JavaScript code using Mocha: driver.wait(function () { driver.findElement(webdriver.By.id("compareCompa ...

Looking for a way to extract information from two nested objects within an array by utilizing lodash, and then transferring it as a property to a react component

My react components require dynamic preloading of values from nested arrays within an array of data. import React, { useEffect } from "react"; export function loadComponent({ config, LayoutRenderer }) { const loadModules = (name) => q ...

Perform an additional HTTP request and utilize the response within the existing Observable

In my Angular 2 project, I am utilizing the http component to make API calls. The specific REST API I want to access returns a maximum of 100 Elements in one request. If more items exist, a hasMore flag is included in the response. To retrieve additional ...