Package org.apache.wicket.extensions.ajax.markup.html.autocomplete

Examples of org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField


                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator<String> getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here


                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator<String> getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(AjaxRequestTarget art) {
View Full Code Here

                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator<String> getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator<String> getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator<String> getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(AjaxRequestTarget art) {
View Full Code Here

  public AutoCompletePage()
  {
    Form form = new Form("form");
    add(form);

    final AutoCompleteTextField field = new AutoCompleteTextField("ac", new Model(""))
    {
      protected Iterator getChoices(String input)
      {
        if (Strings.isEmpty(input))
        {
          return Collections.EMPTY_LIST.iterator();
        }

        List choices = new ArrayList(10);

        Locale[] locales = Locale.getAvailableLocales();

        for (int i = 0; i < locales.length; i++)
        {
          final Locale locale = locales[i];
          final String country = locale.getDisplayCountry();

          if (country.toUpperCase().startsWith(input.toUpperCase()))
          {
            choices.add(country);
            if (choices.size() == 10)
            {
              break;
            }
          }
        }

        return choices.iterator();
      }
    };
    form.add(field);

    final Label label = new Label("selectedValue",field.getModel());
    label.setOutputMarkupId(true);
    form.add(label);

    field.add(new AjaxFormSubmitBehavior(form, "onchange"){
      protected void onSubmit(AjaxRequestTarget target)
      {
        target.addComponent(label);
      }
    });
View Full Code Here

  public AutoCompletePage()
  {
    Form form = new Form("form");
    add(form);

    final AutoCompleteTextField field = new AutoCompleteTextField("ac", new Model(""))
    {
      protected Iterator getChoices(String input)
      {
        if (Strings.isEmpty(input))
        {
          return Collections.EMPTY_LIST.iterator();
        }

        List choices = new ArrayList(10);

        Locale[] locales = Locale.getAvailableLocales();

        for (int i = 0; i < locales.length; i++)
        {
          final Locale locale = locales[i];
          final String country = locale.getDisplayCountry();

          if (country.toUpperCase().startsWith(input.toUpperCase()))
          {
            choices.add(country);
            if (choices.size() == 10)
            {
              break;
            }
          }
        }

        return choices.iterator();
      }
    };
    form.add(field);

    final Label label = new Label("selectedValue", field.getModel());
    label.setOutputMarkupId(true);
    form.add(label);

    field.add(new AjaxFormSubmitBehavior(form, "onchange")
    {
      protected void onSubmit(AjaxRequestTarget target)
      {
        target.addComponent(label);
      }
View Full Code Here

                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(AjaxRequestTarget art) {
View Full Code Here

  public AutoCompletePage()
  {
    Form form = new Form("form");
    add(form);

    final AutoCompleteTextField field = new AutoCompleteTextField("ac", new Model(""))
    {
      protected Iterator getChoices(String input)
      {
        if (Strings.isEmpty(input))
        {
          return Collections.EMPTY_LIST.iterator();
        }

        List choices = new ArrayList(10);

        Locale[] locales = Locale.getAvailableLocales();

        for (int i = 0; i < locales.length; i++)
        {
          final Locale locale = locales[i];
          final String country = locale.getDisplayCountry();

          if (country.toUpperCase().startsWith(input.toUpperCase()))
          {
            choices.add(country);
            if (choices.size() == 10)
            {
              break;
            }
          }
        }

        return choices.iterator();
      }
    };
    form.add(field);

    final Label label = new Label("selectedValue",field.getModel());
    label.setOutputMarkupId(true);
    form.add(label);

    field.add(new AjaxFormSubmitBehavior(form, "onchange"){
      protected void onSubmit(AjaxRequestTarget target)
      {
        target.addComponent(label);
      }
View Full Code Here

TOP

Related Classes of org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField

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.