> For the complete documentation index, see [llms.txt](https://nosicode.gitbook.io/faq/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nosicode.gitbook.io/faq/intermediate/how-to-fill-separator-list.md).

# How to fill SeparatorList or FormList

This page shows two ways how to fill separatorlist or Formlist

## 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 [here ](https://nosicode.gitbook.io/faq/~/edit/drafts/-LIg-Mq_5bIQ9pN1nuEX/intermediate/how-to-map-an-entity-to-table-using-hibernate)to see how do that) \[Fig. Class DAO]

```java
	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);	
	}
```

![Class DAO Teste](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIl4sBx67qhPa40Efee%2F-LIl7tlMwmUHCP_xntx_%2Fimage.png?alt=media\&token=b2d1d229-f196-46b6-bc20-4833d47ca781)

## SQL

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

![\[Fig. 1\] PAge](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIRYWYQNafC4qsFNGpy%2F-LIRe4ghACPu_od7fQua%2Fimage.png?alt=media\&token=ed528f19-2f5e-4454-b6b7-b7beb700e489)

\
**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]

```java
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]

![\[Fig. 2\] Separator List](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIRYWYQNafC4qsFNGpy%2F-LIRfkr-rBRWefsUAHSU%2Fimage.png?alt=media\&token=a00671bc-8c4e-4a3f-8fd1-5d1a21a1702d)

![\[Fig. 3\] Database](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIRYWYQNafC4qsFNGpy%2F-LIRgEAXIcBfLSfmnEM8%2Fimage.png?alt=media\&token=5fcde3eb-bfe0-46a9-acac-ba0cd5ae5f9e)
