primefaces,filter,datatable,omnifaces,http-request-parameters , Primeface Datatable filtering removed when sorting with o:form includeRequestParams=“true”


Primeface Datatable filtering removed when sorting with o:form includeRequestParams=“true”

Question:

Tag: primefaces,filter,datatable,omnifaces,http-request-parameters

this is an issue following this one: Primeface datatable.filter() and url parameter

is use PrimeFaces-5.1 and omnifaces-2.1 to render a datatable with pagination, filtering and sorting while using request parameters. my datatable is constructed like this:

<o:form includeRequestParams="true">
    <p:dataTable id="hostStateHistoryTable" value="#{HostHistoryBean.hostStateHistoryList}" var="status" widgetVar="statusTable"
    filteredValue="#{HostHistoryBean.filteredHostStateHistoryList}" 
    rowStyleClass="#{status.state eq 0 ? 'up' : null} #{status.state   eq 1 ? 'down' : null} #{status.state eq 2 ? 'unreachable' : null}"
    rows="50" paginator="true" paginatorTemplate="{PageLinks} {RowsPerPageDropdown}" rowsPerPageTemplate="10,50,100">
        <p:column sortBy="#{status.stateTime}">
            <f:facet name="header">Start Time</f:facet>
            <h:outputText id="Start" value="#{status.stateTime}"     />
        </p:column> 
        ... all columns
    </p:dataTable>
</o:form>

But Sorting is removing the PrimeFace Datatable Filtering. I can sort alone and filter alone without problem, but when i sort the datable after filtering it remove the filter. again Clicking on the same filter won't do anything but filtering on another value will display the expected result. It seems that the o:form will resend the request, including attribute, instead of using the datatable filteredValue.

Edit: i uploaded an eclipse based MCVE project here: http://www.dacave.fr/stackoverflow/test.faces.rar


Answer:

Ok so i found out that filteredValue was reseted on each ajax call because of the @RequestScoped. I think i was kind of mixing up things. So i switched all @ManagedBeans to @Named then i created a new @SessionScoped Bean with most of the attributes and i @inject a @RequestScoped bean with the request based attributes into it.

Now everything works as expected


Related:


ACCESS 2007 - Form / subform filtering between dates


vba,date,ms-access,filter
In ACCESS 2007 I have a main form with two unbound comboboxes named cmbStavOd and cmbStavK, both formatted as Short Date. I have a subform named frm_qryNaklady_subform, based on a query with a field named datNakladDatum (textbox name datNakladDatum), formatted as Short Date. I'd like to allow users to enter...

Using this.store.filter with the ID of the belongs_to model


ember.js,filter,belongs-to
I'm trying to retrieve all the layouts for a given account. /app/models/account.js import DS from 'ember-data'; export default DS.Model.extend({ companyName: DS.attr('string'), layouts: DS.hasMany('layout') }); /app/models/layout.js import DS from 'ember-data'; export default DS.Model.extend({ name: DS.attr('string'), account: DS.belongsTo('account', { async: true }) }); /app/routes/layouts.js import Ember from 'ember'; export default Ember.Route.extend({ model:...

Dynamic rendering - unable to find component with clientId


jsf-2,primefaces
I am rendering a xhtml to a dialog whose components are added dynamically from server side using Dynamic example. Using PrimeFaces 5.1, JSF 2.1 Mojarra and tomcat 7. When i click the close button of the pop up a large number to of unable to find the component is being...

adjust the rows dynamically in paginator of primefaces datatable


primefaces,datatable
I am using the primefaces datatable paginator. I have fixed the to no of rows to 15. This correctly matches the my system resolution. But users are using monitors with different(bigger) resolutions. The no of rows in this case will be less and space will be displayed at the bottom....

Jquery Filter Out Radio Buttons ( .not( ) )


php,jquery,filter
I want to remove the radiobuttons from my multiple choice quiz so users can review their answers. I put all of the questions to be reviewed in a div called reviewQuestions var question = '#question' + zz; // zz is a variable that produces a number var someVariable = $(question).not("input[type=radio]").html();...

How to subset by distinct rows in a data frame or matrix?


r,matrix,filter,data.frame,subset
Suppose I had the following matrix: matrix(c(1,1,2,1,2,3,2,1,3,2,2,1),ncol=3) Result: [,1] [,2] [,3] [1,] 1 2 3 [2,] 1 3 2 [3,] 2 2 2 [4,] 1 1 1 How can I filter/subset this matrix by whether or not each row has duplicate values? For example, in this case, I would only...

Spring boot - adding a filter


filter,spring-boot
I am wondering how I can add a filter in spring boot if the java class is only available in the app container ie it is not available at compile time. FilterRegistrationBean can only add a Filter class and not a String of a class name that will get instantiated...

how stick out a menu when clicking on a menu [on hold]


css,jsf,primefaces
I have a type of menu created in JSF. <p:menubar styleClass="menuPrincipal" id="menuBar" > <p:menuitem value="Inicio" url="/Inicio.xhtml" style="text-decoration:none" icon="ui-icon-home" id="inicio" /> <p:menuitem value="Agregar Excepciones" id="agregarExcepcion" url="/ExcepcionNuevo.xhtml" style="text-decoration:none" rendered='#{excepcionPendienteView.usuarioActual.tipoSolicitante eq "Administrador"}' /> </p:menubar> I want that when you click on a menu, highlight the option me where I am working. if I...

Excel VBA - ShowAllData fail - Need to know if there is a filter


excel,vba,excel-vba,filter
I have automated a proper record input into the table that I use as a database, and when the table is filtered the input don't work. So I have code this to unfilter DataBase before every record input. Public Sub UnFilter_DB() Dim ActiveS As String, CurrScreenUpdate As Boolean CurrScreenUpdate =...

Creating a list of items with different tags + filter


javascript,html,list,filter
I have prepared an example what I would like to produce: link. I have already looked for something and I have found the way to create a filter but just for one value... In my case I need more values all together combined. So that if I wanted a flat...

Include different file with primefaces


java,primefaces
I'm trying to include different file according to the type of my java object. I'm doing something like that : <p:panelGrid rendered="#{adapter.habitation}" > <ui:include src="./habitation.xhtml" /> </p:panelGrid> <p:panelGrid rendered="#{adapter.animas}"> <ui:include src="./animals.xhtml" /> </p:panelGrid> But all my cases throw an exception because it's trying to resolve all xhtml files. Any idea...

angularjs filter an array with string values as integers in contoller


arrays,angularjs,filter
I'm using AngularJS filter to filter an array of objects inside a controller. These objects all have a quality that is a string. I want to be able to filter the array from largest to smallest. But I can't get it filter on value of the integer inside the string....

UnderscoreJS : filter part of string


string,filter,find,underscore.js
I would like to filter data but without giving the whole string. For example, I have an Array with value:'myString', I would like to filter that even if i just pass 'my' or 'String'. Any idea ?...

Firebase: combine filtering with ordering in swift


swift,filter,order,firebase
So I have a sports app, which handle matches and championships data. I have two displays using the same data: All future matches All future matches from a certain championship The data is structured like this - championships - libertadores - name: Libertadores da América - matches - 2j6g42kjhg62 -...

SQL Query Filter to locate DUPLICATES in a column based on Values in 2 other columns


sql-server,filter,duplicates
I am using SQL Server 2014 and I am working with a table named ReservationStay. It contains the records of all guests with their names, arrival dates and departure dates. An operation has been undertaken that has split the records of hundreds of guests into 2 separate entries, which means...

Refresh selection model of p:datatable on row deselection


jsf,primefaces,datatable,selection
I have a problem with the selection model of a Primefaces 5.0 datatable. This selection model does not process deselection properly: Selection of rows adds these roles as expected to the list of selected rows. But a deselection has no influence on this list; deselected rows remains in it. Only...

How to get specific value of an dictionary


c#,object,dictionary,filter
i have an Dictionary of type int, myclass. in myclass i have following attributes: an string, int, and an string array. Evrything works fine when i save the data in dictionary. But i want now to look in the dictionary, if there is an value, in myclass, at the position...

Android listview filter without pressing search button issue


android,database,listview,filter
I have a ListView which work fine. Now I have put an EditText at the top of my ListView. What I want is that when a enters a letter "A", only the names starting with an "A" should appear in the list . I have try to do this but...

How can i fill in all the blanks in Column B using the data found in Column C


excel,vba,excel-vba,filter
I have completely rewritten my original question, i hope this is okay as far as Stack Etiquette? (That was not a 3rd question) ****SAMPLE DATA**** Date Order Reference Field 1 06/03/15 **865754iFP 002** 06/03/15 **865754iFP 002** 06/03/15 **818013Dc6 002** 06/03/15 **817660RiV 004** 06/03/15 **920488Hgg 001** 06/03/15 **920488Hgg 001** 06/03/15 **123771Pq2002**...

3 condition in WHERE clause for filtering


c#,filter
Basically I am trying to filter the distinct time and temperature from my database based on 3 condition. (column) UnitNo = txtUnit.Text (what user input in textbox) (Start date) Date >=ComboStart.Text (what user selected for 1st combobox) (End date) Date <=ComboEnd.Text (what user selected for 2nd combobox) I know the...

Php filter system


php,mysql,filter
I want to make a php filter system like this with 4 variables: echo"<form action='' method='GET' class='form-inline' role='form'>"; $query = "SELECT Naam FROM Soortmaaltijd"; //Alle soortmaaltijden ophalen $result= mysql_query($query) or die(mysql_error()); echo"<div class='row'>"; echo"<div class='form-group' >"; echo"<label for='soortmaaltijd'>Soort maaltijd</label></br>"; echo"<select name='Soortmaaltijd' class='form-control' id='soortmaaltijd'>"; echo"<option...

How do I do to count rows in a sheets with filters? With a suppress lines


excel,vba,filter
I have a sheet with lots of columns, but when I filter and use count = Application.WorksheetFunction.CountA(Range("A:A")) It returns all the rows non Empty. Not only the rows I filtered....

Putting inside a causes “weird” display


jsf-2,primefaces,panelgrid
I want to create dynamic forms with ajax update on event. Therefore dynamic-id is important. However, binding the id attribute to a bean value causes Empty Id exception. I saw one of the stackoverflow questions that suggests use html. So I used span. The xhtml code is as follows: <?xml...

selectonemenu, when editable=false, cannot submit the form


jsf,primefaces
My form is working if editable is set to true but not when it's false. When false the submit action method is not even called. I need it to be false (not editable so I can store the correct value in db). This is the menu I added. <tr><td> <h:outputLabel...

How to retrieve filtered data from json with double for loop


javascript,json,loops,for-loop,filter
So i have build up this json file (http://www.smartbustracking.be/json/data.json) and now i am able to retrieve data. but what i would like to achieve is to filter data based on id with a for loop. i am able to show one item of a specific id but not all the...

Primefaces p:remoteCommand parameter always null


primefaces,remotecommand
I am trying to pass a parameters with p:remoteCommand Unfortunately when I retrieve the paramer in my bean method I always get null. Is there anything wrong with my code? Here is my page code: <a href="#" onclick="rc([{'d':'01'}])">01</a> <p:remoteCommand name="rc" update=":myform:messages" actionListener="#{mybean.changedaybar}" /> and this is the bean method: public...

angularJs filter in ng-repeat


angularjs,filter,angularjs-directive
I am trying to provide a pagination to a table: Let's say there are 100 records and records per page is 10. If I am in 3rd page, records from 21 to 30 should be prepared in the table. So I am trying to filter those records using angular filter...

Can the HTTP method “PATCH” be safely used across proxies etc.?


http,caching,filter,proxy,http-patch
Suppose my server exposes an HTTP-based API that uses the PATCH method introduced by RFC 5789. Is it possible that clients (browsers or otherwise) behind corporate firewalls, proxies, caches, parental controls filters and the like will encounter any problems using this method? If so, how likely is this? Given that...

CommandButton execution while rendering


jsf,primefaces
Question: How can I prevent the execution of a while the website is rendering? Thats where my Button sits: <p:dialog widgetVar="newComment" height="200" width="500"> <h:form> <h:panelGrid> <h:outputText value="#{commentDialog.username}" /> <h:inputTextarea id="in_text" value="#{commentDialog.text}" /> <p:message for="in_text" /> </h:panelGrid> <p:commandButton validateClient="true" value="Abschicken" ajax="true" actionListener="#{popupRequestView.update}"...

VBA fails to limit to just .dat files if there are zip files present in the folder


vba,filter,folder,zipfile
I have added a filter to the type of files allowed to selected (.dat files) however I have found that if there are zip files present in the folder the script does not work correctly as it also opens the zip files. 'Specify folder where measurement files are stored With...

How to check if element of an array is in another array?


ios,arrays,swift,filter
I have two Array holding the instances of class MYItems. FavoriteItems holds the favorite items from the array Items var Items :[MYItems] = [] var favoriteItems = [MYItems]() Now i want to check if the Items array contains the favoriteItems in the . How can i acheive this? i tried...

Filter array by common object property in Angular.js?


javascript,arrays,json,angularjs,filter
I've been struggling with this over a few hours. The situation is, I have an app, that receives data about people in this JSON format: "people": [ { "name": "Ivan", "city": "Moscow", "country": "Russia" }, { "name": "John", "city": "Seattle", "country": "United States" }, { "name": "Michael", "city": "Seattle", "country":...

Filter array of objects with another array of objects


javascript,jquery,arrays,object,filter
This question is similar to this one Jquery filter array of object with loop but this time I need to do the filter with an array of objects. Exemple: I have an array of objects like this: myArray = [ { userid: "100", projectid: "10", rowid: "0" }, { userid:...

Filter rows in R using subset


r,filter,subset
I have 12 columns of data in a table called df, the first column contains several thousand strings such as AA150502-01,AA150502-02,BB150502-01,BB150502-03 etc. I want to filter the table so that i only see the rows ending with the suffix -01, how do i go about doing this? I so far...

Excel Advanced Filter not working with Wildcard (* asterisk) using regular numbers and hyphenated number system


excel,filter,wildcard
I have set up an advanced filter in Excel. I can not get the advanced filter to produce any output when using wildcard asterisks (*), using a source list that contains numbers and hyphenated numbers, OR alternatively when using a separate list which is producing a number from a formula....

Multiple filters using JQ


json,filter,jq
My boss wants our team to use JQ to parse JSON files. An app I use produces JSON that I need to transform. I have a file that looks like this: { "Collections": [ { "OptionGroups": [ { "OptionGroupName": "Test1", "Status": "in-sync" } ], "Version": "3.4.25", "InstanceIdentifier": "Dev1" }, {...

AngularJS Filter two select inputs with values less than or equal to value


javascript,angularjs,select,filter,compare
I would like to setup two select inputs so that the combined value of either select input should be less than or equal to a specific value. Newbie to the AngularJS world so I may have overlooked something. I assume a filter but it might be ng-change that I should...

Excel VBA range after filtering xlCellTypeVisible


excel,vba,excel-vba,filter,range
What I want to accomplish: Open a workbook from a specific address, Filter the first column for value equal to 36 or 541 (I got this first part working), then check column 3 to see if a value of 2 exists and if it exists then filter out everything except...

DOORS Compound Filter Dilemma


filter,dxl,doors
DOORS Version: 9.5.2.1 I'll try to break this down as simple as I can. First, I'll start with the data. Assume I have a module, Module, in DOORS. Module is comprised of: Tree Structure Assume that Object Text for headings and sub-headings are blank, and assume Object Text for the...

Can I filter an Android app by the mobile network operator?


android,networking,filter,operator-keyword,carrier
For example, I want to make a specific app so that it only shows up and can be downloaded by users on the Vodafone network.

confirmDialog is not taken the new value of the selectOneMenu


primefaces,selectonemenu
I need to change the status in database but when I change the status the confirmDialog is not taking the new value, it gets the old one <p:selectOneMenu converter="omnifaces.SelectItemsConverter" disabled="#{myBB.currentStatus != StatusEnum.TEMP}" id="statusSOM" onchange="PF('confirm').show();" value="#{myBB.currentStatus}" widgetVar="statusWV"> <f:selectItems itemDisabled="#{status == StatusEnum.ALL}" itemLabel="#{msgs[status.name]}" itemValue="#{status}" value="#{myBB.statusList}" var="status" /> </p:selectOneMenu>...

Primefaces: Dialog with inputTextarea not updating controller's variable


jsf,jsf-2,primefaces
I have this Dialog: <p:dialog header="Ingrese Comentario" widgetVar="dlg1" appendTo="@(body)" modal="true" position="top" hideEffect="fold" showEffect="fold" closable="true" draggable="true" > <h:form id="d_ingresarComentario"> <h:panelGrid columns="2"> <p:inputTextarea value="#{tareaController.comentarioNuevo.comentario}" rows="7" cols="60" placeholder="Ingrese su comentario aquí" counter="display1" maxlength="200" counterTemplate="{0} Caracteres faltantes." > </p:inputTextarea> <br/>...

Refresh parent node from backing bean with primefaces tree


jsf,primefaces,tree
Currently I am working on a project that use primefaces 3.4.1 version which does not support drag and drop in tree component. So I am using a contextMenu instead of drag and drop. <p:tree id="treeHierarchy" value="#{hierarchyManagementBackingBean.root}" var="node" dynamic="true" selectionMode="single" cache="false" style="width:99%;" selection="#{hierarchyManagementBackingBean.selectedNode}"> <p:treeNode id="idtreenode"> <h:outputText value="#{node.name} (#{node.entityType})" /> </p:treeNode> </p:tree>...

Get every other value of array in PHP


php,arrays,filter
I have an array: Array ( [A] => 4 [B] => 4 [D] => 4 [E] => 8 [F] => 4 [G] => 8 [H] => 8 [J] => 12 [K] => 12 [L] => 11 [M] => 11 [O] => 10 [P] => 10 [Q] => 10 [R] =>...

How to specify callback function when filtering array with object elements in php?


php,arrays,filter
I have an array whose items are of a certain object type, let it be my_object. The class defining the my_objects has a function that I want to use to filter the array. How can I specify that function when calling array_filter? class my_class{ private $exclude; public filter_function(){ return !$this->exclude;...

How can I filter instances of a model in django, with a queryset value of filter field?


python,django,filter
I am creating an application in django, and I have the next question: I want to filet objects of modelA, by the field att1, and I have a queryset of values of the field att1. I mean, my models are: class modelA(models.Model): att1 = models.ForeignKey(modelB) ... class modelB(models.Model): ... I...

How to filter keys of an object with lodash?


javascript,filter,lodash
I have an object with some keys, and I want to only keep some of the keys with their value? I tried with filter: var data = { "aaa":111, "abb":222, "bbb":333 }; var result = _.filter(data, function(value, key) { return key.startsWith("a"); }) console.log(result); But it prints an array: [111, 222]...

Why are fields reset after ajax update with Primefaces


ajax,jsf-2,primefaces
On a form I have some personal information (name, address etc.) and a changeListener which updates the salutation and letter salutation according to the gender and last name. If the underlying entity was already stored in the database it works fine. If I'm entering data for a new (not saved)...

Using Python, I want to parse each file in one directory with format YY-MM-DD.CSV but ignore all others


python,regex,file,filter
I'm new to Python, so my example represents the mess one aggregates when all experiments so far have failed. #!/usr/bin/python import glob import os import re path = '/home2/SunnyDataBackup/currentGenerated/SBEAM/' files = '[1][0-9]-[0-1][0-9]-[0-3][0-9].CSV$' #if I use '*.CSV', it works but doesn't filter the files fullpath = os.path.join(path, files) print fullpath #fullpathC...

Primefaces 5.2 get jqplot instance from p:chart


primefaces,jqplot
I have p:chart on my site like this <p:chart id="chart" type="line" widgetVar="chart" model="#{resultsViewController.areaModel}" style="height:600px"/> Now I want the client to be able to modify some display options without reloading the page, in order to do that I need to acquire the jqplot instance. How can I do that? I read...