Examples of WOElement


Examples of com.webobjects.appserver.WOElement

    response.appendContentString("<ul>");

    int maxItems = maxItems();
    int itemsCount = 0;
    Object values = valueForBinding("list");
    WOElement child = _childTemplate();
    boolean hasItem = hasBinding("item");
    if (values instanceof NSArray) {
      for(@SuppressWarnings("unchecked")
      Enumeration<Object> valueEnum = ((NSArray<Object>)values).objectEnumerator(); valueEnum.hasMoreElements() && itemsCount++ < maxItems;) {
        appendItemToResponse(valueEnum.nextElement(), child, hasItem, response, context);
View Full Code Here

Examples of com.webobjects.appserver.WOElement

    }

    public WOElement frameContent()  {
        isInvoking = false;
        log.info("frameContent");
        WOElement aContentElement = null;
        if (hasBinding("pageName")) {
            String  aPageName = (String)valueForBinding("pageName");
            aContentElement = pageWithName(aPageName);
        } else if(hasBinding("value")) {
            aContentElement = (WOElement)valueForBinding("value");
View Full Code Here

Examples of com.webobjects.appserver.WOElement

  @Override
  public WOActionResults invokeChildrenAction(WORequest worequest, WOContext wocontext) {
    WOActionResults woactionresults = super.invokeChildrenAction(worequest, wocontext);

    if (woactionresults != null) {
      WOElement nextComponent;
      if (woactionresults instanceof WOElement) {
        nextComponent = (WOElement) woactionresults;
      }
      else {
        ERXResponseComponent responseComponent = new ERXResponseComponent(wocontext);
View Full Code Here

Examples of com.webobjects.appserver.WOElement

        _templateName = (WOAssociation) associations.objectForKey("templateName");
        _defaultTemplate = woelement == null ? new WOHTMLBareString("") : woelement;
    }

    private WOElement template(WOComponent component) {
      WOElement content =  component._childTemplate();
      WOElement result = null;
      String templateName = (_templateName == null) ? null : (String) _templateName.valueInComponent(component);
      if (content instanceof WODynamicGroup) {
      WODynamicGroup group = (WODynamicGroup) content;
      if (templateName == null) {
        // MS: If you don't set a template name, then let's construct all the children of
        // this element that are NOT ERXWOTemplate's, so we don't double-display.  This lets
        // you use an ERXWOComponentContent and have it just act like a "default" template
        // that skips all the children that are explicitly wrapped in an ERXWOTemplate.
        NSMutableArray<WOElement> originalChildrenElements = group.childrenElements();
        if (originalChildrenElements != null && originalChildrenElements.count() > 0) {
          NSMutableArray<WOElement> nonTemplateChildrenElements = new NSMutableArray<WOElement>();
          for (WOElement originalChild : originalChildrenElements) {
            if (!(originalChild instanceof ERXWOTemplate)) {
              nonTemplateChildrenElements.addObject(originalChild);
            }
          }
          result = new WODynamicGroup(null, null, nonTemplateChildrenElements);
        }
      }
      else {
            for(Enumeration e = group.childrenElements().objectEnumerator(); e.hasMoreElements() && result == null ; ) {
              WOElement current = (WOElement) e.nextElement();
              if(current instanceof ERXWOTemplate) {
                ERXWOTemplate template = (ERXWOTemplate)current;
                String name = template.templateName(component);
                if(name.equals(templateName)) {
                  result = template;
View Full Code Here

Examples of com.webobjects.appserver.WOElement

    }

    @Override
    public void takeValuesFromRequest(WORequest worequest, WOContext wocontext) {
      WOComponent component = wocontext.component();
      WOElement template = template(component);
      if(template != null) {
        wocontext._setCurrentComponent(component.parent());
         template.takeValuesFromRequest(worequest, wocontext);
        wocontext._setCurrentComponent(component);
      } else {
        _defaultTemplate.takeValuesFromRequest(worequest, wocontext);
      }
    }
View Full Code Here

Examples of com.webobjects.appserver.WOElement

    }

    @Override
    public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) {
      WOComponent component = wocontext.component();
      WOElement template = template(component);
      WOActionResults result;
      if(template != null) {
        wocontext._setCurrentComponent(component.parent());
        result = template.invokeAction(worequest, wocontext);
        wocontext._setCurrentComponent(component);
      } else {
        result = _defaultTemplate.invokeAction(worequest, wocontext);
      }
      return result;
View Full Code Here

Examples of com.webobjects.appserver.WOElement

    }

    @Override
    public void appendToResponse(WOResponse woresponse, WOContext wocontext) {
        WOComponent component = wocontext.component();
        WOElement template = template(component);
        if(template != null) {
          wocontext._setCurrentComponent(component.parent());
          template.appendToResponse(woresponse, wocontext);
          wocontext._setCurrentComponent(component);
        } else {
          _defaultTemplate.appendToResponse(woresponse, wocontext);
        }
    }
View Full Code Here

Examples of com.webobjects.appserver.WOElement

      response = ((WOActionResults)_component).generateResponse();
      responseAsPdf(response, context);
    } else {
      response = WOApplication.application().createResponseInContext(context);

      WOElement currentElement = context._pageElement();
      context._setPageElement(_component);
      appendToResponse(response, context);
      context._setPageElement(currentElement);
    }
    return response;
View Full Code Here

Examples of com.webobjects.appserver.WOElement

    }
    return name;
  }

  public WOElement _realComponentWithName(String name, String elementID, WOContext paramWOContext) {
    WOElement localWOElement;
    synchronized (this) {
      localWOElement = (WOElement) componentCache.objectForKey(elementID);

      if (localWOElement == null) {
        localWOElement = WOApplication.application().dynamicElementWithName(name, componentAttributes, template, paramWOContext._languages());
View Full Code Here

Examples of com.webobjects.appserver.WOElement

    String name = componentNameInContext(paramWOContext.component());
    String id = _elementNameInContext(name, paramWOContext);

    paramWOContext.appendElementIDComponent(id);

    WOElement localWOElement = _realComponentWithName(name, id, paramWOContext);

    localWOElement.takeValuesFromRequest(paramWORequest, paramWOContext);

    paramWOContext.deleteLastElementIDComponent();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.