Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.ListPageInterface


        public WOComponent searchAction(WOComponent currentPage) {
            D2WContext d2wContext = ((D2WComponent)currentPage.parent()).d2wContext();
            EODataSource ds = ((QueryPageInterface)currentPage.parent()).queryDataSource();
            log.info("searchAction: " + ds);
            ListPageInterface listpageinterface = null;
            String listConfigurationName=(String)d2wContext.valueForKey("listConfigurationName");
            if(listConfigurationName==null) {
                listConfigurationName = "__list__" + d2wContext().entity().name();
            }
            listpageinterface = (ListPageInterface)pageForConfigurationNamed(listConfigurationName);
            listpageinterface.setDataSource(ds);
            listpageinterface.setNextPage(returnPage());
            return (WOComponent) listpageinterface;
        }
View Full Code Here


          if (page instanceof InspectPageInterface) {
            InspectPageInterface ipi = (InspectPageInterface) page;
            ipi.setObject(EOUtilities.createAndInsertInstance(ec, entityName));
            ipi.setNextPage(page);
          } else if (page instanceof ListPageInterface) {
            ListPageInterface lpi = (ListPageInterface) page;
            lpi.setDataSource(ERXEOControlUtilities.dataSourceForArray(ec, entityName, new NSArray(EOUtilities.createAndInsertInstance(ec, entityName))));
            lpi.setNextPage(page);
          } else if (page instanceof SelectPageInterface) {
            SelectPageInterface lpi = (SelectPageInterface) page;
            lpi.setDataSource(ERXEOControlUtilities.dataSourceForArray(ec, entityName, new NSArray(EOUtilities.createAndInsertInstance(ec, entityName))));
          } else if (page instanceof ConfirmPageInterface) {
            ConfirmPageInterface cpi = (ConfirmPageInterface) page;
            // nothing
          } else if (page instanceof QueryPageInterface) {
            QueryPageInterface qpi = (QueryPageInterface) page;
View Full Code Here

            // construct datasource
          EOEditingContext ec = ERXEC.newEditingContext(session().defaultEditingContext().parentObjectStore());
            queryDataSource = new EODatabaseDataSource(ec, entity().name());
            queryDataSource.setAuxiliaryQualifier(displayGroup().qualifierFromQueryValues());

            ListPageInterface lpi;
            if(listConfigurationName() != null) {
                lpi = (ListPageInterface)D2W.factory().pageForConfigurationNamed(listConfigurationName(), session());
            } else {
                lpi = D2W.factory().listPageForEntityNamed(entity().name(), session());
            }
           
            lpi.setDataSource(queryDataSource);
            lpi.setNextPage(context().page());
           
            // remove old values for next iteration
            displayGroup.queryMatch().removeAllObjects();
            displayGroup.queryOperator().removeAllObjects();
            result = (WOComponent)lpi;
View Full Code Here

    sortOrderings = sortOrderings != null ? sortOrderings : NSArray.EmptyArray;
    dg.setSortOrderings(sortOrderings);
  }

  public static WOComponent printerFriendlyVersion(D2WContext d2wContext, WOSession session, EODataSource dataSource, WODisplayGroup displayGroup) {
    ListPageInterface result = (ListPageInterface) ERD2WFactory.erFactory().printerFriendlyPageForD2WContext(d2wContext, session);
    result.setDataSource(dataSource);
    WODisplayGroup dg = null;
    if (result instanceof D2WListPage) {
      dg = ((D2WListPage) result).displayGroup();
    } else if (result instanceof ERDListPageInterface) {
      dg = ((ERDListPageInterface) result).displayGroup();
    } else {
      try {
        dg = (WODisplayGroup) ((WOComponent) result).valueForKey("displayGroup");
      } catch (Exception ex) {
        log.warn("Can't get displayGroup from page of class: " + result.getClass().getName());
      }
    }
    if (dg != null) {
      dg.setSortOrderings(displayGroup.sortOrderings());
      dg.setNumberOfObjectsPerBatch(displayGroup.allObjects().count());
View Full Code Here

      searchValue = defaultValue();
      super.appendToResponse(r, c);
    }

    public WOComponent searchAction() {
        ListPageInterface lpi = null;
        if(searchValue != null) {
            String listConfigurationName = (String) valueForBinding("listConfigurationName");
            String entityName = (String) valueForBinding("entityName");
            EODatabaseDataSource ds = queryDatasource(entityName);
            if(hasBinding("queryDatasource")) {
                setValueForBinding(ds, "queryDatasource");
                return (WOComponent) performParentAction("searchAction");
            }
            if(listConfigurationName != null) {
                lpi = (ListPageInterface) D2W.factory().pageForConfigurationNamed(listConfigurationName, session());
            } else {
                lpi = D2W.factory().listPageForEntityNamed(entityName, session());
            }
            lpi.setDataSource(ds);
            lpi.setNextPage(context().page());
        }
        return (WOComponent)lpi;
    }
View Full Code Here

        QueryPageInterface qpi = (QueryPageInterface)D2W.factory().pageForConfigurationNamed("FindTalent", this);
        return (WOComponent)qpi;
    }

    public WOComponent listAllMovies() {
        ListPageInterface lpi = (ListPageInterface)D2W.factory().pageForConfigurationNamed("ListAllMovies", this);
        EODataSource ds = new EODatabaseDataSource(ERXEC.newEditingContext(), "Movie");
        lpi.setDataSource(ds);
        return (WOComponent)lpi;
    }
View Full Code Here

            setShowResults(true);
        } else {
          nextPage = nextPageFromDelegate();
            if (nextPage == null) {
                String listConfigurationName = (String) d2wContext().valueForKey("listConfigurationName");
                ListPageInterface listpageinterface;
                if (listConfigurationName != null) {
                    listpageinterface = (ListPageInterface) D2W.factory().pageForConfigurationNamed(listConfigurationName, session());
                } else {
                    listpageinterface = D2W.factory().listPageForEntityNamed(entity().name(), session());
                }
                listpageinterface.setDataSource(queryDataSource());
                listpageinterface.setNextPage(context().page());
                nextPage = (WOComponent) listpageinterface;
            }
        }
        return nextPage;
    }
View Full Code Here

        return _list;
    }

    public WOComponent view() {
      String listConfigurationName = (String)valueForBinding("listConfigurationName");
        ListPageInterface ipi = (ListPageInterface)D2W.factory().pageForConfigurationNamed(listConfigurationName, session());
        ipi.setNextPage(context().page());
        ipi.setDataSource(ERXEOControlUtilities.dataSourceForArray(list()));
        return (WOComponent)ipi;
    }
View Full Code Here

    } else {
      nextPage = nextPageFromDelegate();
      boolean allowInlineEditing = ERXValueUtilities.booleanValue(d2wContext().valueForKey("allowInlineEditing"));
      if (nextPage == null && !allowInlineEditing) {
        String listConfigurationName = (String) d2wContext().valueForKey("listConfigurationName");
        ListPageInterface listpageinterface;
        if (listConfigurationName != null) {
          listpageinterface = (ListPageInterface) D2W.factory().pageForConfigurationNamed(listConfigurationName, session());
        } else {
          listpageinterface = D2W.factory().listPageForEntityNamed(entity().name(), session());
        }
        listpageinterface.setDataSource(queryDataSource());
        listpageinterface.setNextPage(context().page());
        nextPage = (WOComponent) listpageinterface;
      }
    }
    return nextPage;
  }
View Full Code Here

    public Main(WOContext context) {
        super(context);
    }

    public WOComponent showList() {
        ListPageInterface nextPage = (ListPageInterface) D2W.factory().pageForConfigurationNamed("ListAjaxBug", session());
        EODatabaseDataSource ds = new EODatabaseDataSource(session().defaultEditingContext(), "Bug");
        ds.setFetchSpecification(new EOFetchSpecification("Bug", null, null));
        ds.fetchSpecification().setFetchLimit(5);
        nextPage.setDataSource(ds);
        return (WOComponent) nextPage;
    }
View Full Code Here

TOP

Related Classes of com.webobjects.directtoweb.ListPageInterface

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.