Exemplo n.º 1
0
  @Override
  protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
    Fieldlanguagesvalues flv = getModelObject();
    Fieldvalues fv = flv.getFieldvalues();
    Application.getBean(FieldValueDao.class).update(fv, WebSession.getUserId());

    flv.setFieldvalues(fv);
    Application.getBean(FieldLanguagesValuesDao.class).update(flv, WebSession.getUserId());
    hideNewRecord();
    target.add(panel.listContainer);
    target.appendJavaScript("labelsInit();");
  }
Exemplo n.º 2
0
 public List<Fieldvalues> get(Long language_id, int start, int count) {
   TypedQuery<Fieldvalues> q = em.createNamedQuery("getFieldByLanguage", Fieldvalues.class);
   // q.setParameter("lang", language_id); //FIXME commented for now
   q.setFirstResult(start);
   q.setMaxResults(count);
   List<Fieldvalues> result = q.getResultList();
   for (Fieldvalues fv : result) {
     // FIXME ineffective !!!!!!!!!!!!!!!!!!!!
     Fieldlanguagesvalues flv = flvDaoImpl.get(fv.getFieldvalues_id(), language_id);
     if (flv == null) {
       flv = new Fieldlanguagesvalues();
       flv.setLanguage_id(language_id);
       flv.setFieldvalues(fv);
     }
     fv.setFieldlanguagesvalue(flv);
   }
   return result;
 }