Package org.compiere.model

Examples of org.compiere.model.GridField


   * @return error message or ""
   * @see org.compiere.model.Callout
   */
  private String processButtonCallout (VButton button)
  {
    GridField field = m_curTab.getField(button.getColumnName());
    return m_curTab.processCallout(field);
  //  processButtonCallout
View Full Code Here


      StringBuffer displayValue = new StringBuffer();
      if("".equals(m_curTab.getKeyColumnName())){
        ArrayList<String> parentColumnNames = m_curTab.getParentColumnNames();
        for (Iterator<String> iter = parentColumnNames.iterator(); iter.hasNext();) {
          String columnName = iter.next();
          GridField field = m_curTab.getField(columnName);
          if(field.isLookup()){
            Lookup lookup = field.getLookup();
            if (lookup != null){
              displayValue = displayValue.append(lookup.getDisplay(m_curTab.getValue(i,columnName))).append(" | ");
            } else {
              displayValue = displayValue.append(m_curTab.getValue(i,columnName)).append(" | ");
            }
View Full Code Here

    //  Find display
    String infoName = null;
    String infoDisplay = null;
    for (int i = 0; i < m_curTab.getFieldCount(); i++)
    {
      GridField field = m_curTab.getField(i);
      if (field.isKey())
        infoName = field.getHeader();
      if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") )
        && field.getValue() != null)
        infoDisplay = field.getValue().toString();
      if (infoName != null && infoDisplay != null)
        break;
    }
    if (queryColumn.length() != 0)
    {
View Full Code Here

    //  Find display
    String infoName = null;
    String infoDisplay = null;
    for (int i = 0; i < m_curTab.getFieldCount(); i++)
    {
      GridField field = m_curTab.getField(i);
      if (field.isKey())
        infoName = field.getHeader();
      if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") )
        && field.getValue() != null)
        infoDisplay = field.getValue().toString();
      if (infoName != null && infoDisplay != null)
        break;
    }
    String description = infoName + ": " + infoDisplay;
    //
View Full Code Here

    log.config("");

    //  Get Info from target Tab
    for (int i = 0; i < m_findFields.length; i++)
    {
      GridField mField = m_findFields[i];
      String columnName = mField.getColumnName();
     
      // Make Yes-No searchable as list
      if (mField.getVO().displayType == DisplayType.YesNo)
      {
        GridFieldVO vo = mField.getVO();
        GridFieldVO ynvo = vo.clone(vo.ctx, vo.WindowNo, vo.TabNo, vo.AD_Window_ID, vo.AD_Tab_ID, vo.tabReadOnly);
        ynvo.IsDisplayed = true;
        ynvo.displayType = DisplayType.List;
        ynvo.AD_Reference_Value_ID = AD_REFERENCE_ID_YESNO;

        ynvo.lookupInfo = MLookupFactory.getLookupInfo (ynvo.ctx, ynvo.WindowNo, ynvo.AD_Column_ID, ynvo.displayType,
            Env.getLanguage(ynvo.ctx), ynvo.ColumnName, ynvo.AD_Reference_Value_ID,
            ynvo.IsParent, ynvo.ValidationCode);
        ynvo.lookupInfo.InfoFactoryClass = ynvo.InfoFactoryClass;
       
        GridField ynfield = new GridField(ynvo);

        // replace the original field by the YN List field
        m_findFields[i] = ynfield;
        mField = ynfield;
      }
View Full Code Here

   
    //  0 = Columns
    ArrayList<ValueNamePair> items = new ArrayList<ValueNamePair>();
    for (int c = 0; c < m_findFields.length; c++)
    {
      GridField field = m_findFields[c];
      String columnName = field.getColumnName();
      String header = field.getHeader();
      if (header == null || header.length() == 0)
      {
        header = Msg.translate(Env.getCtx(), columnName);
        if (header == null || header.length() == 0)
          continue;
      }
      if (field.isKey())
        header += (" (ID)");
      ValueNamePair pp = new ValueNamePair(columnName, header);
    //  System.out.println(pp + " = " + field);
      items.add(pp);
    }
View Full Code Here

            }
          }
        }
        else
        {
          GridField field = getTargetMField(columnName);
          Object value = parseString(field, fields[j]);
          model.setValueAt(value, i, j);
        }
      }
    }
View Full Code Here

        String ColumnName = ((Component)ved).getName ();
        log.fine(ColumnName + "=" + value);
       
        // globalqss - Carlos Ruiz - 20060711
        // fix a bug with virtualColumn + isSelectionColumn not yielding results
        GridField field = getTargetMField(ColumnName);
        boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID());
        String ColumnSQL = field.getColumnSQL(false);
        if (value.toString().indexOf('%') != -1)
          m_query.addRestriction(ColumnSQL, MQuery.LIKE, value, ColumnName, ved.getDisplay());
        else if (isProductCategoryField && value instanceof Integer)
          m_query.addRestriction(getSubCategoryWhereClause(((Integer) value).intValue()));
        else
View Full Code Here

        continue;
      String ColumnName = column instanceof ValueNamePair ?
          ((ValueNamePair)column).getValue() : column.toString();
      String infoName = column.toString();
      //
      GridField field = getTargetMField(ColumnName);
      if (field == null)
        continue;
      boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID());
      String ColumnSQL = field.getColumnSQL(false);
      //  Op
      Object op = advancedTable.getValueAt(row, INDEX_OPERATOR);
      if (op == null)
        continue;
      String Operator = ((ValueNamePair)op).getValue();
     
      //  Value  ******
      Object value = advancedTable.getValueAt(row, INDEX_VALUE);
      if (value == null)
        continue;
      Object parsedValue = parseValue(field, value);
      if (parsedValue == null)
        continue;
      String infoDisplay = value.toString();
      if (field.isLookup())
        infoDisplay = field.getLookup().getDisplay(value);
      else if (field.getDisplayType() == DisplayType.YesNo)
        infoDisplay = Msg.getMsg(Env.getCtx(), infoDisplay);
      //  Value2  ******
      Object value2 = null;
      if (MQuery.OPERATORS[MQuery.BETWEEN_INDEX].equals(op))
      {
View Full Code Here

  {
    if (columnName == null)
      return null;
    for (int c = 0; c < m_findFields.length; c++)
    {
      GridField field = m_findFields[c];
      if (columnName.equals(field.getColumnName()))
        return field;
    }
    return null;
  //  getTargetMField
View Full Code Here

TOP

Related Classes of org.compiere.model.GridField

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.