Package org.richfaces.json

Examples of org.richfaces.json.JSONWriter


  /**
   * Create default column visibility based on component children.
   */
  private void createDefaultColumnsVisibility(UIExtendedDataTable extendedDataTable){
    try {
      JSONWriter writer = new JSONStringer().object();
      for (Iterator<UIColumn> iter = extendedDataTable.getChildColumns(); iter.hasNext();) {
        UIColumn col = iter.next();
        writer.key(col.getId()).value(col.isVisible() ? TRUE : FALSE);
      }
      value = new JSONObject(writer.endObject().toString());
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }//createDefaultColumnsVisibility
View Full Code Here


  /**
   * Create default column order based on component children.
   */
  private void createDefaultColumnsSizeState(UIExtendedDataTable extendedDataTable){
    try {
      JSONWriter writer = new JSONStringer().object();
      for (Iterator<UIColumn> iter = extendedDataTable.getChildColumns(); iter.hasNext();) {
        UIColumn col = iter.next();
        writer.key(col.getId()).value(getDefaultColumnSize(col));
      }
      value = new JSONObject(writer.endObject().toString());
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    /**
     * Initialize state from an extendedDataTable
     */
    ColumnsState (UIDataTableBase extendedDataTable) {
        try {
            JSONWriter writer = new JSONStringer().object();
            Iterator<UIComponent> iterator = extendedDataTable.columns();
            while (iterator.hasNext()) { // initialize a map of all the columns
                UIComponent component = iterator.next();
                AbstractColumn column = (AbstractColumn) component;
                writer.key(column.getId()).value(getValueFromColumn(column));
            }
            json = new JSONObject(writer.endObject().toString());
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of org.richfaces.json.JSONWriter

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.