private void showInvalidValue(InvalidValue invalidValue,
            TaskQualityForm taskQualityForm) {
        if (assignedTaskQualityForms != null) {
            // Find which row contains TaskQualityForm inside grid
            Row row = findRowOfTaskQualityForm(assignedTaskQualityForms
                    .getRows().getChildren(), taskQualityForm);

            if (row != null && invalidValue.getInvalidValue() instanceof String) {
                String itemName = (String) invalidValue.getInvalidValue();
                String propertyName = invalidValue.getPropertyPath();
                Row rowItem = findRowOfTaskQualityFormItem(row, itemName);

                if (rowItem != null) {
                    if (TaskQualityFormItem.propertyDate.equals(propertyName)) {
                        openDetails(rowItem);
                        Datebox datebox = getDatebox(rowItem);
                        throw new WrongValueException(datebox,
                                _(invalidValue.getMessage()));
                    }
                    if (TaskQualityFormItem.propertyPassed.equals(propertyName)) {
                        openDetails(rowItem);
                        Checkbox checkbox = getCheckbox(rowItem);
                        throw new WrongValueException(checkbox,
                                _(invalidValue.getMessage()));
                    }
                }
            }
        }
    }
Example #2
0
 public List getItems(Component comp) {
   if (comp instanceof Grid) {
     final Grid grid = (Grid) comp;
     return grid.getRows().getChildren();
   } else {
     throw new UiException("Unsupported type for RowCollectionItem: " + comp);
   }
 }
 private Row findRowOfTaskQualityFormItem(Row rowTaskQualityForm,
         String itemName) {
     Grid gridItems = (Grid) rowTaskQualityForm.getFirstChild()
             .getFirstChild();
     List<Row> rows = (List<Row>) gridItems.getRows().getChildren();
     for (Row row : rows) {
         TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();
         if ((item != null) && (itemName.equals(item.getName()))) {
             return row;
         }
     }
     return null;
 }
Example #4
0
  /**
   * @Class ActionStandar
   *
   * @name limpiarHistoricoMensajes
   * @return void
   * @desc Este m�todo se encarga de limpiar la grilla que contiene el historico de mensajes el
   *     parametro es utilizado en el metodo setMensajehistorico para que limpie la grilla antes de
   *     escribir en ella.
   */
  private void limpiarHistoricoMensajes(String idGridHistorico, String idGroupHistorico) {

    if (idGridHistorico != null && idGroupHistorico != null) {
      if (this.hasFellow(idGridHistorico)) {
        Grid grilla = (Grid) this.getFellow(idGridHistorico);
        // ocultamos el groupbox que contiene
        // la grilla
        Groupbox groupinformacion = (Groupbox) this.getFellow(idGroupHistorico);
        groupinformacion.setVisible(false);

        grilla.getRows().getChildren().clear();
      }
    }
  }