Package ariba.ui.aribaweb.util

Examples of ariba.ui.aribaweb.util.AWEnvironmentStack$AWEnvironmentStackFieldValueClassExtension


    public void applyValues(AWRequestContext requestContext, AWComponent component)
    {
        if (!booleanValueForBinding(BindingNames.omitTags) &&
            !AWEditableRegion.disabled(requestContext())) {
            AWEnvironmentStack environmentStack = env();
            environmentStack.push(RadioValueKey, RadioDefaultKey);
            super.applyValues(requestContext, component);
            // get the radioSelection from the environment (put there
            // by one of the RadioButtons) and push to the parent
            Object radioSelection = environmentStack.pop(RadioValueKey);
            if (RadioDefaultKey.equals(radioSelection)) {
                radioSelection = null;
            }
            else {
                while (!(RadioDefaultKey.equals(environmentStack.pop(RadioValueKey)))) {
                    // balance the stack
                }
            }
            setValueForBinding(radioSelection, BindingNames.selection);
        }
View Full Code Here


    }

    static final void setClientSideConfirmation (AWRequestContext requestContext,
                                                 AWEncodedString confirmationId)
    {
        AWEnvironmentStack env = requestContext.pageComponent().env();

        List idList= (List)env.peek(ClientSideConfirmationIdList);
        if (idList == null) {
            idList = ListUtil.list();
            env.push(Confirmation.ClientSideConfirmationIdList, idList);
        }
        idList.add(confirmationId);
    }
View Full Code Here

    // Note: AWRadioButton is so specialized and unique that it doesn't make sense to support otherBindings on it.

    protected void awake ()
    {
        AWEnvironmentStack environmentStack = env();
        FieldValue envStackClassExtension = FieldValue.get(environmentStack);
        _radioName = (AWEncodedString)envStackClassExtension.getFieldValue(environmentStack, RadioNameKey);
        _selection = envStackClassExtension.getFieldValue(environmentStack, RadioSelectionKey);
        _value = valueForBinding(BindingNames.value);
    }
View Full Code Here

    protected AWEnvironmentStack env ()
    {
        if (_environmentStack == null) {
            AWSession session = requestContext().session(false);
            if (session == null) {
                _environmentStack = new AWEnvironmentStack();
            }
            else {
                _environmentStack = session.environmentStack();
            }
        }
View Full Code Here

    {
        AWPage page = requestContext.page();
        if (page == null)
            return null;

        AWEnvironmentStack env = page.env();

        Object awInputId = env.peek(AWLabel.awinputId);
        if (awInputId == null) {
            return null;
        }

        Assert.that((awInputId instanceof AWInputId), "Expected ariba.ui.aribaweb.core.AWInputId for awinputId. Received: %s", awInputId.getClass().getName());
View Full Code Here

public final class AWEnvironment extends AWAppendEnvironment
{
    public void applyValues(AWRequestContext requestContext, AWComponent component)
    {
        AWEnvironmentStack environmentStack = component.env();
        pushBindingValues(environmentStack, component);
        try {
            super.applyValues(requestContext, component);
        }
        finally {
View Full Code Here

        }
    }

    public AWResponseGenerating invokeAction(AWRequestContext requestContext, AWComponent component)
    {
        AWEnvironmentStack environmentStack = component.env();
        pushBindingValues(environmentStack, component);
        AWResponseGenerating actionResults = null;
        try {
            actionResults = super.invokeAction(requestContext, component);
        }
View Full Code Here

        }
    }

    public void renderResponse(AWRequestContext requestContext, AWComponent component)
    {
        AWEnvironmentStack environmentStack = environmentStack(component);
        pushBindingValues(environmentStack, component);
        try {
            super.renderResponse(requestContext, component);
        }
        finally {
View Full Code Here

        return context;
    }

    public static UIMeta.UIContext peekContext (AWComponent component)
    {
        AWEnvironmentStack env = component.env();
        return (UIMeta.UIContext)env.peek(EnvKey);
    }
View Full Code Here

    protected boolean pushPop (boolean isPush, boolean needCleanup,
                               AWComponent component)
    {
        boolean didCreate = false;
        AWEnvironmentStack env = component.env();
        Context context = (Context)env.peek(EnvKey);
        Assert.that(isPush || context != null, "Should always have context on pop");
        boolean forceCreate = isPush && (_pushNewContextBinding != null && _pushNewContextBinding.booleanValue(component) );
        if (context == null || forceCreate) {
            UIMeta meta = UIMeta.getInstance();
            context = meta.newContext();
            ((UIMeta.UIContext)context).setRequestContext(component.requestContext());
            env.push(EnvKey, context);
            didCreate = true;
        }

        if (component.requestContext().currentPhase() == AWRequestContext.Phase_Render) {
            // if we haven't checked, look for and init embedded MetaRules tags
            if (_hasMetaRuleChildren == 0) {
                _hasMetaRuleChildren = initEmbeddedMetaRules(component, context) ? 1 : -1;
            }
        }

        // If we have children, push our template on as context
        if (_hasMetaRuleChildren == 1) {
            context.merge(MetaRules.TemplateId, component.templateName());
        }

        AWBindingDictionary bindings = _bindings;
        if (isPush) {
            context.push();
            String scopeKey = (_scopeKeyBinding != null)
                                    ? (String)_scopeKeyBinding.value(component) : null;
            Map <String, Object> values;
            if (_valueMapBinding != null && ((values = (Map)_valueMapBinding.value(component)) != null)) {
                // ToDo: sort based on Meta (KeyData) defined rank (e.g. module -> class -> operation ...)
                // ToDo: cache sort?
                List<String> sortedKeys = new ArrayList(values.keySet());
                Collections.sort(sortedKeys);
                for (String key : sortedKeys) {
                    if (key.equals(scopeKeyBindingKey)) {
                        scopeKey = (String)values.get(key);
                    } else {
                        context.set(key, values.get(key));
                    }
                }
            }

            for (int index = bindings.size() - 1; index >= 0; index--) {
                AWBinding currentBinding = bindings.elementAt(index);
                Object value = currentBinding.value(component);
                String key = bindings.keyAt(index);
                context.set(key, value);
            }

            if (scopeKey != null) context.setScopeKey(scopeKey);
        } else {
            context.pop();
        }
        if (needCleanup) {
            env.pop(EnvKey);
        }
        return didCreate;
    }
View Full Code Here

TOP

Related Classes of ariba.ui.aribaweb.util.AWEnvironmentStack$AWEnvironmentStackFieldValueClassExtension

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.