Package com.google.code.lightssh.common.web.tag.table.components

Examples of com.google.code.lightssh.common.web.tag.table.components.Table


  protected String dynamicCols;

  @Override
  public Component getBean(ValueStack stack, HttpServletRequest req,
      HttpServletResponse res) {
        Table table = new Table(stack, req, res);

        return table;
  }
View Full Code Here


     */
  @SuppressWarnings("unchecked")
  protected void populateParams() {
        super.populateParams();
       
        Table table = ((Table) component);
        table.setValue(value);
        table.setStatus(status);
        table.setPageable("true".equals(pageable));
        table.setPageParamPrefix(pageParamPrefix);
        table.setDynamic("true".equals(dynamic));
       
        if( dynamicCols != null ){
          Object obj = findValue(dynamicCols);
          if( obj != null ){
            List<IColumn> cols = new ArrayList<IColumn>();
           
            if(obj instanceof List ){
              cols = (List<IColumn>)obj;
            }else if( obj instanceof String[] ){//字符串
              Set<String> ids = new HashSet<String>();
                  for(String col:(String[])obj )
                    ids.add(col);
                 
                  int i=0;
                  for( String id:ids )
                    cols.add( new CustomizeColumn(id,String.valueOf(i++)) );
            }else if( obj instanceof Map ){ //参数为Map
              for(Object key:((Map<?,?>)obj).keySet() )
                cols.add( new CustomizeColumn(key.toString()
                    ,((Map<?,?>)obj).get(key).toString()) );
            }
           
            table.setDynamicCols(cols);
          }
         
        }
    }
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.common.web.tag.table.components.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.