public static GridField[] createFields(Properties ctx,int WindowNo,int TabNo,int AD_Tab_ID){
  ArrayList<GridFieldVO> listVO=new ArrayList<GridFieldVO>();
  int AD_Window_ID=0;
  boolean readOnly=false;
  String sql=GridFieldVO.getSQL(ctx);
  PreparedStatement pstmt=null;
  try {
    pstmt=DB.prepareStatement(sql,null);
    pstmt.setInt(1,AD_Tab_ID);
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      GridFieldVO vo=GridFieldVO.create(ctx,WindowNo,TabNo,AD_Window_ID,AD_Tab_ID,readOnly,rs);
      listVO.add(vo);
    }
    rs.close();
    pstmt.close();
    pstmt=null;
  }
 catch (  Exception e) {
    log.log(Level.SEVERE,sql,e);
  }
  try {
    if (pstmt != null)     pstmt.close();
    pstmt=null;
  }
 catch (  Exception e) {
    pstmt=null;
  }
  GridField[] retValue=new GridField[listVO.size()];
  for (int i=0; i < listVO.size(); i++)   retValue[i]=new GridField((GridFieldVO)listVO.get(i));
  return retValue;
}

public static GridField [ ] createFields ( Properties ctx , int WindowNo , int TabNo , int AD_Tab_ID ) { ArrayList < GridFieldVO > listVO = new ArrayList < GridFieldVO > ( ) ; int AD_Window_ID = 0 ; boolean readOnly = false ; String sql = GridFieldVO . getSQL ( ctx ) ; PreparedStatement pstmt = null ; try { pstmt = DB . prepareStatement ( sql , null ) ; pstmt . setInt ( 1 , AD_Tab_ID ) ; ResultSet rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) ) { GridFieldVO vo = GridFieldVO . create ( ctx , WindowNo , TabNo , AD_Window_ID , AD_Tab_ID , readOnly , rs ) ; listVO . add ( vo ) ; } rs . close ( ) ; pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { log . log ( Level . SEVERE , sql , e ) ; } try { if ( pstmt != null ) pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { pstmt = null ; } GridField [ ] retValue = new GridField [ listVO . size ( ) ] ; for ( int i = 0 ; i < listVO . size ( ) ; i ++ ) retValue [ i ] = new GridField ( ( GridFieldVO ) listVO . get ( i ) ) ; return retValue ; }
create fields . used by apanel . cmd_find and viewer . cmd_find
