private void execute4Instance(final List<Instance> _instances)
        throws EFapsException
    {
        final Set<String>altOIDSel = new HashSet<>();

        // evaluate for all expressions in the table
        final MultiPrintQuery multi = new MultiPrintQuery(_instances);
        final List<Integer> userWidthList = getUserWidths();

        final List<Field> fields = getUserSortedColumns();
        int i = 0;
        final Type type;
        if (_instances.size() > 0) {
            type = _instances.get(0).getType();
        } else {
            type = getTypeFromEvent();
        }

        for (final Field field : fields) {
            if (field.hasAccess(getMode(), getInstance(), getCommand(), getInstance())
                            && !field.isNoneDisplay(getMode())) {
                Attribute attr = null;
                if (_instances.size() > 0) {
                    if (field.getSelect() != null) {
                        multi.addSelect(field.getSelect());
                    } else if (field.getAttribute() != null) {
                        multi.addAttribute(field.getAttribute());
                    } else if (field.getPhrase() != null) {
                        multi.addPhrase(field.getName(), field.getPhrase());
                    } else if (field.getMsgPhrase() != null) {
                        multi.addMsgPhrase(new SelectBuilder(getBaseSelect4MsgPhrase(field)), field.getMsgPhrase());
                    }
                    if (field.getSelectAlternateOID() != null) {
                        multi.addSelect(field.getSelectAlternateOID());
                        altOIDSel.add(field.getSelectAlternateOID());
                    }
                    if (field.containsProperty(UITableFieldProperty.SORT_SELECT)) {
                        multi.addSelect(field.getProperty(UITableFieldProperty.SORT_SELECT));
                    } else if (field.containsProperty(UITableFieldProperty.SORT_PHRASE)) {
                        multi.addPhrase(field.getProperty(UITableFieldProperty.SORT_PHRASE),
                                        field.getProperty(UITableFieldProperty.SORT_PHRASE));
                    } else if (field.containsProperty(UITableFieldProperty.SORT_MSG_PHRASE)) {
                        multi.addMsgPhrase(field.getProperty(UITableFieldProperty.SORT_MSG_PHRASE));
                    }
                }
                if (field.getAttribute() != null && type != null) {
                    attr = type.getAttribute(field.getAttribute());
                }
                SortDirection sortdirection = SortDirection.NONE;
                if (field.getName().equals(getSortKey())) {
                    sortdirection = getSortDirection();
                }
                if (field.getFilter().getAttributes() != null) {
                    if (field.getFilter().getAttributes().contains(",")) {
                        if (field.getFilter().getAttributes().contains("/")) {
                            attr = Attribute.get(field.getFilter().getAttributes().split(",")[0]);
                        } else {
                            attr = type.getAttribute(field.getFilter().getAttributes().split(",")[0]);
                        }
                    } else {
                        if (field.getFilter().getAttributes().contains("/")) {
                            attr = Attribute.get(field.getFilter().getAttributes());
                        } else {
                            attr = type.getAttribute(field.getFilter().getAttributes());
                        }
                    }
                }
                if (!field.isHiddenDisplay(getMode())) {
                    final FieldConfiguration fieldConfig = new FieldConfiguration(field.getId());
                    final UITableHeader uiTableHeader = new UITableHeader(this, fieldConfig, sortdirection, attr);
                    if (this.filterTempCache.containsKey(uiTableHeader.getFieldName())) {
                        this.filters.put(uiTableHeader.getFieldName(),
                                        this.filterTempCache.get(uiTableHeader.getFieldName()));
                        uiTableHeader.setFilterApplied(true);
                    } else if (uiTableHeader.getFilter().isRequired()) {
                        this.filters.put(uiTableHeader.getFieldName(), new TableFilter(uiTableHeader));
                    }
                    getHeaders().add(uiTableHeader);
                    if (!fieldConfig.isFixedWidth()) {
                        if (userWidthList != null && userWidthList.size() > i) {
                            if (isShowCheckBoxes() && userWidthList.size() > i + 1) {
                                uiTableHeader.setWidth(userWidthList.get(i + 1));
                            } else {
                                uiTableHeader.setWidth(userWidthList.get(i));
                            }
                        }
                        setWidthWeight(getWidthWeight() + fieldConfig.getWidthWeight());
                    }
                }
                i++;
            }
        }
        multi.setEnforceSorted(isEnforceSorted());
        multi.execute();

        if (!altOIDSel.isEmpty()) {
            final List<Instance> inst = new ArrayList<>();
            for (final String sel : altOIDSel) {
                inst.addAll(multi.getInstances4Select(sel));
            }
            checkAccessToInstances(inst);
        }
        executeRowResult(multi, fields);

        if (getSortKey() != null) {
            sort();
        }
    }
private void execute4Instance ( final List < Instance > _instances ) throws EFapsException { final Set < String > altOIDSel = new HashSet < > ( ) ; final MultiPrintQuery multi = new MultiPrintQuery ( _instances ) ; final List < Integer > userWidthList = getUserWidths ( ) ; final List < Field > fields = getUserSortedColumns ( ) ; int i = 0 ; final Type type ; if ( _instances . size ( ) > 0 ) { type = _instances . get ( 0 ) . getType ( ) ; } else { type = getTypeFromEvent ( ) ; } for ( final Field field : fields ) { if ( field . hasAccess ( getMode ( ) , getInstance ( ) , getCommand ( ) , getInstance ( ) ) && ! field . isNoneDisplay ( getMode ( ) ) ) { Attribute attr = null ; if ( _instances . size ( ) > 0 ) { if ( field . getSelect ( ) != null ) { multi . addSelect ( field . getSelect ( ) ) ; } else if ( field . getAttribute ( ) != null ) { multi . addAttribute ( field . getAttribute ( ) ) ; } else if ( field . getPhrase ( ) != null ) { multi . addPhrase ( field . getName ( ) , field . getPhrase ( ) ) ; } else if ( field . getMsgPhrase ( ) != null ) { multi . addMsgPhrase ( new SelectBuilder ( getBaseSelect4MsgPhrase ( field ) ) , field . getMsgPhrase ( ) ) ; } if ( field . getSelectAlternateOID ( ) != null ) { multi . addSelect ( field . getSelectAlternateOID ( ) ) ; altOIDSel . add ( field . getSelectAlternateOID ( ) ) ; } if ( field . containsProperty ( UITableFieldProperty . SORT_SELECT ) ) { multi . addSelect ( field . getProperty ( UITableFieldProperty . SORT_SELECT ) ) ; } else if ( field . containsProperty ( UITableFieldProperty . SORT_PHRASE ) ) { multi . addPhrase ( field . getProperty ( UITableFieldProperty . SORT_PHRASE ) , field . getProperty ( UITableFieldProperty . SORT_PHRASE ) ) ; } else if ( field . containsProperty ( UITableFieldProperty . SORT_MSG_PHRASE ) ) { multi . addMsgPhrase ( field . getProperty ( UITableFieldProperty . SORT_MSG_PHRASE ) ) ; } } if ( field . getAttribute ( ) != null && type != null ) { attr = type . getAttribute ( field . getAttribute ( ) ) ; } SortDirection sortdirection = SortDirection . NONE ; if ( field . getName ( ) . equals ( getSortKey ( ) ) ) { sortdirection = getSortDirection ( ) ; } if ( field . getFilter ( ) . getAttributes ( ) != null ) { if ( field . getFilter ( ) . getAttributes ( ) . contains ( "," ) ) { if ( field . getFilter ( ) . getAttributes ( ) . contains ( "/" ) ) { attr = Attribute . get ( field . getFilter ( ) . getAttributes ( ) . split ( "," ) [ 0 ] ) ; } else { attr = type . getAttribute ( field . getFilter ( ) . getAttributes ( ) . split ( "," ) [ 0 ] ) ; } } else { if ( field . getFilter ( ) . getAttributes ( ) . contains ( "/" ) ) { attr = Attribute . get ( field . getFilter ( ) . getAttributes ( ) ) ; } else { attr = type . getAttribute ( field . getFilter ( ) . getAttributes ( ) ) ; } } } if ( ! field . isHiddenDisplay ( getMode ( ) ) ) { final FieldConfiguration fieldConfig = new FieldConfiguration ( field . getId ( ) ) ; final UITableHeader uiTableHeader = new UITableHeader ( this , fieldConfig , sortdirection , attr ) ; if ( this . filterTempCache . containsKey ( uiTableHeader . getFieldName ( ) ) ) { this . filters . put ( uiTableHeader . getFieldName ( ) , this . filterTempCache . get ( uiTableHeader . getFieldName ( ) ) ) ; uiTableHeader . setFilterApplied ( true ) ; } else if ( uiTableHeader . getFilter ( ) . isRequired ( ) ) { this . filters . put ( uiTableHeader . getFieldName ( ) , new TableFilter ( uiTableHeader ) ) ; } getHeaders ( ) . add ( uiTableHeader ) ; if ( ! fieldConfig . isFixedWidth ( ) ) { if ( userWidthList != null && userWidthList . size ( ) > i ) { if ( isShowCheckBoxes ( ) && userWidthList . size ( ) > i + 1 ) { uiTableHeader . setWidth ( userWidthList . get ( i + 1 ) ) ; } else { uiTableHeader . setWidth ( userWidthList . get ( i ) ) ; } } setWidthWeight ( getWidthWeight ( ) + fieldConfig . getWidthWeight ( ) ) ; } } i ++ ; } } multi . setEnforceSorted ( isEnforceSorted ( ) ) ; multi . execute ( ) ; if ( ! altOIDSel . isEmpty ( ) ) { final List < Instance > inst = new ArrayList < > ( ) ; for ( final String sel : altOIDSel ) { inst . addAll ( multi . getInstances4Select ( sel ) ) ; } checkAccessToInstances ( inst ) ; } executeRowResult ( multi , fields ) ; if ( getSortKey ( ) != null ) { sort ( ) ; } }
@param _instances list of instances the table is executed for
@throws EFapsException on error