Examples of FormItem


Examples of com.smartgwt.client.widgets.form.fields.FormItem

   *
   * @param name attribute name
   * @param attribute attribute value
   */
  protected void setValue(String name, CurrencyAttribute attribute) {
    FormItem item = formWidget.getField(name);
    if (item != null) {
      item.setValue(attribute.getValue());
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.fields.FormItem

   *
   * @param name attribute name
   * @param attribute attribute value
   */
  protected void setValue(String name, StringAttribute attribute) {
    FormItem item = formWidget.getField(name);
    if (item != null) {
      item.setValue(attribute.getValue());
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.fields.FormItem

   *
   * @param name attribute name
   * @param attribute attribute value
   */
  protected void setValue(String name, UrlAttribute attribute) {
    FormItem item = formWidget.getField(name);
    if (item != null) {
      item.setValue(attribute.getValue());
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.fields.FormItem

   *
   * @param name attribute name
   * @param attribute attribute value
   */
  protected void setValue(String name, ImageUrlAttribute attribute) {
    FormItem item = formWidget.getField(name);
    if (item != null) {
      item.setValue(attribute.getValue());
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.fields.FormItem

   *
   * @param name attribute name
   * @param attribute attribute value
   */
  protected void setValue(String name, DateAttribute attribute) {
    FormItem item = formWidget.getField(name);
    if (item != null) {
      item.setValue(attribute.getValue());
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.fields.FormItem

   * @param info The actual attribute info to create a form item for.
   * @param attributeProvider The attribute value provider for association attributes
   * @return The new form item instance associated with the type of attribute.
   */
  public static FormItem createFormItem(AttributeInfo info, AttributeProvider attributeProvider) {
    FormItem formItem = null;
    if (info.getFormInputType() != null) {
      formItem = FORMITEMS.get(info.getFormInputType()).create();
    }
    if (formItem == null) {
      if (info instanceof PrimitiveAttributeInfo) {
        String name = ((PrimitiveAttributeInfo) info).getType().name();
        formItem = FORMITEMS.get(name).create();
      } else if (info instanceof AssociationAttributeInfo) {
        String name = ((AssociationAttributeInfo) info).getType().name();
        formItem = FORMITEMS.get(name).create();
      }
    }
    if (formItem != null) {
      formItem.setName(info.getName());
      formItem.setTitle(info.getLabel());
      formItem.setValidateOnChange(true);
      formItem.setWidth("*");

      // Special treatment for associations
      if (info instanceof AssociationAttributeInfo) {
        AssociationAttributeInfo associationInfo = (AssociationAttributeInfo) info;
        String displayName = associationInfo.getFeature().getDisplayAttributeName();
        if (displayName == null) {
          displayName = associationInfo.getFeature().getAttributes().get(0).getName();
        }
        formItem.setDisplayField(displayName);
        Object o = formItem.getAttributeAsObject(AssociationItem.ASSOCIATION_ITEM_ATTRIBUTE_KEY);
        if (o instanceof OneToManyItem<?>) {
          OneToManyItem<?> item = (OneToManyItem<?>) o;
          item.init(associationInfo, attributeProvider);
        } else if (o instanceof ManyToOneItem<?>) {
          ManyToOneItem<?> item = (ManyToOneItem<?>) o;
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.FormItem

        }
        return address;
    }

    private static FormItemDeclaration createFormItemDeclaration(Method method) {
        FormItem formItemDeclaration = method.getAnnotation(FormItem.class);
        String defaultValue = "";
        String label = "";
        String localLabel = "";
        boolean required = false;
        String formItemTypeForEdit = "TEXT_BOX";
        String formItemTypeForAdd = "TEXT_BOX";
        String subgroup = "";
        String tabName = "common_label_attributes";
        int order = 100;
        String[] acceptedValues = new String[0];

        if(formItemDeclaration!=null)
        {
            defaultValue = formItemDeclaration.defaultValue();
            label = formItemDeclaration.label();
            localLabel = formItemDeclaration.localLabel();
            required = formItemDeclaration.required();
            formItemTypeForEdit = formItemDeclaration.formItemTypeForEdit();
            formItemTypeForAdd = formItemDeclaration.formItemTypeForAdd();
            subgroup = formItemDeclaration.subgroup();
            tabName = formItemDeclaration.tabName();
            order = formItemDeclaration.order();
            acceptedValues = formItemDeclaration.acceptedValues();
        }

        FormItemDeclaration decl = new FormItemDeclaration(defaultValue, label, localLabel, required,
                                                         formItemTypeForEdit, formItemTypeForAdd,
                                                         subgroup, tabName, order, acceptedValues);
View Full Code Here

Examples of org.jboss.ballroom.client.widgets.forms.FormItem

        return formLayout.build();
    }

    private void buildForm() {
        FormItem name = null;

        if(isCreate)
            name = new TextBoxItem("name", "Name");
        else
            name = new TextItem("name", "Name");
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

  /**
   * remove the component with the give name from this container   
   * @param name
   */
  public void remove(String formCompName) {
    FormItem toBeRemoved = getFormComponent(formCompName);
    remove(formCompName, toBeRemoved);
  }
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

    //enable / disable this
    super.setEnabled(isEnabled);
    //iterate over all components and disable / enable them
    Collection formItems = getFormComponents().values();
    for (Iterator iter = formItems.iterator(); iter.hasNext();) {
      FormItem element = (FormItem) iter.next();
      element.setEnabled(isEnabled);
    }
  }
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.