Hirdetés

Új hozzászólás Aktív témák

  • Taoharcos

    aktív tag

    Sziasztok!

    Arraylist tartalmát szeretném datable segítségével megjeleníteni JSF-ben. De nem tudom mi lenne a jó megoldás. Én ezzel próbálkoztam eredménytelenül:
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package beans;

    import database.Database;
    import java.util.ArrayList;

    /**
    *
    * @author Zoli
    */
    public class AllWordBean {

    //private int index;
    ArrayList <Integer> idList;
    ArrayList <String> hunList;
    ArrayList <String> engList;
    database.Database database = new Database();
    int index;

    public AllWordBean(){
    database.setQuery("", true, false);
    database.execQuery();
    this.idList = database.getIdList();
    this.hunList = database.getHunList();
    this.engList = database.getEngList();
    this.index = idList.size();

    }

    private allWordTable[] wordTable = new allWordTable[]{
    for(int i = 0; i<index; i++){
    new allWordTable(idList.get(index), hunList.get(index), engList.get(index));
    }
    };

    public allWordTable[] getallWordTable(){
    return wordTable;
    }

    public class allWordTable{

    int id;
    String hunw;
    String engw;
    public allWordTable(int id, String hunw, String engw){
    this.id = id;
    this.hunw = hunw;
    this.engw = engw;
    }

    public String getEngw() {
    return engw;
    }

    public String getHunw() {
    return hunw;
    }

    public int getId() {
    return id;
    }

    public int getIndex(){
    return index;
    }

    }

    }

    Lényegében ezzel e résszel van a bibi:
    private allWordTable[] wordTable = new allWordTable[]{
    for(int i = 0; i<index; i++){
    new allWordTable(idList.get(index), hunList.get(index), engList.get(index));
    }
    };

    de nem tudom hogyan lehetne az arraylistet megjeleníteni jól.

    [ Szerkesztve ]

Új hozzászólás Aktív témák