Package com.sun.jsftemplating.component.dataprovider

Examples of com.sun.jsftemplating.component.dataprovider.MultipleListDataProvider


      @HandlerInput(name="rowKeys", type=RowKey[].class, required=true)})
    public static void deleteTableRows(HandlerContext handlerCtx) {
  TableRowGroup trg =
      (TableRowGroup) handlerCtx.getInputValue("tableRowGroup");
  RowKey[] keys = (RowKey []) handlerCtx.getInputValue("rowKeys");
        MultipleListDataProvider dp =
      (MultipleListDataProvider) trg.getSourceData();
  for (RowKey key : keys) {
      dp.removeRow(key);
  }
    }
View Full Code Here


  input={
      @HandlerInput(name="tableRowGroup", type=TableRowGroup.class, required=true)})
    public static void commitTableRowGroup(HandlerContext handlerCtx) {
  TableRowGroup trg =
      (TableRowGroup) handlerCtx.getInputValue("tableRowGroup");
        MultipleListDataProvider dp =
      (MultipleListDataProvider) trg.getSourceData();
  dp.commitChanges();
    }
View Full Code Here

    output={
        @HandlerOutput(name="Rows", type=List.class)})
        public static void getAllSingleMapRows(HandlerContext handlerCtx) {
       
        TableRowGroup trg = (TableRowGroup)handlerCtx.getInputValue("TableRowGroup");
        MultipleListDataProvider dp = (MultipleListDataProvider)trg.getSourceData();
        List data = dp.getLists();
        try {
            handlerCtx.setOutputValue("Rows", data.get(0));
        }catch(Exception ex){
            //TODO alert user, log exception
            System.out.println("!!!! getAllSingleMapRows() Throws Exception: " + ex.toString());
View Full Code Here

    public static void addRowToTable(HandlerContext handlerCtx) {
        TableRowGroup trg = (TableRowGroup)handlerCtx.getInputValue("TableRowGroup");
        List names = (List)handlerCtx.getInputValue("NameList");
        List defaults = (List)handlerCtx.getInputValue("DefaultValueList");
        Boolean hasSelected = (Boolean)handlerCtx.getInputValue("HasSelected");
        MultipleListDataProvider dp = (MultipleListDataProvider)trg.getSourceData();
        List data = dp.getLists();
        ListIterator li = data.listIterator();
        if (li.hasNext()) {
      // Get the first List and create a new Map to represent the row
            List list = (List) li.next();
            Map<String, Object> map = new HashMap<String, Object>();
View Full Code Here

        @HandlerInput(name="TableRowGroup", type=TableRowGroup.class, required=true)},
    output={
        @HandlerOutput(name="selectedRows", type=List.class)})
        public static void getSelectedSingleMapRows(HandlerContext handlerCtx) {
        TableRowGroup trg = (TableRowGroup)handlerCtx.getInputValue("TableRowGroup");
        MultipleListDataProvider dp = (MultipleListDataProvider)trg.getSourceData();
        List selectedList = new ArrayList();
        try {
           RowKey[] rowKeys  = trg.getSelectedRowKeys();
          
           for(int i=0; i<rowKeys.length; i++){
               Object[] multiDataRows =  (Object[]) dp.getObject(rowKeys[i]);
               Object oneMap = multiDataRows[0];
               selectedList.add(oneMap);
            }
            handlerCtx.setOutputValue("selectedRows", selectedList);
        }catch(Exception ex){
View Full Code Here

      @HandlerInput(name="rowKeys", type=RowKey[].class, required=true)})
    public static void deleteTableRows(HandlerContext handlerCtx) {
  TableRowGroup trg =
      (TableRowGroup) handlerCtx.getInputValue("tableRowGroup");
  RowKey[] keys = (RowKey []) handlerCtx.getInputValue("rowKeys");
        MultipleListDataProvider dp =
      (MultipleListDataProvider) trg.getSourceData();
  for (RowKey key : keys) {
      dp.removeRow(key);
  }
    }
View Full Code Here

  input={
      @HandlerInput(name="tableRowGroup", type=TableRowGroup.class, required=true)})
    public static void commitTableRowGroup(HandlerContext handlerCtx) {
  TableRowGroup trg =
      (TableRowGroup) handlerCtx.getInputValue("tableRowGroup");
        MultipleListDataProvider dp =
      (MultipleListDataProvider) trg.getSourceData();
  dp.commitChanges();
    }
View Full Code Here

    output={
        @HandlerOutput(name="Rows", type=List.class)})
        public static void getAllSingleMapRows(HandlerContext handlerCtx) {
       
        TableRowGroup trg = (TableRowGroup)handlerCtx.getInputValue("TableRowGroup");
        MultipleListDataProvider dp = (MultipleListDataProvider)trg.getSourceData();
        List data = dp.getLists();
        try {
            handlerCtx.setOutputValue("Rows", data.get(0));
        }catch(Exception ex){
            //TODO alert user, log exception
            System.out.println("!!!! getAllSingleMapRows() Throws Exception: " + ex.toString());
View Full Code Here

    public static void addRowToTable(HandlerContext handlerCtx) {
        TableRowGroup trg = (TableRowGroup)handlerCtx.getInputValue("TableRowGroup");
        List names = (List)handlerCtx.getInputValue("NameList");
        List defaults = (List)handlerCtx.getInputValue("DefaultValueList");
        Boolean hasSelected = (Boolean)handlerCtx.getInputValue("HasSelected");
        MultipleListDataProvider dp = (MultipleListDataProvider)trg.getSourceData();
        List data = dp.getLists();
        ListIterator li = data.listIterator();
        if (li.hasNext()) {
      // Get the first List and create a new Map to represent the row
            List list = (List) li.next();
            Map<String, Object> map = new HashMap<String, Object>();
View Full Code Here

          + " List should be a List of rows.  However, the "
          + "following was passed in: List<" + obj + ">.");
    }
      }
      List<List<Object>> lists = (List<List<Object>>) data;
      Object dataProvider = new MultipleListDataProvider(lists);

      // Remove the data object from the UIComponent, not needed
      Map<String, Object> atts = comp.getAttributes();
      atts.remove("data");
// FIXME: This stores the *data* in the UIComponent... change to use a #{} value binding to push the data somewhere else. Session?? Configurable?
View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.component.dataprovider.MultipleListDataProvider

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.