Package org.apache.openmeetings.db.dao.label

Examples of org.apache.openmeetings.db.dao.label.FieldLanguageDao


public class LangForm extends Form<Void> {
  private static final long serialVersionUID = 2837702941211636609L;
  private DropDownChoice<FieldLanguage> languages;

  public void updateLanguages(AjaxRequestTarget target) {
    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
    languages.setChoices(langDao.getLanguages());
    // add(languages);
    target.add(languages);
  }
View Full Code Here


   */
  public LangForm(String id, final WebMarkupContainer listContainer, final LangPanel langPanel) {
    super(id);
    setOutputMarkupId(true);

    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
   
    languages = new DropDownChoice<FieldLanguage>("language"
        , new PropertyModel<FieldLanguage>(langPanel, "language")
        , langDao.getLanguages()
        , new ChoiceRenderer<FieldLanguage>("name", "language_id"));
       
    languages.add(new AjaxFormComponentUpdatingBehavior("onchange") {
      private static final long serialVersionUID = -2055912815073387536L;

      @Override
      protected void onUpdate(AjaxRequestTarget target) {
        target.add(listContainer);
      }
    });
    add(languages);

    add(new WebMarkupContainer("deleteLangBtn").add(new AjaxEventBehavior("onclick"){
      private static final long serialVersionUID = -1650946343073068686L;

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
        super.updateAjaxAttributes(attributes);
        attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
      }
     
      @Override
      protected void onEvent(AjaxRequestTarget target) {
        langPanel.language.setDeleted(true);
        FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
        try {
          langDao.updateLanguage(langPanel.language);
        } catch (Exception e) {
          // TODO add feedback message
          e.printStackTrace();
        }
        languages.setChoices(langDao.getLanguages());
        target.add(languages);
        // FIXME need to force update list container
        target.add(listContainer);
      }
    }));
View Full Code Here

  @SuppressWarnings("unchecked")
  public LangPanel(String id) {
    super(id);
    // Create feedback panels
    add(importFeedback.setOutputMarkupId(true));
    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
    language = langDao.getFieldLanguageById(1L);

    Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
    flv.setLanguage_id(language.getLanguage_id());
    final LabelsForm form = new LabelsForm("form", this, flv);
    form.showNewRecord();
View Full Code Here

    add(passwordField = new PasswordTextField("password", new Model<String>()));
    ConfigurationDao cfgDao = getBean(ConfigurationDao.class);
    passwordField.setRequired(false).add(minimumLength(getMinPasswdLength(cfgDao)));

    SalutationDao salutDao = getBean(SalutationDao.class);
    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
    salutation = salutDao.get(getModelObject().getSalutations_id(), getLanguage());
    lang = langDao.getFieldLanguageById(getModelObject().getLanguage_id());
    add(new DropDownChoice<Salutation>("salutation"
        , new PropertyModel<Salutation>(this, "salutation")
        , salutDao.getUserSalutations(getLanguage())
        , new ChoiceRenderer<Salutation>("label.value", "salutations_id"))
      .add(new AjaxFormComponentUpdatingBehavior("onchange") {
        private static final long serialVersionUID = -6748844721645465468L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
          GeneralUserForm.this.getModelObject().setSalutations_id(salutation.getSalutations_id());
        }
      }));
    add(new TextField<String>("firstname"));
    add(new TextField<String>("lastname"));
   
    add(new DropDownChoice<String>("timeZoneId", AVAILABLE_TIMEZONES));

    add(new DropDownChoice<FieldLanguage>("language"
        , new PropertyModel<FieldLanguage>(this, "lang")
        , langDao.getLanguages()
        , new ChoiceRenderer<FieldLanguage>("name", "language_id"))
      .add(new AjaxFormComponentUpdatingBehavior("onchange") {
        private static final long serialVersionUID = 2072021284702632856L;

        @Override
View Full Code Here

    add(new AjaxButton("add", Model.of(WebSession.getString(366L)), this) {
      private static final long serialVersionUID = -552597041751688740L;

      @Override
      public void onSubmit(AjaxRequestTarget target, Form<?> form) {
        FieldLanguageDao langDao = Application.getBean(FieldLanguageDao.class);
       
        FieldLanguage fl = new FieldLanguage();
        fl.setLanguage_id(langDao.getNextAvailableId());
        fl.setStarttime(new Date());
        fl.setDeleted(false);
        fl.setName(newLanguageName);
        fl.setRtl(false); //FIXME
        fl.setCode(newLanguageISO);
       
        try {
          langDao.updateLanguage(fl);
        } catch (Exception e) {
          // TODO add feedback message
          e.printStackTrace();
        }
View Full Code Here

    ConfigurationDao cfgDao = getBean(ConfigurationDao.class);
    passwordField.setRequired(false).add(minimumLength(getMinPasswdLength(cfgDao)));

    updateModelObject(getModelObject());
    SalutationDao salutDao = getBean(SalutationDao.class);
    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
    add(new DropDownChoice<Salutation>("salutation"
        , new PropertyModel<Salutation>(this, "salutation")
        , salutDao.getUserSalutations(getLanguage())
        , new ChoiceRenderer<Salutation>("label.value", "salutations_id"))
      .add(new AjaxFormComponentUpdatingBehavior("onchange") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
          GeneralUserForm.this.getModelObject().setSalutations_id(salutation.getSalutations_id());
        }
      }));
    add(new TextField<String>("firstname"));
    add(new TextField<String>("lastname"));
   
    add(new DropDownChoice<String>("timeZoneId", AVAILABLE_TIMEZONES));

    add(new DropDownChoice<FieldLanguage>("language"
        , new PropertyModel<FieldLanguage>(this, "lang")
        , langDao.getLanguages()
        , new ChoiceRenderer<FieldLanguage>("name", "language_id"))
      .add(new AjaxFormComponentUpdatingBehavior("onchange") {
        private static final long serialVersionUID = 1L;

        @Override
View Full Code Here

  public LangPanel(String id) {
    super(id);
    // Create feedback panels
    add(importFeedback.setOutputMarkupId(true));
    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
    language = langDao.getFieldLanguageById(1L);

    Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
    flv.setLanguage_id(language.getLanguage_id());
    final LabelsForm form = new LabelsForm("form", this, flv);
    form.showNewRecord();
View Full Code Here

  @SuppressWarnings("unchecked")
  public LangPanel(String id) {
    super(id);
    // Create feedback panels
    add(importFeedback.setOutputMarkupId(true));
    FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
    language = langDao.getFieldLanguageById(1L);

    Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
    flv.setLanguage_id(language.getLanguage_id());
    final LabelsForm form = new LabelsForm("form", this, flv);
    form.showNewRecord();
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.dao.label.FieldLanguageDao

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.