Example usage for org.apache.wicket.markup.html.form TextField TextField

List of usage examples for org.apache.wicket.markup.html.form TextField TextField

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form TextField TextField.

Prototype

public TextField(final String id, final IModel<T> model) 

Source Link

Usage

From source file:abid.password.wicket.fields.CaesarCipherPasswordField.java

License:Apache License

public CaesarCipherPasswordField(String id, IModel<String> model) {
    super(id, model);
    passwordField = new TextField<String>("password", new Model<String>(""));
    passwordField.setRequired(true);//w ww  .  j a  v a  2s .  c om
    add(passwordField);

    List<TimeParameter> choices = Arrays.asList(TimeParameter.HOUR, TimeParameter.MONTH,
            TimeParameter.DAY_OF_MONTH);
    timeChoice = new TimeParameterChoice("parameter", new Model<TimeParameter>(), choices);
    timeChoice.setRequired(true);
    add(timeChoice);
}

From source file:abid.password.wicket.fields.ExtendedPasswordField.java

License:Apache License

public ExtendedPasswordField(String id, IModel<String> model) {
    super(id, model);
    passwordField = new TextField<String>("password", new Model<String>(""));
    passwordField.setRequired(true);/*from ww w .  ja v a2 s  .c o m*/
    add(passwordField);

    timeChoice = new TimeParameterChoice("parameter", new Model<TimeParameter>(), null);
    timeChoice.setRequired(true);
    add(timeChoice);
}

From source file:abid.password.wicket.fields.ExtendedTimeLockPasswordField.java

License:Apache License

public ExtendedTimeLockPasswordField(String id, IModel<String> model) {
    super(id, model);
    passwordField = new TextField<String>("password", new Model<String>(""));
    passwordField.setRequired(true);/*from  w w  w.  ja va2  s.  co m*/
    add(passwordField);

    extendedParameter = new TimeParameterChoice("extendedParameter", new Model<TimeParameter>(), null);
    extendedParameter.setRequired(true);
    add(extendedParameter);

    List<TimeParameter> timeChoices = Arrays.asList(TimeParameter.HOUR, TimeParameter.MONTH,
            TimeParameter.DAY_OF_MONTH);
    timeChoice = new TimeParameterChoice("timeChoice", new Model<TimeParameter>(), timeChoices);
    timeChoice.setRequired(true);
    add(timeChoice);

    startField = new TextField<Integer>("startField", new Model<Integer>(0));
    startField.setRequired(true);
    startField.setType(Integer.class);
    add(startField);

    endField = new TextField<Integer>("endField", new Model<Integer>(0));
    endField.setRequired(true);
    endField.setType(Integer.class);
    add(endField);
}

From source file:abid.password.wicket.fields.TimeLockPasswordField.java

License:Apache License

public TimeLockPasswordField(String id, IModel<String> model) {
    super(id, model);
    passwordField = new TextField<String>("password", new Model<String>(""));
    passwordField.setRequired(true);//  ww w .j  a  v a 2  s.c  o  m
    add(passwordField);

    List<TimeParameter> choices = Arrays.asList(TimeParameter.HOUR, TimeParameter.MONTH,
            TimeParameter.DAY_OF_MONTH);
    timeChoice = new TimeParameterChoice("parameter", new Model<TimeParameter>(), choices);
    timeChoice.setRequired(true);
    add(timeChoice);

    startField = new TextField<Integer>("startField", new Model<Integer>(0));
    startField.setType(Integer.class);
    startField.setRequired(true);
    add(startField);

    endField = new TextField<Integer>("endField", new Model<Integer>(0));
    endField.setType(Integer.class);
    endField.setRequired(true);
    add(endField);
}

From source file:almira.sample.web.SearchForm.java

License:Apache License

/**
 * Instantiates a new search form./*  www .  j a v a  2 s  .c o  m*/
 *
 * @param id the id
 */
public SearchForm(String id) {
    super(id);

    add(new TextField<String>("searchString", new PropertyModel<String>(this, "searchString")));
}

From source file:ar.edu.udc.cirtock.view.intranet.html.InsumoPage.java

License:Apache License

@SuppressWarnings("unchecked")
public InsumoPage() {
    cerrar = new Link<IndexPage>("cerrar") {
        /**/*from w  w w .j av a2 s  . c  o  m*/
         *
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(IndexPage.class);
        }
    };
    producto = new Link<ProductoPage>("producto") {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(ProductoPage.class);
        }
    };

    herramienta = new Link<HerramientaPage>("herramienta") {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(HerramientaPage.class);
        }
    };
    formBusqueda = new Form("form_busqueda");

    busquedaInput = new TextField<String>("busquedaInput", new Model<String>());
    formBusqueda.add(busquedaInput);

    formBusqueda.add(new Button("busquedaBoton") {

        @Override
        public void onSubmit() {
            String busqueda = busquedaInput.getModelObject();
            Connection conn;
            try {
                conn = CirtockConnection.getConection("cirtock", "cirtock", "cirtock");
                insumos = Consultas.obtenerInsumos(conn, null, busqueda, null);
                lista.setList(insumos);
            } catch (CirtockException e) {
                System.out.println(e.getMessage());
            }
        }
    });

    add(formBusqueda);

    add(cerrar);
    add(producto);
    add(herramienta);

    add(lista);

    add(new Link<FormularioInsumo>("nuevo") {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(FormularioInsumo.class);
        }
    });

}

From source file:at.ac.tuwien.ifs.tita.ui.administration.project.IssueTrackerProjectForm.java

License:Apache License

/**
 * displays the Table of issueTrackerProjects.
 *///  w  w  w . ja va  2 s .  c  o  m
private void addComponents() {
    addOrReplace(new TextField<String>("tfProjectName",
            new PropertyModel<String>(issueTrackerProject, "projectName")));
    addOrReplace(new DropDownChoice<IssueTracker>("dropDownIssueTracker",
            new PropertyModel<IssueTracker>(issueTrackerProject, "issueTracker"), issueTracker));
    // addOrReplace(new CheckBox("checkBoxDeletedIssueTrackerProject", new
    // PropertyModel<Boolean>(issueTrackerProject,
    // "deleted")));
}

From source file:at.ac.tuwien.ifs.tita.ui.administration.project.ProjectForm.java

License:Apache License

/**
 * add all controls.//from  w w  w . j a  v a2s.  co  m
 */
private void addComponents() {

    log.info("Adding Controls to the Form");

    addOrReplace(new TextField<String>("tfDescription", new PropertyModel<String>(project, "description")));
    addOrReplace(new TextField<String>("tfName", new PropertyModel<String>(project, "name")));
    addOrReplace(new CheckBox("checkBoxDeleted", new PropertyModel<Boolean>(project, "deleted")));
    addOrReplace(new DropDownChoice<ProjectStatus>("dropDownProjectStatus",
            new PropertyModel<ProjectStatus>(project, "projectStatus"), projectStati));

    issueTrackerProjectTM = new TableModelIssueTrackerProject(this.issueTrackerProjects);
    issueTrackerProjectTable = new Table("issueTrackerProjectTable", issueTrackerProjectTM);

    DeleteRenderer deleteRenderer = new DeleteRenderer();
    issueTrackerProjectTable.setDefaultRenderer(ButtonDelete.class, deleteRenderer);
    issueTrackerProjectTable.setDefaultEditor(ButtonDelete.class, deleteRenderer);

    addOrReplace(issueTrackerProjectTable);

    // other components will not be displayed, they are not part of the
    // ProjectAdministration
}

From source file:at.ac.tuwien.ifs.tita.ui.administration.user.IssueTrackerLoginForm.java

License:Apache License

/**
 * Method for Adding the Fields to the Form.
 *//* w  w  w  .jav  a2  s .c  o  m*/
private void addComponents() {
    addOrReplace(new TextField<String>("tfIssueTrackerUserName",
            new PropertyModel<String>(issueTrackerLogin, "userName")));
    addOrReplace(new PasswordTextField("ptfIssueTrackerPassword",
            new PropertyModel<String>(issueTrackerLogin, "password")));

    addOrReplace(new DropDownChoice<IssueTracker>("dropDownIssueTracker",
            new PropertyModel<IssueTracker>(issueTrackerLogin, "issueTracker"), availableIssueTracker));
}

From source file:at.ac.tuwien.ifs.tita.ui.administration.user.UserForm.java

License:Apache License

/**
 * Method for Adding the Fields to the Form.
 *///from  w  ww.  ja v  a  2 s . co m
private void addComponents() {

    addOrReplace(new TextField<String>("tfUserName", new PropertyModel<String>(user, "userName")));
    addOrReplace(new TextField<String>("tfFirstName", new PropertyModel<String>(user, "firstName")));
    addOrReplace(new TextField<String>("tfLastName", new PropertyModel<String>(user, "lastName")));
    addOrReplace(new TextField<String>("tfEmail", new PropertyModel<String>(user, "email")));

    ptfPassword = new PasswordTextField("ptfPassword", new PropertyModel<String>(user, "password"));
    ptfPassword.setRequired(false);
    addOrReplace(ptfPassword);

    ptfPasswordRepetition = new PasswordTextField("ptfPasswordRepetition",
            new PropertyModel<String>(this, "passwordRepetition"));
    ptfPasswordRepetition.setRequired(false);
    addOrReplace(ptfPasswordRepetition);

    addOrReplace(new CheckBox("checkBoxDeleted", new PropertyModel<Boolean>(user, "deleted")));

    dropDownrole = new DropDownChoice<Role>("dropDownRole", new PropertyModel<Role>(user, "role"), roles);
    if (user.getRole() != null) {
        dropDownrole.setConvertedInput(user.getRole());
    }
    dropDownrole.setRequired(false);
    addOrReplace(dropDownrole);

    userProjectTM = new TableModelUserProject(titaProjects);
    userProjectTM.reload();
    userProjectTable = new Table(C_USER_PROJECT_TABLE_NAME, userProjectTM);

    issueTrackerLoginTM = new TableModelIssueTrackerLoginWithoutButtons(titaIssueTracker);
    issueTrackerLoginTM.reload();
    issueTrackerLoginTable = new Table(C_ISSUE_TRACKER_TABLE_NAME, issueTrackerLoginTM);

    addOrReplace(issueTrackerLoginTable);
    addOrReplace(userProjectTable);
}