Search in sources :

Example 1 with ColumnBasedValueList

use of com.servoy.j2db.server.ngclient.ColumnBasedValueList in project servoy-client by Servoy.

the class ValueListTypeSabloValue method initializeValuelistAndFormat.

private void initializeValuelistAndFormat() {
    INGApplication application = dataAdapterListToUse.getApplication();
    ValueList valuelistPersist = getValuelistPersist(valuelistIdentifier, application);
    format = getComponentFormat(vlPD, dataAdapterListToUse, getConfig(), dataproviderID, webObjectContext);
    if (valuelistPersist != null) {
        valueList = getRealValueList(application, valuelistPersist, format, dataproviderID);
        if (customValueListDataSet != null && valuelistPersist.getValueListType() == IValueListConstants.CUSTOM_VALUES) {
            valueList = ValueListFactory.fillRealValueList(application, valuelistPersist, IValueListConstants.CUSTOM_VALUES, ((CustomValueList) valueList).getFormat(), ((CustomValueList) valueList).getValueType(), customValueListDataSet);
        }
    } else {
        if ("autoVL".equals(getConfig().getDefaultValue())) {
            ITable table = getTableForDp();
            if (dataproviderID != null && table != null && table.getColumnType(dataproviderID) != 0) {
                valueList = new ColumnBasedValueList(application, table.getServerName(), table.getName(), dataproviderID);
            } else {
                // not supported empty valuelist (based on relations) just return an empty valuelist
                valueList = new CustomValueList(application, null, "", false, IColumnTypes.TEXT, null);
            }
        }
    }
}
Also used : CustomValueList(com.servoy.j2db.dataprocessing.CustomValueList) ColumnBasedValueList(com.servoy.j2db.server.ngclient.ColumnBasedValueList) INGApplication(com.servoy.j2db.server.ngclient.INGApplication) ValueList(com.servoy.j2db.persistence.ValueList) LookupValueList(com.servoy.j2db.dataprocessing.LookupValueList) ColumnBasedValueList(com.servoy.j2db.server.ngclient.ColumnBasedValueList) DBValueList(com.servoy.j2db.dataprocessing.DBValueList) CustomValueList(com.servoy.j2db.dataprocessing.CustomValueList) IValueList(com.servoy.j2db.dataprocessing.IValueList) ITable(com.servoy.j2db.persistence.ITable)

Aggregations

CustomValueList (com.servoy.j2db.dataprocessing.CustomValueList)1 DBValueList (com.servoy.j2db.dataprocessing.DBValueList)1 IValueList (com.servoy.j2db.dataprocessing.IValueList)1 LookupValueList (com.servoy.j2db.dataprocessing.LookupValueList)1 ITable (com.servoy.j2db.persistence.ITable)1 ValueList (com.servoy.j2db.persistence.ValueList)1 ColumnBasedValueList (com.servoy.j2db.server.ngclient.ColumnBasedValueList)1 INGApplication (com.servoy.j2db.server.ngclient.INGApplication)1