Guide
  • Introduction
  • Intro
    • Introduction
  • Beginner
    • How to send a param to another page
    • How to fill a select/combobox, radiolist, checkboxlist
    • How to order a list by a columm (java)
    • How to change the first page(home) of an application
  • Intermediate
    • How to make a filter/search with QueryInterface
    • How to hide a table context button?
    • How to show a file in a table
    • How to consume a JSON... GET and POST
    • How to make a SoapRequest
    • How to fill SeparatorList or FormList
    • How to map an entity to table using hibernate??
  • Advanced
    • OUT OF SERVICE - How to use a switch in a table - UI designer
    • How to implement a process BPMN in IGRP Studio
Powered by GitBook
On this page
  • UI
  • CODE
  1. Intermediate

How to make a filter/search with QueryInterface

PreviousHow to change the first page(home) of an applicationNextHow to hide a table context button?

Last updated 6 years ago

UI

Drag components and fields like this:

CODE

Inside your reserved code area, copy this:

QueryInterface query = Core.query(Core.defaultConnection(),"SELECT id as id,email as email,name as name")
  .from("tbl_person");

if(Core.isNotNull(model.getEmail()))
 query.where("email=:email").addString("email", model.getEmail());
if(Core.isNotNull(model.getName()))
  query.where("name=:name").addString("name", model.getName());

model.loadTable_1(query);

Query List Row

QueryInterface query = Core.query("conn_app_pg","SELECT id,name,email FROM public.persons");
ResultSet.Record o = query.getRecordList();
o.RowList.forEach(r->{
    System.out.println(r.getInt("id")+":"+r.getString("name")+":"+r.getString("email"));
});

Query Single Row

QueryInterface query = Core.query("conn_app_pg","SELECT id,name,email FROM public.persons");
ResultSet.Record o = query.getSigleRecord();
System.out.println(o.getInt("id")+":"+o.getString("name")+":"+o.getString("email"));