Filters in AppMaker - google-app-maker

I have created one datasource which contains only the rows that fulfil one condition. I want to create some filters in this table... but is not working.
This is the datasource:
For example, I have a text area which filters by the field "Title". Only should appears the row 5 , but the numer 6 it's still here...
This is the event handler code:
Important: in the beginning, I used this filters and they worked properly. They stopped working when i created the filter in the datasource (The one of the first image)

The filter that you are setting via the binding is getting lost when you perform your query script. Essentially, you are creating a query via the binding, then your script is creating a new query that doesn't have the filters you set previously.
Server Script - queryRecords(query: Query)
You'll notice that your query script has access to a parameter query that you can use instead of calling newQuery(). This will have the filter you set via your binding. Additionally, query.run() returns a list of records, so there's no need to iterate over them. Here is all the code you need in your query script:
query.filters.Status._in = ["Published"];
return query.run();

Related

Geoserver WFS-T Insert error (ORA-22816) when using layers based on database views i.c. with sequence numbering for ID's

We are working on a Frontend application, which adds new data to layers of GeoServer. The Frontend is using WFS-T Insert calls to add this data. We use views for these layers in GeoServer, to do some additional handling. The views we use are database views thus created on our Oracle database itself (e.g. we do not use the SQL Views of GeoServer). These layers based on views work all fine (solution applied with a disabled “primary key” for the view as described elsewhere on the internet).
The views we use contain an unique ID which is the unique ID of the “principal” table which is used in the view. For the unique creation of the ID’s for the “principal” table we chose to have the creation of this ID to be done by a sequence defined in Oracle. For using this sequence within GeoServer you can provide this “metadata” as indicated by the documentation: http://docs.geoserver.org/stable/en/user/data/database/primarykey.html
This solutions works fine, except when you use an (insert) trigger on the database view.
CREATE OR REPLACE TRIGGER OUR_VIEW_TRG
instead of insert or update or delete on vw_our_view
for each row…
If we perform a WFS-T insert call this results in the following exception:
org.geoserver.wfs.WFSTransactionException: Error performing insert:
Error inserting features Error performing insert: Error inserting
features Error inserting features ORA-22816: unsupported feature with
RETURNING clause
Without indicating GeoServer to use the sequence we get returned a feature ID, which will not correspond with our sequence numbering on the ID of the table (GeoServer simply returns the number of rows of the table, plus one). This results in an undesired situation where we have an incorrect ID at the Frontend after an WFS-T insert, only after a refresh of the browser the correct ID is being fetched.
Does anybody know if there is a way to make this work, e.g. for our customer changing the GeoServer code ourselves, and thus create our “own” version of GeoServer is no option. Stop using the views would imply extra WFS-T insert calls from our FrontEnd Application.

POST Complex objects to controller

I am working on an enterprise scale project where I have a self referencing table called categories as below. Also in my current model I am using following table associations to fetch data. ( using EF6).
I have M-M mapping tables in DB for above M-M relationships.
In my controller GET action result returns the model which has Ilist(all parent categories). Then when the user is selecting items (in view) I am using Ajax to retrieve Ilist for next subset of categories (by passing to controller by Id - return Json result) and dynamically show next to the parent select list as below. ( and I have up to 4 subsets)
As the user is selecting categories, I am using Ajax call to load related categories and create selectlist or dropdownlist dynamically as below:
My question is Since all these data is loaded through Ajax, how can I bind them to my parent model. How can I capture user selected data into one parent model when user is posting the from to controller.
I know I can use Ajax and use Json to capture & transfer to contoller , But I need to use modelview , Can I use partiview to overcome this ?
Please advise the available options..
The key is making sure the name values match the object hierarchy accepted by the post operation. This is certainly doable; it's difficult because several AJAX operations build the UI, but one operation processes it, so you have to ensure the data expressions match the object being posted back.
You can use Html.NameFor() as a workaround to ensuring the naming paths work OK. Collections can make this difficult.

Search Operation in table view javafx

In my application i added all data into table view. Then I need entire row by using search operation.
Searching is based upon any data like search by RegisterNo or search by Name. By entering RegisterNo it Should display entire row related to RegisterNo.
To do search operation in a TableView, what I've done is to add a notion of filters.
For example if you want to filter by name, each time your name query change, you filter all your data and let on the table only those who match your query.
You always keep the full data to execute your query on it, but to display it use an other list.
with that I'm able to have lot of filters at the same moment and my view refresh in real time

Using a table display method in a query or view

I'm trying to make a query against the table HcmWorker and related.
But i want to figure out how to get the result of the display method HcmWorker.primaryDepartmentName() into it's own field in my query.
I also tried creating a view to execute the function via a ViewMethod but that doesn't seem to work as ViewMethods only inject code into the final query against the view.
I'm NOT making a form. The end result has to come through the QueryService.
Sorry, but what you are trying to do is not possible.
You could calculate a non stored field in the postLoad method, but that would impact every access to your table, and it would most likely not work in the context of a query service.

How do I intercept a filter on either RadGrid or ASPxGridView for ASP.Net?

I need help choosing between Telerik RadGrid and DevExpress ASPxGridView for Asp.Net based on unique filtering requirements. The data lives in denormalized Vax files. All data access is via Sql Server stored procedures calling ODBC Connx queries to the flat files. Stored procedure parameters are used to filter the data. Without any filter thousand of records are returned.
I've successfully displayed all records on two test ASP.net pages, one with DevExpress ASPxGridVIew and the other with Telerik's RadGrid. In code I databind each grid to the stored procedure that returns over 26,000 rows. The sproc is called via an Entity Framework function import that fills an IEnumerable<Customer> which becomes the datasource of each respective grid. I'm able to use the filter features of both grids and they seem to work nicely.
My problem is that before the grid filter is applied all of the thousands of rows are returned from the stored procedure. I'd like to intercept the grid's filter parameters and apply them to my stored procedure parameters. That way far fewer records will be accessed.
Can this be done with either 3rd party grid and if so how?
Thanks in advance.
It seems it can be achieved using a RadFilter to the RadGrid. One example here.
But in general, looks like you'd need to add a handler to ItemCommand, and perform the appropriate filter based on the CommandName, for example. You could then just rebind the data.
The Rad Filter will also allow you to use it without being directly tied to another control or datasource. The filter has an option to extract a filter expression in many different forms (linq provider is one of them). You can then apply that expression to your datasource. We are doing something similar. We have a page where we dynamically create the rad filter with the types of fields and filter options. The user then uses the rad filter UI to create the filter based on the desired fields, then we extract a filter expression we can apply to a datatable that is created on the page that shows the data.
Here is the code for extracting the filter expression from the filter:
var provider = new RadFilterSqlQueryProvider();
provider.ProcessGroup(myRadFilter.RootGroup);
var sqlFilterExpression = provider.Result;

Resources