Java Connector filtering

Hello,

I’m trying to filter a SchedulerConnector render_table. I need to put a where into a render_table. I’m trying to use set_option but its not working.

Anyone knows how to do it?

	SchedulerConnector sc = new SchedulerConnector(connection);
	
	sc.servlet(req, res);
	
	ArrayList<String> filter = new ArrayList<String>();
	filter.add(empresaID.toString());
	sc.set_options("EmpresaID", filter);
	
sc.render_table("eventos","id","start_date,end_date,text,funcionario,cliente,servico,EmpresaID");

I need a Filter that gets empresaID and set into render_table to load just events that already have the empresaID parameter.

set_options is used to define a list of options that will be used on client side for editor rendering. It will not affect SQL and data fetching.

You can change your code to render_sql like next

String sql = "select * from eventos where EmperasaID = "+empresaID.toString();
sc.render_table(sql,"id","start_date,end_date,text,funcionario,cliente,servico,EmpresaID");

Hello Stanislav,

Thank you for the help, actually it just works with:

String sql = "eventos where EmpresaID = "+empresaID.toString();
sc.render_table(sql,“id”,“start_date,end_date,text,funcionario,cliente,servico,EmpresaID”);

:slight_smile:

Best regards,