Package javax.faces.component

Examples of javax.faces.component.UIComponent


            source = behaviorContext.getSourceId();
        } else {
            source = JSReference.THIS;

            FacesContext facesContext = behaviorContext.getFacesContext();
            UIComponent component = behaviorContext.getComponent();

            options.setAjaxComponent(component.getClientId(facesContext));
            options.set("sourceId", source);
        }

        if (behavior.isResetValues()) {
            options.setParameter(AjaxConstants.RESET_VALUES_PARAMETER, true);
View Full Code Here




    private AjaxOptions buildAjaxOptions(ClientBehaviorContext behaviorContext, AjaxClientBehavior ajaxBehavior) {
        FacesContext facesContext = behaviorContext.getFacesContext();
        UIComponent component = behaviorContext.getComponent();

        AjaxOptions ajaxOptions = new AjaxOptions();

        Map<String, Object> parametersMap = RendererUtils.getInstance().createParametersMap(facesContext, component);
        ajaxOptions.addParameters(parametersMap);
View Full Code Here

  private int addMenuEntrys(StringBuilder sb, String var,
      FacesContext facesContext, List<String> accKeyFunctions, UIComponent component, boolean warn, int index)
      throws IOException {
    for (Object o : component.getChildren()) {
      UIComponent entry = (UIComponent) o;
      if (entry instanceof UICommand) {
        addMenuEntry(sb, var, facesContext, accKeyFunctions, (UICommand) entry);
      } else if (entry instanceof UIMenuSeparator) {
        addMenuSeparator(sb, var);
      } else if (entry instanceof UIMenu) {
        index = addMenu(sb, var, facesContext, accKeyFunctions, (UIPanel) entry, index);
      } else if (entry instanceof UIForm) {
        index = addMenuEntrys(sb, var, facesContext, accKeyFunctions, entry, warn, index);
      } else if (warn) {
        LOG.error("Illegal UIComponent class in menuBar: "
            + entry.getClass().getName());
      }
    }
    return index;
  }
View Full Code Here

      UICommand command) throws IOException {
    CommandRendererHelper helper = new CommandRendererHelper(facesContext, command);
    String onclick = helper.getOnclick();
    if (command instanceof UIMenuCommand) {
      if (command.getFacet(FACET_ITEMS) != null) {
        UIComponent facet = command.getFacet(FACET_ITEMS);
        if (facet instanceof UISelectOne) {
          addSelectOne(sb, var, facesContext, accKeyFunctions, command, onclick);
        } else if (facet instanceof UISelectBoolean) {
          addSelectBoolean(sb, var, facesContext, accKeyFunctions, command, onclick);
        }
View Full Code Here

  }

  private void addSelectBoolean(StringBuilder sb, String var, FacesContext facesContext, List<String> accKeyFunctions,
      UICommand command, String onClick) throws IOException {

    UIComponent checkbox = command.getFacet(FACET_ITEMS);
    if (checkbox == null) {
      checkbox = ComponentUtil.createUISelectBooleanFacet(facesContext, command);
      checkbox.setId(facesContext.getViewRoot().createUniqueId());
    }

    final boolean checked = ComponentUtil.getBooleanAttribute(checkbox, ATTR_VALUE);

    String clientId = checkbox.getClientId(facesContext);
    onClick = RenderUtil.addMenuCheckToggle(clientId, onClick);
    if (checked) {
      sb.append("    menuCheckToggle('").append(clientId).append("');\n");
    }
    String image = checked ? "image/MenuCheckmark.gif" : null;
View Full Code Here

        try
        {
            final Object retVal = componentExpression.getValue(elContext);

            UIComponent createdComponent;

            if (retVal instanceof UIComponent)
            {
                createdComponent = (UIComponent) retVal;
            }
View Full Code Here

    extends RendererBase implements LayoutInformationProvider {

  public int getHeaderHeight(
      FacesContext facesContext, UIComponent component) {
    int height = getConfiguredValue(facesContext, component, "headerHeight");
    final UIComponent menubar = component.getFacet(FACET_MENUBAR);
    if (menubar != null) {
      height += getConfiguredValue(facesContext, menubar, "headerHeight");
    }
    return height;
  }
View Full Code Here

    int fixedSpace = 0;

    if (component instanceof UICell) {
      List children = LayoutUtil.addChildren(new ArrayList(), component);
      for (Object aChildren : children) {
        UIComponent child = (UIComponent) aChildren;

        LayoutInformationProvider renderer = ComponentUtil.getRenderer(facesContext, child);
        if (renderer != null) {
          if (width) {
            fixedSpace = Math.max(fixedSpace, renderer.getFixedWidth(facesContext, child));
View Full Code Here

              ((UICommand) facetEntry.getValue()).getRenderedPartially()[0]) + "','"
              + facetEntry.getValue().getClientId(facesContext) + "', {})});\n"
              + "}";
      writer.writeJavascript(script);
    } else {
      UIComponent facetComponent = facetEntry.getValue();
      String facetAction = (String) facetComponent.getAttributes().get(ATTR_ONCLICK);
      if (facetAction == null) {
        facetAction = "Tobago.submitAction2(this, '" + facetComponent.getClientId(facesContext) + "', null, null)";
      }
      String script =
          "var element = Tobago.element(\"" + clientId + "\");\n"
              + "if (element) {\n"
              + "   Tobago.addEventListener(element, \"" + facetEntry.getKey() + "\", function(){"
View Full Code Here

    UILayout layout = UILayout.getLayout(panel);
    if (layout != null) {
      layout.encodeChildrenOfComponent(facesContext, panel);
    } else {
      for (Object o : panel.getChildren()) {
        UIComponent child = (UIComponent) o;
        encode(facesContext, child);
      }
    }
  }
View Full Code Here

TOP

Related Classes of javax.faces.component.UIComponent

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.