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
  • Java
  • SQL
  1. Intermediate

How to fill SeparatorList or FormList

This page shows two ways how to fill separatorlist or Formlist

PreviousHow to make a SoapRequestNextHow to map an entity to table using hibernate??

Last updated 6 years ago

Java

To do this, all we have to do is the same step shown above, except in step 2 ... instead of the above code, put this code, with a small detail, the class Teste is a DAO class created earlier (click to see how do that) [Fig. Class DAO]

	public Response actionIndex() throws IOException, IllegalArgumentException, IllegalAccessException{
		
		Page_home model = new Page_home();
		model.load();
		Page_homeView view = new Page_homeView();
		
		
		/*----#start-code(index)----*/
		Teste teste = new Teste();
		List<Teste> lista_teste = teste.findAll();
		ArrayList<Page_home.Separatorlist_1> lista_final = new ArrayList<>();
		for(Teste lista: lista_teste) {
			Page_home.Separatorlist_1 separa = new Page_home.Separatorlist_1();
			separa.setMae(new Pair(lista.getMae(),lista.getMae()));
			separa.setPai(new Pair(lista.getPai(),lista.getPai()));
			separa.setIdade(new Pair(lista.getIdade()+"",lista.getIdade()+""));
			separa.setNome(new Pair(lista.getNome(),lista.getNome()));
			lista_final.add(separa);
		}
		model.setSeparatorlist_1(lista_final);
		/*----#end-code----*/
		view.setModel(model);
		return this.renderView(view);	
	}

SQL

Step 1: First of all, create your application and connect to your database, create your page and put a separator list [Fig. 1]

Step 2: Then, click "JAVA" and your controller put this code below, specify your connection name [ex. teste_isac_pg_1] and your select [ex. SELECT nome as nome, pai as nome_de_pai, mae as nome_da_mae, idade as idade FROM public.teste]

public class Insert_fotoController extends Controller {		

	public Response actionIndex() throws IOException, IllegalArgumentException, IllegalAccessException{
		
		Insert_foto model = new Insert_foto();
		model.load();
		Insert_fotoView view = new Insert_fotoView();
		/*----#start-code(index)----*/
		model.loadSeparatorlist_1(Core.query("teste_isac_pg_1","SELECT nome as nome, pai as nome_de_pai, mae as nome_da_mae, idade as idade FROM public.teste "));
		/*----#end-code----*/
		view.setModel(model);
		return this.renderView(view);	
	}
	
	/*----#start-code(custom_actions)----*/
	
	
		/*----#end-code----*/
	}

and voilá [Fig. 2]... it's show the data is stored in test database[Fig. 3]

here
Class DAO Teste
[Fig. 1] PAge
[Fig. 2] Separator List
[Fig. 3] Database