Package org.apache.myfaces.tobago.component

Examples of org.apache.myfaces.tobago.component.UIForm


    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      Application application = faceletContext.getFacesContext().getApplication();
      UIViewRoot root = ComponentSupport.getViewRoot(faceletContext, parent);

      UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      form.setId(formIdAttribute != null ? formIdAttribute.getValue(faceletContext) : root.createUniqueId());
      panel.getChildren().add(form);

      UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      picker.setId(pickerIdAttribute != null ? pickerIdAttribute.getValue(faceletContext) : root.createUniqueId());
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      if (markupAttribute != null) {
        if (markupAttribute.isLiteral()) {
          picker.setMarkup(Markup.valueOf(markupAttribute.getValue()));
        } else {
          ValueExpression expression = markupAttribute.getValueExpression(faceletContext, Object.class);
          ELAdaptor.setExpression(picker, Attributes.MARKUP, expression);
        }
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here


    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      Application application = faceletContext.getFacesContext().getApplication();
      UIViewRoot root = ComponentUtils.findViewRoot(faceletContext, parent);

      UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      form.setId(formIdAttribute != null ? formIdAttribute.getValue(faceletContext) : root.createUniqueId());
      panel.getChildren().add(form);

      UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      picker.setId(pickerIdAttribute != null ? pickerIdAttribute.getValue(faceletContext) : root.createUniqueId());
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      if (markupAttribute != null) {
        if (markupAttribute.isLiteral()) {
          picker.setMarkup(Markup.valueOf(markupAttribute.getValue()));
        } else {
          ValueExpression expression = markupAttribute.getValueExpression(faceletContext, Object.class);
          picker.setValueExpression(Attributes.MARKUP, expression);
        }
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      Application application = faceletContext.getFacesContext().getApplication();
      UIViewRoot root = ComponentSupport.getViewRoot(faceletContext, parent);

      UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      form.setId(root.createUniqueId());
      panel.getChildren().add(form);

      UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      final String id;
      if (pickerIdAttribute !=  null) {
        id = pickerIdAttribute.getValue(faceletContext);
      } else {
        root = ComponentSupport.getViewRoot(faceletContext, parent);
        id = root.createUniqueId();
      }
      picker.setId(id);
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      Application application = faceletContext.getFacesContext().getApplication();
      UIViewRoot root = ComponentSupport.getViewRoot(faceletContext, parent);

      UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      form.setId(formIdAttribute != null ? formIdAttribute.getValue(faceletContext) : root.createUniqueId());
      panel.getChildren().add(form);

      UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      picker.setId(pickerIdAttribute != null ? pickerIdAttribute.getValue(faceletContext) : root.createUniqueId());
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      final Application application = faceletContext.getFacesContext().getApplication();
      final UIViewRoot root = ComponentUtils.findViewRoot(faceletContext, parent);

      final UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      final String formId = formIdAttribute != null
          ? formIdAttribute.getValue(faceletContext)
          : panel.getId() + "_tx_form";
      form.setId(formId);
      panel.getChildren().add(form);

      final UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      final String pickerId = pickerIdAttribute != null
          ? pickerIdAttribute.getValue(faceletContext)
          : panel.getId() + "_tx_picker";
      picker.setId(pickerId);
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      if (markupAttribute != null) {
        if (markupAttribute.isLiteral()) {
          picker.setMarkup(Markup.valueOf(markupAttribute.getValue()));
        } else {
          final ValueExpression expression = markupAttribute.getValueExpression(faceletContext, Object.class);
          picker.setValueExpression(Attributes.MARKUP, expression);
        }
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      Application application = faceletContext.getFacesContext().getApplication();
      UIViewRoot root = ComponentUtils.findViewRoot(faceletContext, parent);

      UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      final String formId = formIdAttribute != null
          ? formIdAttribute.getValue(faceletContext)
          : "_tx_" + faceletContext.generateUniqueId("form");
      form.setId(formId);
      panel.getChildren().add(form);

      UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      final String pickerId = pickerIdAttribute != null
          ? pickerIdAttribute.getValue(faceletContext)
          : "_tx_" + faceletContext.generateUniqueId("picker");
      picker.setId(pickerId);
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      if (markupAttribute != null) {
        if (markupAttribute.isLiteral()) {
          picker.setMarkup(Markup.valueOf(markupAttribute.getValue()));
        } else {
          ValueExpression expression = markupAttribute.getValueExpression(faceletContext, Object.class);
          picker.setValueExpression(Attributes.MARKUP, expression);
        }
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

      return;
    }

    if (panel.getChildCount() == 2) {
      final Application application = faceletContext.getFacesContext().getApplication();
      final UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      final String formId = formIdAttribute != null
          ? formIdAttribute.getValue(faceletContext)
          : panel.getId() + "_tx_form";
      form.setId(formId);
      panel.getChildren().add(form);

      final UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      final String pickerId = pickerIdAttribute != null
          ? pickerIdAttribute.getValue(faceletContext)
          : panel.getId() + "_tx_picker";
      picker.setId(pickerId);
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      if (markupAttribute != null) {
        if (markupAttribute.isLiteral()) {
          picker.setMarkup(Markup.valueOf(markupAttribute.getValue()));
        } else {
          final ValueExpression expression = markupAttribute.getValueExpression(faceletContext, Object.class);
          picker.setValueExpression(Attributes.MARKUP, expression);
        }
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

    super.onComponentPopulated(faceletContext, panel, parent);
    if (panel.getChildCount() == 2) {
      Application application = faceletContext.getFacesContext().getApplication();
      UIViewRoot root = ComponentSupport.getViewRoot(faceletContext, parent);

      UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
      form.setRendererType(RendererTypes.FORM);
      form.setId(formIdAttribute != null ? formIdAttribute.getValue(faceletContext) : root.createUniqueId());
      panel.getChildren().add(form);

      UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
      picker.setRendererType(RendererTypes.DATE_PICKER);
      picker.setFor("@auto");
      picker.setId(pickerIdAttribute != null ? pickerIdAttribute.getValue(faceletContext) : root.createUniqueId());
      if (picker.getAttributes().get(OnComponentCreated.MARKER) == null) {
        picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
        picker.onComponentCreated(faceletContext.getFacesContext(), panel);
      }
      form.getChildren().add(picker);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.component.UIForm

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.