Examples of FormPanel


Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

    layout.setWidth("100%");
    setLayout(layout);
    setDefaultBackgroundColor(this);
    setMonitorWindowResize(true);
    loadTypeBudj();
    final FormPanel formPanel = new FormPanel();
    formPanel.setBorders(false);
    formPanel.setBodyBorder(false);
    formPanel.setHeaderVisible(false);
    FormLayout fl_formPanel = new FormLayout();
    fl_formPanel.setLabelWidth(120);
    formPanel.setLayout(fl_formPanel);
    typeBudj = new SimpleComboBox();
    typeBudj.setAllowBlank(false);
    typeBudj.setStore(storeBudj);
    typeBudj.setName(LigTransfertppModel.TYPE);
    typeBudj.setFieldLabel(messages.type());
    typeBudj.setValueField(SimpleDto.ID);
    typeBudj.setForceSelection(true);
    typeBudj.setTriggerAction(TriggerAction.ALL);
    typeBudj.setDisplayField(SimpleDto.LABEL);
    typeBudj.setSimpleValue("Obj");
    formPanel.add(typeBudj, new FormData(ANCHOR_SPEC));
    final TextField<String> lot = createTextField(MAX_LENGTH_4);
    lot.setName(LigTransfertppModel.LOT1);
    lot.setFieldLabel("Lot1");
    formPanel.add(lot, new FormData(ANCHOR_SPEC));
    final TextField<String> lot2 = createTextField(MAX_LENGTH_4);
    lot2.setName(LigTransfertppModel.LOT2);
    lot2.setFieldLabel("Lot2");
    formPanel.add(lot2, new FormData(ANCHOR_SPEC));
    final TextField<String> fieldDevers = new TextField<String>();
    fieldDevers.setAllowBlank(false);
    fieldDevers.setName(LigTransfertppModel.DEVERS);
    fieldDevers.setFieldLabel("Libelle");
   
    formPanel.add(lot2, new FormData(ANCHOR_SPEC));
    devers = new SimpleComboBox<String>();
    devers.setForceSelection(true);
    devers.setTriggerAction(TriggerAction.ALL);
    devers.setAllowBlank(false);
    devers.setEditable(false);
    devers.add("de");
    devers.add("vers");
    devers.setFieldLabel("De/Vers");
   
    formPanel.add(devers, new FormData(ANCHOR_SPEC));
    TextArea comment = new TextArea();
    comment.setName(LigTransfertppModel.COMMENTAIRES);
    formPanel.add(comment, new FormData(ANCHOR_SPEC));
    comment.setFieldLabel(messages.comment());
    add(formPanel);
    NumberField quantity = createIntegerField(null, true);
    quantity.setName(LigTransfertppModel.QUANTITY);
    formPanel.add(quantity, new FormData(ANCHOR_SPEC));
    quantity.setFieldLabel("Quantite");
   
    NumberField pu = createNumberField(null);
    pu.setName(LigTransfertppModel.PU);
    formPanel.add(pu, new FormData(ANCHOR_SPEC));
    pu.setFieldLabel("PU");
    LigTransfertppModel dataModel = new LigTransfertppModel(new SimpleDto(1, "Obj"), "de");
    storeLigModel = new ListStore<LigTransfertppModel>();
    storeLigModel.add(dataModel);
    formPanel.add(typeBudj, new FormData(ANCHOR_SPEC));
    formBinding = new FormBinding(formPanel);
   
    formBinding.setStore(storeLigModel);
    formBinding.addFieldBinding(new FieldBinding(fieldDevers, LigTransfertppModel.DEVERS));
    formBinding.addFieldBinding(new SimpleComboBoxFieldBinding(devers, LigTransfertppModel.DEVERS));
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

  @Override
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setStyleAttribute("margin", "10px");

    final FormPanel panel = new FormPanel();
    panel.setHeading("File Upload Example");
    panel.setFrame(true);
    panel.setAction("myurl");
    panel.setEncoding(Encoding.MULTIPART);
    panel.setMethod(Method.POST);
    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.setWidth(350);

    TextField<String> name = new TextField<String>();
    name.setFieldLabel("Name");
    panel.add(name);

    FileUploadField file = new FileUploadField();
    file.setAllowBlank(false);
    file.setName("uploadedfile");
    file.setFieldLabel("File");
    panel.add(file);

    List<Stock> list = TestData.getStocks();
    final ListStore<Stock> store = new ListStore<Stock>();
    store.add(list);

    final ComboBox<Stock> combo = new ComboBox<Stock>();
    combo.setFieldLabel("Company");
    combo.setDisplayField("name");
    combo.setName("name");
    combo.setValueField("symbol");
    combo.setForceSelection(true);
    combo.setStore(store);
    combo.setTriggerAction(TriggerAction.ALL);
    panel.add(combo);

    Button btn = new Button("Reset");
    btn.addSelectionListener(new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        panel.reset();
      }
    });
    panel.addButton(btn);

    btn = new Button("Submit");
    btn.addSelectionListener(new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        if (!panel.isValid()) {
          return;
        }
        // normally would submit the form but for example no server set up to
        // handle the post
        // panel.submit();
        MessageBox.info("Action", "You file was uploaded", null);
      }
    });
    panel.addButton(btn);

    add(panel);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

    createForm2();
    add(vp);
  }

  private void createForm1() {
    FormPanel simple = new FormPanel();
    simple.setHeading("Simple Form");
    simple.setFrame(true);
    simple.setWidth(350);

    TextField<String> firstName = new TextField<String>();
    firstName.setFieldLabel("Name");
    firstName.setAllowBlank(false);
    firstName.getFocusSupport().setPreviousId(simple.getButtonBar().getId());
    simple.add(firstName, formData);

    TextField<String> email = new TextField<String>();
    email.setFieldLabel("Email");
    email.setAllowBlank(false);
    simple.add(email, formData);

    List<Stock> stocks = TestData.getStocks();
    Collections.sort(stocks, new Comparator<Stock>() {
      public int compare(Stock arg0, Stock arg1) {
        return arg0.getName().compareTo(arg1.getName());
      }
    });

    ListStore<Stock> store = new ListStore<Stock>();
    store.add(stocks);

    ComboBox<Stock> combo = new ComboBox<Stock>();
    combo.setFieldLabel("Company");
    combo.setDisplayField("name");
    combo.setTriggerAction(TriggerAction.ALL);
    combo.setStore(store);
    simple.add(combo, formData);

    DateField date = new DateField();
    date.setFieldLabel("Birthday");
    simple.add(date, formData);

    TimeField time = new TimeField();
    time.setFieldLabel("Time");
    simple.add(time, formData);

    Slider slider = new Slider();
    slider.setMinValue(40);
    slider.setMaxValue(90);
    slider.setValue(60);
    slider.setIncrement(1);
    slider.setMessage("{0} inches tall");

    final SliderField sf = new SliderField(slider);
    sf.setFieldLabel("Size");
    simple.add(sf, formData);
    CheckBox check1 = new CheckBox();
    check1.setBoxLabel("Classical");

    CheckBox check2 = new CheckBox();
    check2.setBoxLabel("Rock");
    check2.setValue(true);

    CheckBox check3 = new CheckBox();
    check3.setBoxLabel("Blue");

    CheckBoxGroup checkGroup = new CheckBoxGroup();
    checkGroup.setFieldLabel("Music");
    checkGroup.add(check1);
    checkGroup.add(check2);
    checkGroup.add(check3);
    simple.add(checkGroup, formData);

    Radio radio = new Radio();
    radio.setBoxLabel("Red");
    radio.setValue(true);

    Radio radio2 = new Radio();
    radio2.setBoxLabel("Blue");

    RadioGroup radioGroup = new RadioGroup();
    radioGroup.setFieldLabel("Favorite Color");
    radioGroup.add(radio);
    radioGroup.add(radio2);
    simple.add(radioGroup, formData);

    Radio radio3 = new Radio();
    radio3.setBoxLabel("Apple");
    radio3.setValue(true);

    Radio radio4 = new Radio();
    radio4.setBoxLabel("Banana");

    RadioGroup radioGroup2 = new RadioGroup();
    radioGroup2.setFieldLabel("Favorite Fruit");
    radioGroup2.add(radio3);
    radioGroup2.add(radio4);
    simple.add(radioGroup2, formData);

    TextArea description = new TextArea();
    description.setPreventScrollbars(true);
    description.setFieldLabel("Description");
    simple.add(description, formData);

    Button b = new Button("Submit");
    simple.addButton(b);
    simple.addButton(new Button("Cancel"));

    simple.setButtonAlign(HorizontalAlignment.CENTER);

    FormButtonBinding binding = new FormButtonBinding(simple);
    binding.addButton(b);

    SpinnerField spinnerField = new SpinnerField();
    spinnerField.setIncrement(.1d);
    spinnerField.getPropertyEditor().setType(Double.class);
    spinnerField.getPropertyEditor().setFormat(NumberFormat.getFormat("00.0"));
    spinnerField.setFieldLabel("Duration&nbsp;(s)");
    spinnerField.setMinValue(-10d);
    spinnerField.setMaxValue(10d);
    simple.add(spinnerField, formData);

    vp.add(simple);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

    vp.add(simple);
  }

  private void createForm2() {
    FormPanel form2 = new FormPanel();
    form2.setFrame(true);
    form2.setHeading("Simple Form with FieldSets");
    form2.setWidth(350);
    form2.setLayout(new FlowLayout());

    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeading("User Information");
    fieldSet.setCheckboxToggle(true);

    FormLayout layout = new FormLayout();
    layout.setLabelWidth(75);
    fieldSet.setLayout(layout);

    TextField<String> firstName = new TextField<String>();
    firstName.setFieldLabel("First Name");
    firstName.setAllowBlank(false);
    fieldSet.add(firstName, formData);

    TextField<String> lastName = new TextField<String>();
    lastName.setFieldLabel("Last Name");
    fieldSet.add(lastName, formData);

    TextField<String> company = new TextField<String>();
    company.setFieldLabel("Company");
    fieldSet.add(company, formData);

    TextField<String> email = new TextField<String>();
    email.setFieldLabel("Email");
    fieldSet.add(email, formData);

    form2.add(fieldSet);

    fieldSet = new FieldSet();
    fieldSet.setHeading("Phone Numbers");
    fieldSet.setCollapsible(true);

    layout = new FormLayout();
    layout.setLabelWidth(75);
    fieldSet.setLayout(layout);

    TextField<String> field = new TextField<String>();
    field.setFieldLabel("Home");
    fieldSet.add(field, formData);

    field = new TextField<String>();
    field.setFieldLabel("Business");
    fieldSet.add(field, formData);

    field = new TextField<String>();
    field.setFieldLabel("Mobile");
    fieldSet.add(field, formData);

    field = new TextField<String>();
    field.setFieldLabel("Fax");
    fieldSet.add(field, formData);

    form2.add(fieldSet);
    form2.setButtonAlign(HorizontalAlignment.CENTER);
    form2.addButton(new Button("Save"));
    form2.addButton(new Button("Cancel"));

    vp.add(form2);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

      public void modelChanged(ChangeEvent event) {
        template.overwrite(html.getElement(), Util.getJsObject(stock));
      }
    });

    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);
    panel.setWidth(350);

    TextField<String> name = new TextField<String>();
    name.setName("nameField");
    name.setFieldLabel("Name");
    panel.add(name);

    TextField<String> symbol = new TextField<String>();
    symbol.setName("symbol");
    symbol.setFieldLabel("Symbol");
    panel.add(symbol);

    NumberField open = new NumberField();
    open.setName("last");
    open.setFieldLabel("Last");
    panel.add(open);

    NumberField change = new NumberField();
    change.setName("change");
    change.setFieldLabel("Change");
    change.setFormat(NumberFormat.getDecimalFormat());
    panel.add(change);

    DateField last = new DateField();
    last.setName("date");
    last.setFieldLabel("Updated");
    panel.add(last);
   
    SimpleComboBox<String> scb = new SimpleComboBox<String>();
    for(Stock s: TestData.getStocks()) {
      scb.add(s.getName());
    }
    scb.setFieldLabel("Name");
    scb.setForceSelection(true);
    scb.setTypeAhead(true);
    scb.setName("company");
    scb.setTriggerAction(TriggerAction.ALL);
    panel.add(scb);
   
    hp.add(panel);

    FormBinding binding = new FormBinding(panel);
    // manually add bindings
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

        }
      }
    });
    cp.add(grid, new RowData(.6, 1));

    FormPanel panel = createForm();
    formBindings = new FormBinding(panel, true);

    cp.add(panel, new RowData(.4, 1));

    add(cp);
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

    add(cp);
  }

  private FormPanel createForm() {
    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);

    TextField<String> name = new TextField<String>();
    name.setName("name");
    name.setFieldLabel("Name");
    panel.add(name);

    TextField<String> symbol = new TextField<String>();
    symbol.setName("symbol");
    symbol.setFieldLabel("Symbol");
    panel.add(symbol);

    NumberField open = new NumberField();
    open.setName("last");
    open.setFieldLabel("Last");
    panel.add(open);

    NumberField change = new NumberField();
    change.setName("change");
    change.setFieldLabel("Change");
    change.setFormat(NumberFormat.getDecimalFormat());
    panel.add(change);

    DateField last = new DateField();
    last.setName("date");
    last.setFieldLabel("Updated");
    panel.add(last);

    return panel;
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

            }
          }
        });
    cp.add(grid, new RowData(.6, 1));

    FormPanel panel = createForm();
    formBindings = new FormBinding(panel, true);
    formBindings.setStore((Store) grid.getStore());

    cp.add(panel, new RowData(.4, 1));
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

    }));
    add(cp);
  }

  private FormPanel createForm() {
    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);

    TextField<String> name = new TextField<String>();
    name.setName("name");
    name.setFieldLabel("Name");
    panel.add(name);

    TextField<String> symbol = new TextField<String>();
    symbol.setName("symbol");
    symbol.setFieldLabel("Symbol");
    panel.add(symbol);

    NumberField open = new NumberField();
    open.setName("last");
    open.setFieldLabel("Last");
    panel.add(open);

    NumberField change = new NumberField();
    change.setName("change");
    change.setFieldLabel("Change");
    change.setFormat(NumberFormat.getDecimalFormat());
    panel.add(change);

    DateField last = new DateField();
    last.setName("date");
    last.setFieldLabel("Updated");
    panel.add(last);

    return panel;
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.form.FormPanel

    add(vp);
  }

  private void createTabForm() {
    FormData formData = new FormData("100%");
    FormPanel panel = new FormPanel();
    panel.setBodyStyleName("example-bg");
    panel.setPadding(0);
    panel.setFrame(false);
    panel.setHeaderVisible(false);
    panel.setBodyBorder(false);
    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.setLayout(new FitLayout());

    final TabPanel tabs = new TabPanel();

    TabItem personal = new TabItem();
    personal.setStyleAttribute("padding", "10px");
    personal.setText("Personal Details");
    personal.setLayout(new FormLayout());

    TextField<String> name = new TextField<String>();
    name.setFieldLabel("First Name");
    name.setValue("Darrell");
    personal.add(name, formData);

    TextField<String> last = new TextField<String>();
    last.setFieldLabel("Last Name");
    last.setValue("Meyer");
    personal.add(last, formData);

    TextField<String> company = new TextField<String>();
    company.setFieldLabel("Company");
    personal.add(company, formData);

    TextField<String> email = new TextField<String>();
    email.setFieldLabel("Email");
    personal.add(email, formData);

    tabs.add(personal);

    TabItem numbers = new TabItem();
    numbers.setStyleAttribute("padding", "10px");
    numbers.setText("Phone Numbers");
    numbers.setLayout(new FormLayout());

    TextField<String> home = new TextField<String>();
    home.setFieldLabel("Home");
    home.setValue("800-555-1212");
    numbers.add(home, formData);

    TextField<String> business = new TextField<String>();
    business.setFieldLabel("Business");
    numbers.add(business, formData);

    TextField<String> mobile = new TextField<String>();
    mobile.setFieldLabel("Mobile");
    numbers.add(mobile, formData);

    TextField<String> fax = new TextField<String>();
    fax.setFieldLabel("Fax");
    numbers.add(fax, formData);

    tabs.add(numbers);

    panel.add(tabs);
    panel.addButton(new Button("Cancel"));
    panel.addButton(new Button("Submit"));

    panel.setSize(340, 200);

    if (GXT.isFocusManagerEnabled()) {
      name.getFocusSupport().setPreviousId(panel.getButtonBar().getId());
      home.getFocusSupport().setPreviousId(panel.getButtonBar().getId());
     
      panel.getButtonBar().getFocusSupport().addListener(FocusManager.TabNext, new Listener<BaseEvent>() {
        public void handleEvent(BaseEvent be) {
          tabs.getItem(tabs.getSelectedItem() == tabs.getItem(0) ? 0 : 1).getItem(0).focus();
          be.setCancelled(true);
        }
      });
      panel.getButtonBar().getFocusSupport().addListener(FocusManager.TabPrevious, new Listener<BaseEvent>() {
        public void handleEvent(BaseEvent be) {
          TabItem item = tabs.getItem(tabs.getSelectedItem() == tabs.getItem(0) ? 0 : 1);
          item.getItem(item.getItemCount() - 1).focus();
          be.setCancelled(true);
        }
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.