/** * Returns a value suitable for use as part of an HTML ID attribute that uniquely identifies this row. If rowIdentifier() * is set, used row().valueForKeyPath(rowIdentifier()), otherwise uses "row_" and the index of the row in the list of objects. * * @return a value suitable for use as part of an HTML ID attribute that uniquely identifies this row */ public String rowID() { if (rowIdentifier() != null) { return ERXStringUtilities.safeIdentifierName(row().valueForKeyPath(rowIdentifier()).toString()); } return "row_" + String.valueOf(rowIndex()); }
/** * @return the value from row() corresponding to currentColumn(), formatted * as configured */ public Object columnValue() { // Special case when there is no keyPath: return the row object. This is // intended for custom components // where there is no specific value if (currentKeyPath() == null || currentKeyPath().length() == 0) { return row(); } Object rawValue = row().valueForKeyPath(currentKeyPath()); Format formatter = columnFormatter(); return (formatter != null && rawValue != null) ? formatter.format(rawValue) : rawValue; }
public Object val() { if (_isTotal) { return _totalValue; } if(_record == null || _record.rawRecord() == null) return null; if(_attribute.isComputed()) { // String code = _attribute.keyPath().substring(1); // we ignore WOOgnl because it is handled in the reporting framework return null; } return _record.rawRecord().valueForKeyPath(_attribute.keyPath()); }
/** * Returns the value for the given record. * If {@link #useMethod()} is given, the method is called and no further * action is taken if that fails. * Otherwise we use {@link NSKeyValueCoding} which also considers instance * variables. */ public Object valueForRecord(DRRecord rec) { Object aval = null; if (_useMethod) { try{ aval = _selKey.invoke(rec.rawRecord()); } catch(IllegalAccessException e) { } catch(IllegalArgumentException e) { } catch(java.lang.reflect.InvocationTargetException e) { } catch(NoSuchMethodException e) { } } else { aval = rec.rawRecord().valueForKeyPath(_key); } return aval; }