Package org.apache.openmeetings.data.basic

Examples of org.apache.openmeetings.data.basic.FieldLanguageDao


  private static final long serialVersionUID = 2837702941211636609L;
  private DropDownChoice<FieldLanguage> languages;

  public void updateLanguages(AjaxRequestTarget target) {
    FieldLanguageDao langDao = Application
        .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 = Application
        .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 = Application.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);
    FieldLanguageDao langDao = Application
        .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(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

TOP

Related Classes of org.apache.openmeetings.data.basic.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.